Skip to content

Commit b6e744a

Browse files
authored
Merge branch 'master' into luke/moderation
2 parents 1f28599 + 84946a4 commit b6e744a

97 files changed

Lines changed: 2584 additions & 1836 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Build Marketplace
2+
3+
on: push
4+
5+
jobs:
6+
backend-check:
7+
name: Backend Checks
8+
runs-on: ubuntu-latest
9+
container:
10+
image: ghcr.io/astral-sh/uv:python3.11-bookworm
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Install dependencies
14+
run: |-
15+
cd backend
16+
uv sync --frozen
17+
- name: Run ruff check
18+
run: |-
19+
cd backend
20+
uv run ruff check .
21+
- name: Run ruff format
22+
run: |-
23+
cd backend
24+
uv run ruff format .
25+
26+
frontend-check:
27+
name: Frontend Checks
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
- name: Setup pnpm
32+
uses: pnpm/action-setup@v4
33+
with:
34+
version: 9
35+
- name: Setup Node.js
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: 24
39+
cache: "pnpm"
40+
cache-dependency-path: frontend/pnpm-lock.yaml
41+
- name: Install dependencies
42+
run: |-
43+
cd frontend
44+
pnpm install --frozen-lockfile
45+
- name: Run ESLint
46+
run: |-
47+
cd frontend
48+
pnpm lint
49+
- name: Run type check
50+
run: |-
51+
cd frontend
52+
pnpm typecheck

.gitignore

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Environment
2+
.env
3+
.env.local
4+
.env*.local
5+
6+
# Python
7+
__pycache__/
8+
*.py[cod]
9+
*.pyo
10+
*.pyd
11+
.Python
12+
*.egg-info/
13+
*.egg
14+
.eggs/
15+
dist/
16+
venv/
17+
.venv/
18+
.pytest_cache/
19+
.mypy_cache/
20+
.ruff_cache/
21+
22+
# Django
23+
*.sqlite3
24+
staticfiles/
25+
media/
26+
27+
# Node/pnpm
28+
node_modules/
29+
.pnpm-store/
30+
.pnp
31+
.pnp.*
32+
33+
# Next.js
34+
.next/
35+
out/
36+
37+
# Build/Production
38+
build/
39+
coverage/
40+
41+
# Misc
42+
.DS_Store
43+
*.pem
44+
45+
# Debug logs
46+
npm-debug.log*
47+
yarn-debug.log*
48+
yarn-error.log*
49+
50+
# TypeScript
51+
*.tsbuildinfo
52+
next-env.d.ts

.pre-commit-config.yaml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Pre-commit hooks configuration for Penn Marketplace
2+
# See https://pre-commit.com for more information
3+
#
4+
# Setup: pip install pre-commit && pre-commit install
5+
# Or: cd backend && uv run pre-commit install
6+
#
7+
# Run manually: pre-commit run --all-files
8+
# Run same checks as CI: ./scripts/check.sh
9+
10+
repos:
11+
# =============================================================================
12+
# General file checks (fast, always run)
13+
# =============================================================================
14+
- repo: https://github.com/pre-commit/pre-commit-hooks
15+
rev: v4.6.0
16+
hooks:
17+
- id: trailing-whitespace
18+
exclude: ^(.*\.lock|.*\.min\.js|.*\.min\.css)
19+
- id: end-of-file-fixer
20+
exclude: ^(.*\.lock|.*\.min\.js|.*\.min\.css)
21+
- id: check-yaml
22+
- id: check-json
23+
- id: check-toml
24+
- id: check-added-large-files
25+
args: ['--maxkb=1000']
26+
27+
# =============================================================================
28+
# Backend: Python formatting and linting
29+
# =============================================================================
30+
# Note: CI uses ruff format (not Black), so we match that in pre-commit
31+
- repo: https://github.com/astral-sh/ruff-pre-commit
32+
rev: v0.8.4
33+
hooks:
34+
- id: ruff
35+
name: ruff check (Python linter)
36+
files: ^backend/.*\.py$
37+
args: ['--fix'] # Auto-fix what can be fixed
38+
- id: ruff-format
39+
name: ruff format (Python formatter)
40+
files: ^backend/.*\.py$
41+
# Auto-formats (standard pre-commit behavior)
42+
43+
# =============================================================================
44+
# Frontend: Formatting and linting via local commands
45+
# (Uses your installed pnpm/node for better compatibility)
46+
# =============================================================================
47+
- repo: local
48+
hooks:
49+
- id: frontend-prettier
50+
name: prettier (frontend)
51+
entry: bash -c 'cd frontend && pnpm format'
52+
language: system
53+
files: ^frontend/.*\.(ts|tsx|js|jsx|json|css|md)$
54+
pass_filenames: false
55+
# Auto-formats (standard pre-commit behavior)
56+
57+
- id: frontend-eslint
58+
name: eslint (frontend)
59+
entry: bash -c 'cd frontend && pnpm lint:fix'
60+
language: system
61+
files: ^frontend/.*\.(ts|tsx|js|jsx)$
62+
pass_filenames: false
63+
# Auto-fixes what can be fixed
64+
65+
- id: frontend-typecheck
66+
name: TypeScript type check (frontend)
67+
entry: bash -c 'cd frontend && pnpm typecheck'
68+
language: system
69+
files: ^frontend/.*\.(ts|tsx)$
70+
pass_filenames: false
71+
# Type checking (whole project, but runs on commit)
72+
73+
# =============================================================================
74+
# Notes:
75+
# - Pre-commit hooks AUTO-FIX issues (convenient for developers)
76+
# - check.sh only CHECKS (use --fix flag to auto-fix)
77+
# - TypeScript type checking runs in both pre-commit and check.sh
78+
# - CI doesn't run TypeScript explicitly (Next.js build catches type errors)
79+
# - CI uses ruff format (not Black), so pre-commit matches that
80+
# - Frontend: CI and pre-commit both use pnpm
81+
# =============================================================================

Makefile

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
.PHONY: setup dev up down build clean logs shell-backend shell-frontend migrate test
2+
3+
# Install local dependencies for editor tooling
4+
setup:
5+
@echo "📦 Installing backend dependencies..."
6+
cd backend && uv sync
7+
@echo "📦 Installing frontend dependencies..."
8+
cd frontend && pnpm install
9+
@echo "✅ Setup complete! Run 'make dev' to start."
10+
11+
# Full dev setup: install deps + start containers
12+
dev: setup up
13+
14+
# Start all containers
15+
up:
16+
docker compose up
17+
18+
# Start in background
19+
up-d:
20+
docker compose up -d
21+
22+
# Stop all containers
23+
down:
24+
docker compose down
25+
26+
# Rebuild containers
27+
build:
28+
docker compose build
29+
30+
# Remove containers, volumes, and local deps
31+
clean:
32+
docker compose down -v
33+
rm -rf backend/.venv
34+
rm -rf frontend/node_modules
35+
36+
# View logs
37+
logs:
38+
docker compose logs -f
39+
40+
# Shell into backend container
41+
shell-backend:
42+
docker compose exec backend bash
43+
44+
# Shell into frontend container
45+
shell-frontend:
46+
docker compose exec frontend sh
47+
48+
# Run migrations
49+
migrate:
50+
docker compose exec backend uv run python manage.py migrate
51+
52+
# Run backend tests
53+
test:
54+
docker compose exec backend uv run pytest
55+
56+
# Generate fake data
57+
generate-data:
58+
docker compose exec backend uv run python manage.py generate_listings
59+

0 commit comments

Comments
 (0)