This application is built on FastAPI and React.
You need a current version of Python and pip. You also need a current version of Node.
git clone https://github.com/gegnew/zeitchallenge
cd backend
pip install -e .
pip install -r requirements-dev.txt
cd frontend
npm install
Refer to .env.example
in both frontend/
and backend/
and set required
variables in project-root/frontend/.env
and project-root/backend/.env
,
respectively.
Start the backend server:
cd backend
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
Start the frontend server:
cd frontend
npm run start
Tests for the backend are written with pytest.
Run all tests from the command line with pytest
. Run a single test with
pytest tests/path/to/file
. Alternatively, use a test
runner.
There is only one instance of zeitchallenge
, deployed with docker-compose
on an EC2 server.
Deployment is managed with Github
Actions. This is the "simplest-possible"
CI/CD with two workflows, defined in project-root/.github/workflows/
:
pytest.yml
runsblack
,flake8
, andpytest
. This runs on every push to any branch.deploy.yml
uses AWS SSM to run a deployment file on the "production" EC2 instance. It runs when a pull request is merged to themain
branch.
The deploy.yml
workflow simply runs a "deploy.sh" script, which does:
#!/bin/sh
cd zeitchallenge
sudo git fetch --all
sudo git reset --hard origin/main
sudo docker-compose up --build -d
For questions about this package, please contact: