We are building a project to predict and analyze StackOverflow data using Spark & MLlib. This project visualizes the results generated by the Spark & MLib project using a node server and a react app.
The node server works as the backend of the system. It reads the generated results by Spark & MLib projects and sends them to the front-end react-app using several APIs.
We have used nvm for installing nodejs. The version of node we are using is 16.13.0.
Here is the link for installing nvm in macos and ubuntu:
https://nodesource.com/blog/installing-node-js-tutorial-using-nvm-on-mac-os-x-and-ubuntu/
For windows:
https://docs.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-windows.
- Clone the repository BigDataProject-StackOverFlow
- Run command in a terminal.
This command should be run only once for setting up the node environment of the project.
cd BigDataProject-StackOverFlow/node-server/ npm install
- Every time you want to run the node-server, you will use the following commands:
However run this command after setting up the environment using the commands described in point 2 above for the very first time. After that you can just run these commands to start the node server.
cd BigDataProject-StackOverFlow/node-server/ npm start
- Open your browser and go to https://localhost:3001.
We are using port 3001 instead of 3000 becasue our react-app is using port 3000.
This app visualizes the results generated by the Spark & MLib project
using different visualization technique such as column chart, pie chart, etc.
We have used create-react-app to create our react-app. Follow this link:
https://reactjs.org/docs/create-a-new-react-app.html
-
Use this command for the very first time for setting up the react environment.
cd BigDataProject-StackOverFlow/react-app npm install
- For starting the react server use the following commands:
Use this command after commands from point 1(if commands from point 1 needed).
cd BigDataProject-StackOverFlow/react-app npm start
- Open your browser and go to https://localhost:3000
Please start the node-server before staring the react-app