A modern full-stack Django boilerplate that integrates Inertia.js with React as the view layer. Includes a complete todo app example with PostgreSQL database.
- Backend: Django 5.2.6 with Python β₯3.10
- Frontend: React 19.2.0 with TypeScript
- Bridge: Inertia.js for seamless client-server communication
- Database: PostgreSQL
- Build Tool: Vite 7.1.7 with HMR support
- Styling: TailwindCSS 4.1.13 with shadcn/ui components
- Icons: Lucide React
- Package Manager: uv (Python) and npm (Node.js)
β¨ No API layer needed - Inertia handles data flow between Django views and React components β¨ Hot Module Replacement - Instant feedback during development β¨ Modern UI - Pre-configured with shadcn/ui and TailwindCSS β¨ Type-safe - TypeScript for frontend code β¨ CSRF protected - Configured for Inertia β¨ Example Todo App - Complete CRUD operations with React UI
- Python β₯3.10
- Node.js β₯18
- PostgreSQL (for production; SQLite can be used for development)
- uv package manager
uv venv .venvMac / Linux:
source .venv/bin/activateWindows:
.venv\Scripts\activate.batuv synccp .env.example .envUpdate .env with your PostgreSQL credentials:
DB_ENGINE=django.db.backends.postgresql
DB_NAME=todo
DB_USER=postgres
DB_PASSWORD=your_password
DB_HOST=localhost
DB_PORT=5432creatdb todonpm installuv run manage.py migratenpm run build
uv run manage.py collectstatic --noinputIn separate terminals:
Terminal 1 - Vite dev server (HMR):
npm run devTerminal 2 - Django server:
uv run manage.py runserverAccess the app at http://localhost:8000
npm run build
uv run manage.py collectstatic --noinput
uv run manage.py runserver.
βββ app/ # Django main app
β βββ settings.py # Django configuration
β βββ urls.py # URL routing
β βββ views.py # View functions
β βββ wsgi.py / asgi.py # WSGI/ASGI config
βββ todo/ # Todo app (example)
β βββ models.py # Todo model
β βββ views.py # API endpoints
β βββ admin.py # Django admin config
β βββ urls.py # Todo routes
β βββ migrations/ # Database migrations
βββ assets/ # Frontend assets
β βββ js/
β β βββ pages/ # Inertia page components
β β β βββ Home.tsx # Home page
β β β βββ Todos.tsx # Todo list page
β β βββ components/ # Reusable React components
β β β βββ ui/ # shadcn/ui components
β β βββ lib/ # Utility functions
β β βββ main.js # Inertia app initialization
β βββ css/
β β βββ index.css # TailwindCSS styles
β βββ dist/ # Built assets (generated)
βββ templates/
β βββ base.html # Inertia layout template
βββ static/ # Static files (generated)
βββ vite.config.js # Vite configuration
βββ components.json # shadcn/ui config
βββ tsconfig.json # TypeScript config
βββ package.json # Node dependencies
βββ requirements.txt # Python dependencies
βββ manage.py # Django CLI
/- Home page/todos/- Todo list application/admin/- Django admin interface/api/todos/- Get all todos (GET)/api/todos/create/- Create new todo (POST)/api/todos/<id>/- Update todo (PUT)/api/todos/<id>/delete/- Delete todo (DELETE)
- RESTful API endpoints for todo operations
- PostgreSQL database with Todo model
- Django admin interface for managing todos
- Automatic timestamps (created_at, updated_at)
- Add new todos with title and description
- Toggle completion status
- Delete todos
- Real-time UI updates
- Responsive design with TailwindCSS
- Completion statistics
class Todo(models.Model):
title: CharField(max_length=200)
description: TextField(blank=True, null=True)
completed: BooleanField(default=False)
created_at: DateTimeField(auto_now_add=True)
updated_at: DateTimeField(auto_now=True)# Create migrations
uv run manage.py makemigrations
# Apply migrations
uv run manage.py migrate
# Create superuser for admin
uv run manage.py createsuperuser
# Access Django shell
uv run manage.py shell
# Collect static files
uv run manage.py collectstatic
# Build frontend for production
npm run build
# Development with HMR
npm run devSee .env.example for all available options:
APP_DEBUG- Django debug modeDJANGO_VITE_DEV_MODE- Vite dev modeDJANGO_VITE_DEV_SERVER_HOST- Vite server hostDJANGO_VITE_DEV_SERVER_PORT- Vite server portDB_*- PostgreSQL connection settings
- Dev server runs on port 5173 (configurable)
- Base path set to
/static/ - React and TailwindCSS plugins enabled
- Path alias
@points toassets/js/
- Ensure the app is in
INSTALLED_APPSin settings.py - Check that models.py exists and has model definitions
- Verify migrations directory exists with
__init__.py
- Run
npm run buildto build frontend assets - Run
uv run manage.py collectstatic --noinput - Check that
STATIC_ROOTandSTATICFILES_DIRSare configured
- Verify PostgreSQL is running
- Check
.envdatabase credentials - Ensure database exists:
createdb todo
- Django Documentation
- Inertia.js Documentation
- React Documentation
- Vite Documentation
- TailwindCSS Documentation
- shadcn/ui Components
MIT