This project is divided into 2 parts:
-
frontend: This is the frontend for accessing/using the API, written using React, Redux and Bootstrap.
-
the_flask_test: This is the backend flask api service.
Base path: /api/v1
- GET
/students
: Get all students - POST
/student
: Add new student - PUT
/student/<uuid>
: Update student by id - DELETE
/student/uuid
: Delete student by id
API is also documented on Swagger Hub
Before we begin with the setup process I would like to point that we've the deployed version up and running and you can use it to try out with out going into any hassels:
- API: 8080
- App: 3000
- Clone the Repo
- Go into the directory with:
cd the-flask-test
- Now run:
docker-compose up
- You can now access the below urls:
The react frontend sometimes does not automatically refreshes/updates the DOM. A manual reload/refresh is required to update the data. This issues seems related to docker and nginx as we were unable to reproduce the same in production.
Install and start the Postgres 11 database server.
And update the DATABASE_URL
accordingly in .env
file
- Clone the Repo
- (Optional) Install and activate venv
- Install the dependencies with
pip -r requirements.txt
or using Poetry withpoetry install
- We need to setup some environment variables so please take a look at
example.env
file and if everything looks ok then just move it to an.env
file using command:mv example.env .env
- Prepare the database using:
make db-upgrade
- To start the dev server:
make dev-start
or to run in prod using gunicorn run:make prod-start
- Assuming you are in the project root
cd frontend
- Install dependencies using:
npm install
oryarn install
- Start the app:
npm run start
oryarn run start