SJSU Fall 2019 CS157A Section 1 Team 23.
Project Requirement jobs
Rick: Project Overview / System Environment
Jordan: Non-functional Issues
Mohammad: Functional Requirements / GUI
Go to the official website of Node.JS to download it for your environment.
Select Version 10.16.3 for optimal compatibility.Download MySQL from here.
Follow the setup files to install MySQL, keep note of the username and password.
The database connector library does not support a few of the new features in version 8.x.x, and requires the password of your user to be reverted to 5.7.x format. So enter MySQL in command line or bash with the command:mysql -u [username] -p
When inside MySQL, run the following command:
SET PASSWORD FOR 'username'@'localhost' = OLD_PASSWORD('password');
This should resolve all issues with the DB connector library.
git clone
this repo into your local directorycd
into MentorMe1.1 directorycd
into backend directory and run -npm install
cd
into front directory and run -npm install
- Run the sql script in the root of the repo named
MentorMeDB.sql
in MySQLThe backend is powered by an ExpressJS framework and runs on port 5000. The frontend is powered by React and runs on port 3000.
MentorMeDB
contains a sample database.
For the backend modules to properly function, a few environment variables have to be set:
mm_jwtPrivateKey
mysqluser
mysqlpass
mm_jwtPrivateKey
will be the private key for Json Web Tokens to be generated. We will be using JWT Tokens as part of the request respose cycle by authenticating and authorizing users.
mysqluser
andmysqlpass
are the credentials for the username and password for the MySQL Community Server.The way to set environment variables differ between platforms and interface.
Only the terminal running the backend needs to set its env_var.// Windows CMD > set mm_jwtPrivateKey="value" > set mysqluser="username" > set mysqlpass="password" // Windows Powershell > $env:mm_jwtPrivateKey="value" > $env:mysqluser="username" > $env:mysqlpass="password" // Mac/Linux Bash Shell > export mm_jwtPrivateKey="value" > export mysqluser="username" > export mysqlpass="password"
- Open 2 terminals for each of the applications
- Run the backend with command -
node app
- Run the frontend with command -
npm start
If successful, the 2 terminals should display the following:
// Frontend > npm start Compiled with warnings. ... ... Search for the keywords to learn more about each warning. To ignore, add // eslint-disable-next-line to the line before.
// Backend > node app MentorMe listening on port 5000 Executing (default): SELECT 1+1 AS result database connected All models synced to tables
Using a web browser, go to localhost:3000 and start playing around with our app!
Note: Due to major browsers (Chrome, Safari) only allowing secure websockets (
wss://
) but not insecure ones (ws://
), Firefox is the only browser we've tested that works with full compatibility.
All http requests must be sent to port 5000 to utilize the backend APIs. It is easiest to test the APIs in a program such as Postman
NOTE: The React frontend has proxied into the backend port, so any http modules in React do not need to extend the port number to the backend.
- React - UI framework
- Bootstrap - CSS library
- Node.js - Backend runtime environment
- Express - Backend web framework
- Socket.io - Real-time event-based communication library
- MySQL Community Server - Database server
- Dr. Mike Wu - for leading a large class, keeping it entertaining for us, and encouraging us to do hands on learning.