A secure platform where Penn students can buy/sell items and browse/post sublet opportunities. This repo contains the full-stack application (Next.js frontend + Django backend) along with Postgres, Redis, and a fully containerized development environment.
Hybrid approach: Services (Postgres, Redis, Django, Next.js) run in Docker for consistency, but dependencies are also installed locally for IDE support (autocomplete, type checking, go-to-definition).
- Docker Desktop β Run the app containers
- macOS:
brew install --cask dockeror download from docker.com - Linux: Install via system package manager + docker-compose plugin
- Windows: Download from docker.com
- macOS:
These install dependencies locally so your IDE (VSCode/Cursor) can:
- Provide autocomplete and type hints
- Resolve imports (no red squiggles)
- Run linters and formatters
- Enable go-to-definition
The app itself runs in Docker - you don't need Python, Node, Postgres, or Redis installed system-wide.
git clone https://github.com/pennlabs/penn-marketplace.git
cd penn-marketplacemake setupThis runs scripts/setup.sh, which:
- β
Verifies
uvandpnpmare installed - π¦ Installs backend Python dependencies locally β
backend/.venv/ - π¦ Installs frontend Node dependencies locally β
frontend/node_modules/ - πͺ Installs pre-commit hooks into
.git/hooks/
You only need to do this once.
- IDE tooling works (autocomplete, type hints, import resolution)
- Pre-commit hooks run on your machine before commits
- The app still runs in Docker for consistency
make upor
docker compose upmake up-dor
docker compose up -dThis will:
- Build Docker images (if needed)
- Start Postgres + Redis
- Run Django migrations automatically
- Launch services:
- Frontend β http://localhost:3000
- Backend β http://localhost:8000
- Database β localhost:5432 (accessible with DB tools)
- Redis β localhost:6379
make downor
docker compose downmake cleanWhat clean does:
- Stops and removes all containers
- Deletes database volumes (all data lost)
- Removes
backend/.venv/ - Removes
frontend/node_modules/
Use this only when:
- You need a completely fresh start
- Database migrations are irreversibly broken
- Dependencies are corrupted
| Task | Command |
|---|---|
| Start dev environment | make up-d |
| Stop containers | make down |
| View logs | make logs |
| View logs (specific service) | make logs-backend or make logs-frontend |
| Rebuild Docker images | make build |
| Backend Django shell | make shell-backend |
| Frontend shell | make shell-frontend |
| Database shell | make shell-db |
| Run migrations | make migrate |
| Create migrations | make makemigrations |
| Run backend tests | make test-backend |
| Run frontend tests | make test-frontend |
| Generate fake data | make generate-data |
| Run all quality checks | make check |
| Auto-fix formatting | make format |
make makemigrations # Create migration files
make migrate # Apply migrationsmake down
make upMigrations run automatically on startup, so you don't need to run them manually when pulling.
make down
docker volume rm penn-marketplace_postgres-data
make up1. Add the package locally (updates pyproject.toml and uv.lock):
cd backend
uv add2. Sync to container (picks up the updated lock file):
docker compose exec backend uv syncThat's it! No rebuild needed. The container reads the updated uv.lock file.
1. Add the package locally (updates package.json and pnpm-lock.yaml):
cd frontend
pnpm add2. Sync to container (picks up the updated lock file):
docker compose exec frontend pnpm installThat's it! No rebuild needed. The container reads the updated pnpm-lock.yaml file.
- Install locally first β Updates lock files (
uv.lock,pnpm-lock.yaml) - Sync in container β Container picks up changes from the lock files via volume mount
- Your IDE gets autocomplete immediately
- You don't have to run the install command twice
- No rebuild needed because lock files are mounted into the container
Only if you change the Dockerfile itself (like adding system packages or changing base image):
docker compose up --build backend # For backend
docker compose up --build frontend # For frontendmake checkor
./scripts/check.shmake formator
./scripts/check.sh --fixInstalled automatically via make setup.
What they do:
- β¨ Format Python code (ruff format)
- π Lint Python code (ruff check)
- β¨ Format JS/TS/JSON/CSS (Prettier)
- π Lint JS/TS (ESLint)
- π Check TypeScript types
- π§Ή Fix trailing whitespace
Hooks run automatically before each commit. If checks fail, the commit is blocked.
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- Host:
localhost - Port:
5432 - Database:
penn_marketplace - User:
postgres - Password:
postgres
- Host:
localhost - Port:
6379