This application has three components:
- A React based frontend
- A MongoDB database with a persistent volume
- A Flask based backend
To run the application:
- Clone the repository from https://github.com/dgboss/74942
- Open a command prompt to the root of the application.
- Run locally using docker with the following command:
docker-compose up -d
After running this command, the frontend application can be accessed in a web browser at http://localhost:3000.
The backend application is running at http://localhost:5000 with one endpoint /api
.
Caution: This application is currently configured to be run in a development setting. The application should not be deployed to a production environment as database names, usernames and passwords are contained within this repository to ease deployment in a development environment.
Instructions for User Story 3:
- Run the application:
docker-compose up -d
- Access the MongoDB container:
docker exec -it mongo bash
- Login to mongo as root admin:
mongo -u admin -p
- Enter the password when prompted:
74942
- Select the database:
use 74942app
- Get a collection representing the number of API requests that have been logged:
collection = db.service_area_api_result
- Display a count of the collection:
collection.count()
- To quit the database connection:
quit()
- To exit the shell:
exit
Frontend Unit Tests
- Open a command prompt and go to the
./react_frontend
directory - npm install
- npm run test
- 'a' to run all tests