A web application that tracks customer reviews of EVs
Copyright 2021 Quantic School of Business and Technology
To build this app on a single machine for development (N.B.: these instructions aren't sufficient to install on cloud servers):
- Install NodeJS and npm (https://nodejs.org/en/download/ for download and instructions). We recommend using the Prebuilt Installer.
- Install MySQL Server (https://dev.mysql.com/downloads/mysql for download and instructions). For Windows, we recommend using the MSI Installer. For MacOS, we recommend using the DMG package appropriate for your architecture.
- Start the MySQL shell
- Mac:
/usr/local/mysql/bin/mysql --user=root --password
. If you get an error about not being able to connect, go to the System Preferences panel, select MySQL, then Configuration, then uncheck Keyring Data File, then go to Instances and start the server. - Linux: TBD
- Windows: open the MySQL Shell app then enter:
\connect root@localhost
. If the prompt ends withJS
, enter this command:\sql
.
- Mac:
- In the MySQL shell, execute the following commands:
CREATE USER 'Quantic_Dev'@'localhost' IDENTIFIED BY 'Quantic_Dev';
GRANT ALL ON ev_ratings.* TO 'Quantic_Dev'@'localhost';
CREATE USER 'ratemyev_user'@'localhost' IDENTIFIED BY 'ratemyev_user';
GRANT DELETE, INSERT, SELECT, UPDATE ON ev_ratings.* TO 'ratemyev_user'@'localhost';
- Exit MySQL then fork and clone the repo using this command:
git clone <url>
(find the url in GitHub using the Code button in the repo)- If you're asked for a username and password, enter your username as normal but then for the password you need to enter your Personal Access Token and not your GitHub account password. For more information on PAT see https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token.
- Change to Rate-My-EV directory and install NodeJS dependencies with this
command:
npm install
- Change to the admin directory and install React dependencies with this
command:
npm install
- Now build the admin React app with this command:
npm run build
- Change back to the Rate-My-EV directory, then to the client directory.
Install React dependencies with this command:
npm install
- Build the client React app with this command:
npm run build
To run this app in developer mode (i.e with the clients automatically refreshing when you make changes to their code):
- In the Rate-My-EV directory, start the server with this
command:
node server
- In each of the admin and client directories, start the React apps
with this command:
npm start
- A browser window for each app should automatically start.
- Note that one of the clients will be running on port 3000 and the other on port 3001.
To run this app in production mode (i.e. with the clients served as static files):
- In the Rate-My-EV directory, start the server with this
command:
node server
- Open a browser at http://localhost:5000 to see the user-side client, or http://localhost:5000/admin to see the admin options.