Skip to content

gegnew/zeitchallenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zeit Sr SWE Take Home Challenge

This application is built on FastAPI and React.

Prerequisites

You need a current version of Python and pip. You also need a current version of Node.

Installing

Clone code

git clone https://github.com/gegnew/zeitchallenge

Install backend dependencies

cd backend
pip install -e .
pip install -r requirements-dev.txt

Install frontend dependencies

cd frontend
npm install

Create .env file

Refer to .env.example in both frontend/ and backend/ and set required variables in project-root/frontend/.env and project-root/backend/.env, respectively.

Usage

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

Testing

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.

Deployment

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/:

  1. pytest.yml runs black, flake8, and pytest. This runs on every push to any branch.
  2. deploy.yml uses AWS SSM to run a deployment file on the "production" EC2 instance. It runs when a pull request is merged to the main 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

Owner

For questions about this package, please contact:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published