codekids-vt / codekids

A resource designed to help children learn coding basics with fun interactive books!
https://codekids.cs.vt.edu
3 stars 3 forks source link
fastapi prisma python react

Codekids App

Create env

cd backend
cp .env.example .env

Run backend

python -m venv .venv
source .venv/bin/activate
cd backend
pip install -r requirements.txt
prisma generate  # needs a running database
uvicorn src.main:app --reload --port 8080

To startup a local database, you can use the following command:

cd backend
docker compose up -d

Run frontend

cd frontend
npm i
npm start

Checks and Formatting

These commands should be run before pushing code. They will check if the code is formatted correctly and if the tests will pass in the CI.

cd frontend
npm run format
CI=True npm run build
cd ../backend
black . --check

To take a backup of the database, you can use the following command:

pg_dump -h endeavour.cs.vt.edu -p 30030 -U postgres -d codekids > codekids-db-$(date +%Y-%m-%d).bak