Access our app via the url:
https://peerprep-g16.netlify.app/
- Create a local MySQL database named
peerprep
. Make sure the database is running onlocalhost
port3306
. Note: this operation may require root previlege.-
In terminal, run
sudo mysql
to connect tomysql
as root user. -
In
mysql
console, runcreate database peerprep;
-
- In
mysql
console, create a database user using the followingmysql
command:create user peerprep_admin identified by 'cs3219_G16_yyds';
- In
mysql
console, grant previleges topeerprep_admin
using the followingmysql
command:grant all privileges on peerprep.* to peerprep_admin;
- In
mysql
console, connect to databasepeerprep
:use peerprep;
- In our repo directory
./peerprep/src/main/resources/sql/
, look for two filescreate_user_profile_table.sql
andcreate_peerprep_interview_tables.sql
. Copy the SQL scripts from these two files and execute inmysql
console. - So far, the tables have been set up.
- In our repo directory
./peerprep/src/main/resources/data/
, look for two csv filesCopy of leetcode questions.csv
andCopy of leetcode solutions.csv
which contain the questions and solutions used for our application - Simply use the MySQL visualization tool (MySQL Workbench, phpMyAdmin, etc.) to import
Copy of leetcode questions.csv
andCopy of leetcode solutions.csv
into tableinterview_questions
and tableinterview_solutions
respectively.
A local mail server is needed if you want to register a new account or reset password in our app.
Here we use MailDev
. Open your terminal, do the following to set up MailDev:
- Install MailDev:
npm install -g maildev
- Run MailDev:
maildev
- Access MailDev email portal via the link displayed on terminal. Usually it would be http://0.0.0.0:1080.
- For registering new account in our app, you need to go to this email portal to activate your account.
- For resetting password in our app, you need to go to this email portal to get the link for reset.
For more information about MailDev
, you may refer to this repository: https://github.com/maildev/maildev
- Download the
jar
file to an empty folder from the latest Release in our GitHub repository. cd
to the folder where thejar
file is downloaded.
Run the jar
file with command:
java -jar -Dspring.profiles.active=dev <jar-file-name>
Deployed domian: https://peerprep-g16.netlify.app/
In the frontend folder, run:
npm install
npm start
In the frontend folder, run:
yarn install
yarn start
- Open
src/apiHandler
folder - Toggle the comment at line 4 and 5 of each file in the folder to choose the URL to the corresponding backend server
To use the remote backend sever, please edit line 3-6 of each file in the folder as below:
const client = axios.create({
// baseURL: "http://localhost:8080/api/v1",
baseURL: "https://peerprep-backend-service-mepxozmoha-as.a.run.app/api/v1"
});
To use the local backend sever, please edit line 3-6 of each file in the folder as below:
const client = axios.create({
baseURL: "http://localhost:8080/api/v1",
// baseURL: "https://peerprep-backend-service-mepxozmoha-as.a.run.app/api/v1"
});
- Open
src/view/pages/authenticated/InterviewDashboard
- Toggle the comment at line 36 and 37 choose the URL to the corresponding backend server
To use the remote backend sever:
const [editingUrl, setEditingUrl] = useState("wss://peerprep-backend-service-mepxozmoha-as.a.run.app/interview/")
// const [editingUrl, setEditingUrl] = useState("ws://localhost:8080/interview/")
To use the local backend sever:
// const [editingUrl, setEditingUrl] = useState("wss://peerprep-backend-service-mepxozmoha-as.a.run.app/interview/")
const [editingUrl, setEditingUrl] = useState("ws://localhost:8080/interview/")