It is important to note that both the backend and frontend are considered to be separate applications. One can run without the other with no problem (except for the api requests that will always throw an error if the backend is not on).
Frontend - runs on port 3000
Backend - runs on port 8080
You can access the first staff account with these credentials:
password
: secret
- Click on
File
- Click on
Import...
- Open the
Maven
menu - Click on
Existing Maven Projects
- Click on
Next
- Select the
Browse...
option - Navigate to the place where you cloned the repository
- Click on
Finish
Cleaning the project
- Right click on the project in the
Project Explorer
- Hover over
Run As...
- Click on
Maven clean
Installing the project
- Right click on the project in the
Project Explorer
- Hover over
Run As...
- Click on
Maven install
Building the project
- Right click on the project in the
Project Explorer
- Hover over
Run As...
- Click on
Maven build
- In the
Goals
field, writeclean install
- Click on
Run
- Right click on the project in the
Project Explorer
- Hover over
Run As...
- Click on
Run on Server
- Open the
Apache
menu - Select
Tomcat v10.0 Server
- Click on
Next
- If you do not have this version of apache on your device, click on
Download and Install...
- Click on
Finish
NB: Before doing this, you'll need to have installed the Apache server. You can find how to do so on the 4th step. Otherwise, you might get errors such as NullPointerException, since you won't have the right configurations for the authentication process.
- Add the variable
SRC_PATH
to your environment files. This should be the path to thesrc
folder of this project. e.g.C:\Users\Ilyes\Documents\Repos\Assignments\src
or/Users/ilyeshadji/Documents/Repos/Assignments/src
Here is an example on how you could add a variable to your environment using Eclipse
- Click on the
RUN
dropdown on your top menu - Click on the
Run Configurations
option - Select the
Environment
tab - On the right, you will see an
Add
button, click on it - Write the name of the variable (
DB_USERNAME
for example) - Write the value of the variable (
root
for example) - Click on
OK
- Click on
Apply
on the bottom right.
Congrats! You are now all setup to jump in and test this wonderful web application. Make sure to select one of the environments (Customer or Staff), or else you will get nasty 406 errors :(
You can switch between a regular customer, or a staff member to be able to perform the actions you would like. Be careful, some of them are not accessible depending on the environment on which you are connected.
NB: You'll find key.pem in the source files; RSA key for the generation of the token, this should never be there for security concerns
In your terminal, go inside the folder Frontend located in the src directory like in the example below
cd src
cd frontend
Then install the dependencies like follows
npm install
Then, to start the server, run
npm start
Alternatively, when you build the project, make sure to uncheck the option Skip Tests
and you will run the tests at the same time that you are building the application.
That's it!