A production-ready full-stack boilerplate featuring Django REST Framework with JWT authentication and a modern React frontend. This project is designed to be cloned and customized as a starting point for new applications.
- Authentication: Email-based login with Djoser + JWT tokens (djangorestframework-simplejwt)
- Database: PostgreSQL 15 with Docker containerization
- API Format: Camel case JSON responses via djangorestframework-camel-case
- Environment Management: Split settings for local/production environments
- Development Tools: Poetry for dependency management, Black + isort for formatting, Flake8 for linting
- Email: Console backend for development (configurable for production)
- Framework: React 19 with TypeScript
- Routing: React Router v7
- State Management: TanStack Query (React Query) for server state
- Forms: React Hook Form with Zod validation
- UI Components: Shadcn UI with Tailwind CSS
- API Client: Axios for HTTP requests
- Development: Vite for fast builds and HMR
- Docker and Docker Compose
- Make (for convenience commands)
- Git
-
Clone this repository:
git clone <repository-url> cd app-monorepo
-
Initial setup:
make setup
This will:
- Copy
.env.exampleto.env - Build Docker containers
- Install frontend dependencies
- Copy
-
Configure environment variables: Edit
api/.envand set yourSECRET_KEYand any other required variables. -
Start the development environment:
make up
- Backend API: http://localhost:8000
- Frontend: http://localhost:5173
- API Documentation: http://localhost:8000/api/docs/
-
Run initial migrations:
make api-migrate
All development tasks use Make commands. Run make help to see all available commands.
General:
make up- Start all servicesmake down- Stop all servicesmake build- Rebuild Docker containersmake clean- Remove containers, volumes, and images
Backend (API):
make api-shell- Open Django shellmake api-migrate- Run database migrationsmake api-migrate-full- Create and run migrationsmake api-seed-dump- Dump current database to seed data fixturemake api-seed-load- Flush database and load seed datamake api-test- Run Django testsmake api-format- Format code with Black and isortmake api-lint- Run Flake8 linting
Frontend:
make frontend-dev- Start frontend dev server (standalone)make frontend-build- Build for productionmake frontend-test- Run frontend testsmake frontend-lint- Run ESLintmake frontend-type-check- Run TypeScript type checking
The project includes seed data fixtures for consistent development environments. Seed data is stored in api/fixtures/seed_data.json.
Creating/Updating Seed Data:
make api-seed-dumpThis command exports your current database state to api/fixtures/seed_data.json. Use this when you want to save your current data as the baseline for the project.
Loading Seed Data:
make api-seed-loadFlushes all data from your current database and loads the seed data from api/fixtures/seed_data.json. This gives you a clean database with baseline data, useful for resetting to a known state.
For New Developers:
When joining the project, after running make setup and make up, run:
make api-migrate
make api-seed-loadThis ensures your local database has the same baseline data as other developers.
app-monorepo/
├── api/ # Django backend
│ ├── settings/ # Environment-specific settings
│ │ ├── base.py # Shared settings
│ │ ├── local.py # Development settings
│ │ └── production.py # Production settings
│ ├── fixtures/ # Database seed data
│ │ └── seed_data.json # Baseline data for development
│ ├── users/ # Custom User app
│ └── manage.py
├── frontend/ # React frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ │ └── ui/ # Shadcn UI components
│ │ ├── services/ # API client services
│ │ ├── hooks/ # Custom React hooks
│ │ └── utils/ # Utility functions
│ └── package.json
├── docker-compose.yml
├── Makefile
└── CLAUDE.md # AI assistant guidance
- Custom User Model: Uses email as USERNAME_FIELD instead of username
- Settings Structure: Split by environment (base, local, production) for better organization
- Djoser Configuration: Activation emails enabled by default for user registration
- API Versioning: Ready for versioned endpoints (configure as needed)
- Component Organization: Scalable structure with separation of UI, forms, and feature components
- Form Management: All forms use react-hook-form as separate components
- API Layer: Centralized in
/serviceswith BaseService for standard CRUD operations - Data Fetching: TanStack Query for caching, synchronization, and loading states
- Styling: Tailwind CSS with Shadcn UI components for consistent design
- Registration: POST to
/api/auth/users/with email and password - Activation: Email link or manual activation (configurable)
- Login: POST to
/api/auth/jwt/create/returns access and refresh tokens - Protected Routes: Include
Authorization: Bearer <access_token>header - Token Refresh: POST to
/api/auth/jwt/refresh/with refresh token
When forking this boilerplate for a new project:
- Rename the project: Update names in
docker-compose.yml,package.json, etc. - Update environment variables: Configure
api/.envfor your needs - Modify authentication: Adjust Djoser settings in
api/settings/base.py - Create Django apps: Add your feature apps to the
api/directory - Build frontend features: Add components, hooks, and services following the established patterns
- Configure deployment: Update
api/settings/production.pyfor your hosting environment
Copy api/.env.example to api/.env and configure:
SECRET_KEY=your-secret-key-here
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
DATABASE_URL=postgresql://postgres:postgres@db:5432/postgresBackend:
make api-testFrontend:
make frontend-testBackend:
- Black for code formatting (line length 88)
- isort for import sorting
- Flake8 for linting
Run make api-format before committing.
Frontend:
- ESLint for linting
- TypeScript for type safety
- Prettier-compatible formatting
Run make frontend-lint before committing.
- Update
api/settings/production.pywith production settings - Set
DEBUG=Falsein production environment - Configure proper
ALLOWED_HOSTS - Use a production-grade WSGI server (Gunicorn recommended)
- Set up proper database backups
- Configure email backend for production
- Serve frontend static files via CDN or reverse proxy
[Add your license here]
This is a boilerplate project. Fork it and make it your own!