Development Setup
Prerequisites
- Python 3.12+
- Node.js 20+
- Docker & Docker Compose
- Git
Backend Development
cd backend
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
pip install pytest pytest-asyncio httpx ruff
# Run linting
ruff check .
ruff format --check .
# Run tests
PYTHONPATH=. pytest tests/ -v
Frontend Development
cd frontend
# Install dependencies
npm install
# Run development server
npm run dev
# Run linting
npm run lint
# Build
npm run build
Database
# Generate migration
alembic revision --autogenerate -m "description"
# Apply migrations
alembic upgrade head
# Rollback
alembic downgrade -1
Code Standards
Backend (Python)
- Async SQLAlchemy everywhere
- Pydantic v2 for schemas
- Type hints on all functions
- No bare
except:
Frontend (TypeScript)
- TypeScript strict mode
- Functional components
- Tailwind CSS for styling
- Zustand for state
Testing
# Backend tests
cd backend
PYTHONPATH=. pytest tests/ -v
# Test coverage
PYTHONPATH=. pytest --cov=app --cov-report=html tests/
Git Workflow
# Create feature branch
git checkout -b feature/my-feature
# Make changes, commit
git add -A
git commit -m "feat: description"
# Push and create PR
git push origin feature/my-feature
Quick Commands
make dev # Start dev environment
make dev-down # Stop dev environment
make test-backend # Run backend tests
make build # Build for production
make up # Start production
make seed # Seed database
make lint # Run linting