A website for ranking student-made projects at UF.
Backend:
- Python 3.12+
- FastAPI
- Pydantic
- SQLAlchemy
- Supabase
- uv
Frontend:
- TypeScript
- Next.js 16
- Chakra UI
- Bun
- Sync dependencies with uv:
cd backend
uv sync- Select the Python interpreter in VS Code:
- Press
Cmd+Shift+PorCtrl+Shift+P - Type "Python: Select Interpreter"
- Choose
./backend/.venv/bin/python3
- Run the FastAPI server:
uv run uvicorn app.main:app --reloadThe backend server will be available at http://localhost:8000
API documentation (Swagger UI) is available at http://localhost:8000/docs 4. To run backend tests:
uv run pytestMigrations are managed in backend/alembic/ and use the backend DATABASE_URL from backend/.env.
- Apply all pending migrations:
cd backend
uv run alembic upgrade head- Create a new migration after changing SQLModel models:
cd backend
uv run alembic revision --autogenerate -m "describe schema change"- Apply one new migration (or all pending):
cd backend
uv run alembic upgrade head- Roll back the most recent migration:
cd backend
uv run alembic downgrade -1- View migration history:
cd backend
uv run alembic history
uv run alembic currentNotes:
- Alembic derives a sync migration URL automatically from
DATABASE_URL(you do not need a separate env var). - Always review autogenerated migration files before running
upgrade.
- Install dependencies with bun:
cd frontend
bun install- Run the Next.js development server:
bun devThe frontend will be available at http://localhost:3000
Docker Compose lets you run both the backend and frontend with a single command instead of starting each server separately. Requires Docker Desktop.
- Copy the environment files and fill in your values:
cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.envKey values to set:
backend/.env:DATABASE_URL(your Supabase connection string),CORS_ORIGINS=http://localhost:3000frontend/.env:NEXT_PUBLIC_API_BASE_URL=http://localhost:8000
- Start the full stack (attached mode, recommended):
docker compose -p gatorrank up --buildThis runs in your current terminal and streams logs live.
Press Ctrl+C to stop the stack.
- Daily start (attached, no rebuild):
docker compose -p gatorrank upNote:
- Run either service separately (attached):
# backend only (attached) docker compose -p gatorrank up backend # frontend only (attached) docker compose -p gatorrank up frontend- Use detached mode for the full stack:
# full stack (detached) docker compose -p gatorrank up -d # stop detached services docker compose -p gatorrank down
- Open the app:
- Frontend:
http://localhost:3000 - Backend:
http://localhost:8000 - API docs (Swagger UI):
http://localhost:8000/docs
- View logs (useful in detached mode):
docker compose -p gatorrank logs -f backend
docker compose -p gatorrank logs -f frontend- If you change
backend/.envorfrontend/.env, recreate so new env vars are loaded:
docker compose -p gatorrank up -d --force-recreate- Run multiple repo clones at once (different ports):
FRONTEND_PORT=3001 BACKEND_PORT=8001 docker compose -p gatorrank1 up
FRONTEND_PORT=3002 BACKEND_PORT=8002 docker compose -p gatorrank2 up
FRONTEND_PORT=3003 BACKEND_PORT=8003 docker compose -p gatorrank3 upNotes:
- The
--buildflag rebuilds images when Dockerfile or dependency files change. You can omit it for normal restarts.- Compose env vars from
env_fileare loaded at container creation time. If.envvalues change, use--force-recreate(or remove/recreate the service).- Keep using the same project name (
-p gatorrank) so all commands target the same containers.- Polling is off by default for speed. If file changes are not detected on your machine, enable polling only when needed:
WATCHPACK_POLLING=true CHOKIDAR_USEPOLLING=true docker compose -p gatorrank up -d frontend
Common issue: backend still uses old DATABASE_URL after you edit backend/.env
Pre-commit runs a small set of automated checks before commits. In this repo it:
- trims trailing whitespace and ensures files end with a newline
- runs
ruff+ruff formatfor backend Python files - runs
pyrightfor backend type checking - runs
eslintandtsc --noEmitfor frontend linting and type checking - runs
prettierfor frontend TypeScript/JavaScript/CSS/JSON/YAML/Markdown files
Install the pre-commit runner once:
uv tool install pre-commitThen enable the hooks for this repo:
# in the project root
pre-commit install
pre-commit run --all-filesNote: If a pre-commit hook auto-fixes files during
git commit, pre-commit will stop the commit so you can review the changes. Re-stage the modified files (e.g.,git add <files>) and rungit commitagain.
- Create a feature branch from
main - Make your changes
- Open a pull request to
main - Get review approval before merging
GitHub Actions automatically runs pre-commit run --all-files on every pull request and whenever commits are pushed to or merged into main.
main- Production-ready codefeature/* - New features and changesfix/*- Bug fixesrefactor/*- Code refactoringhotfix/*- Urgent production fixesdocs/*- Documentation updatestest/*- Test additions or updatesstyle/*- Code style changes