- Project hosted in AWS. Containers are pushed to ECR.
- The API is run using AppRunner, and can be accessed here: https://miuqehzpzg.us-east-1.awsapprunner.com/.
- Postgres DB provided by AWS.
- Lambda functions are run using containers uploaded to ECR. The function uses asyncio to make requests in parallel.
- Dev container set up for instant local development.
- Pytest based testing.
https://miuqehzpzg.us-east-1.awsapprunner.com/
The api docs are interactive, so you can test the endpoints right there.
We provide a docker-compose.yml
file for quick setup of the development environment. This includes all necessary services:
- Django application
- PostgreSQL database
- Lambda (for local testing)
To set up and start the development environment:
-
Install Prerequisites:
- Docker with Docker Compose
- Visual Studio Code
- VSCode extensions: "Dev Containers" and "Docker"
-
Create a
.env
file in the root directory of the project with the following content:
# For the api container
DJANGO_SECRET_KEY
DJANGO_DEBUG
DJANGO_ALLOWED_HOSTS
DATABASE_URL=postgres://<POSTGRES_USER>:<POSTGRES_PASSWORD>@db:<POSTGRES_PORT>/<POSTGRES_DB>
# For the db container
POSTGRES_USER
POSTGRES_PASSWORD
POSTGRES_DB
POSTGRES_PORT
# AWS Configuration
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION
-
Open the project in Visual Studio Code.
-
Press
Cmd + Shift + P
(on macOS) orCtrl + Shift + P
(on Windows/Linux) to open the command palette. -
Type "Dev Containers: Open Folder in Container" and select it.
-
Wait for the containers to be built and started. This may take a few minutes the first time.
-
Once the Dev Container is ready, open a new terminal in VS Code.
-
Run the following commands to set up the database and run the dev server:
make migrate make runserver
-
The application should now be running. You can access
http://0.0.0.0:8000/
to interact with the API. -
To test the lambda function, run
make lambda
inside the api container