This is a waiting list application that is used to put customers of a restaurant on a waiting list. I used the java framework Spring Boot and to store the data of the customers and restaurant I used MongoDB. Several endpoints have been created and all the API's are documented using Swagger2 which you can find below.
To run this application you must do the following below.
docker-compose -up .
or run:
mvn spring-boot:run
Installation
To install the application run npm install
which will download all the packages and dependencies for the application.
To Run Application Front End
To run this app locally run npm start
which Runs the app in the development mode.\
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.\
You will also see any lint errors in the console.
You will need to set these environment variables when running locally
Env Var | Description |
---|---|
SPRING_DATA_MONGODB_DATABASE | Name of the database which is used for data storage |
SPRING_DATA_MONGODB_URI | Database connection string used to connect to the database |
There are two tests in this application one that tests all the endpoints in the backend called Waitlist App Tests and another test called Integration Test that tests both the front end and backend. To run both tests you would first need the front end running for the Integration tests the command to run the front end is below and once the that is done you will be able to run both tests together using another command below.
to run the front end:
npm start
run both tests together:
mvn test
Load testing is set up using Locust. To have locust running ensure that python or python3 is installed on your machine and that pip is installed as well. Once those are installed you must then install locust using the command below.
To install locust
pip install locust
To run locust
locust -f loadTesting.py --host=http://localhost:8080
To set up your own database you must first create an Atlas account. Once that is done create a cluster select your preferred cloud provider and region enter your cluster name and deploy that cluster. The next step is to add your current IP address to set up a connection. Then create a new username and password to access your database and collections to your cluster. After that is all done download MongoDB Compass which allows you to connect to your database and create new collections.
For a more detailed explanation follow this link https://docs.atlas.mongodb.com/getting-started/.
npm install --save @optimizely/react-sdk