This project contains both the frontend and backend of the application:
/backend
: Django application which uses:Postgres
for the databaseRabbitMQ
for the message brokerCelery
for background tasksMeiliSearch
for search
/frontend
: React application
Note that when building and deploying the application, the frontend is built and served by the backend directly, meaning we only deploy 1 application.
This application is build using docker
and docker-compose
. Make sure to install them:
Before starting the application, you will need to create the .env
and .env.test
files
cp backend/.env.example backend/.env
cp backend/.env.test.example backend/.env.test
Then you can start the application:
docker-compose up
While the entire project runs with docker-compose
, you might want to
install a python virtual environment and the node modules locally
for a better IDE experience.
Regarding the way we boot the Django app:
docker-compose up
will built and boot all of our containers- The django container will call
supervisord
to boot the Django app - The
supervisord.conf
will call bothrun-app.sh
andrun-celery-worker.sh
run-app.sh
will run a few commands and start the app
Also, when building the production image, the frontend is built and served by the backend directly.
Because everything runs in docker containers,
commands also need to be run inside the container.
To make things simpler, a Makefile
is provided
for frequent/common commands.
make api_makemigrations
make front_test
make setup_githooks
Run make help
for more info.
Git hooks are set in the .githooks folder
(as .git/hooks
is not tracked in .git
)
Run the following command to tell git
to look for hooks in this folder:
git config core.hooksPath .githooks
or you can run the Makefile
action
make setup_githooks
We use GitHub actions to verify, build, and deploy the application. We currently have:
- dependabot: Dependabot configuration for frontend dependencies
- update-python-dependencies: Updates the python dependencies using
uv
- qa-backend: runs ruff, mypy, and tests
- qa-frontend: runs biome and frontend tests
- rebase-check: checks if the branch can be rebased on
main
- deploy: deploys the application on fly.io
Name | URL |
---|---|
Frontend | http://localhost:3000/ |
Backend | |
-- Home | http://localhost:8000/ |
-- Admin | http://localhost:8000/admin/ |
-- Swagger | http://localhost:8000/api/swagger/ |
-- API | http://localhost:8000/api/v1/ |
Meilisearch | |
-- Default UI | http://localhost:7700/ |
-- Advanced UI | http://localhost:24900/ |
RabbitMQ | |
-- Connection | http://localhost:5672/ |
-- Management UI | http://localhost:15672/ |
Deployment is done through fly.io. When deploying the application for the first time, you will need to:
- Create an account on fly.io
- Install the
flyctl
CLI - Run
fly launch
to create a new application - Configure it however you want
- Make sure to set the
FLY_ACCESS_TOKEN
secret in the GitHub repository - Then create a new release to trigger the deploy github action