Jumpstart your full-stack development with Django and Next.js!
Introduction · Installation · Tech Stack + Features · Author
This template combines Django 5 wfor the backend and Next.js 14 for the frontend. It includes JWT authentication on the backend and Shadcn UI components for the frontend. This setup helps you start building full-stack web applications more quickly.
- Python 3.12 with uv installed
- Node.js (>=20) and bun
- just command runner
- Docker and Docker Compose (for local Postgres or running commands in containers)
- pre-commit for code quality checks
Clone & create this repo locally with the following command:
git clone https://github.com/JonasTischer/django-ninja-next-template.git
cd django-ninja-next-template- Copy environment templates and adjust secrets as needed:
cp backend/.env.example backend/.env cp frontend/.env.local.example frontend/.env.local
- Install backend and frontend dependencies:
just setup
To activate pre-commit hooks, run the following commands for each configuration file:
For the local configuration file:
pre-commit install -c .pre-commit-config.yaml
Running Pre-Commit Checks¶ To manually run the pre-commit checks on all files, use:
pre-commit run --all-files -c .pre-commit-config.yaml
or
`pre-commit run --all-files -c .pre-commit-config.docker.yaml``
Updating Pre-Commit Hooks
To update the hooks to their latest versions, run:
pre-commit autoupdate
- Launch the stack:
just start-backend– FastAPI with hot reload (uv + uvicorn)just start-frontend– Next.js dev server (pnpmscript)just dev– Convenience command that kicks off both (stop withCtrl+C)
- Regenerate the typed API client whenever backend schemas or routes change:
just generate-client
- Keep the database schema up to date:
just migrate # Apply Alembic migrations locally just create-migration MESSAGE="add scenarios table" # Generate a new migration
Quality checks
just typecheck– Next.js TypeScript project type checkingjust lint– Ruff (Python) + ESLint (frontend) with autofixjust format– Format validation (no writes)
Testing
just test– Backend pytest followed by frontend unit tests
Run just --list or just help for a full catalog of tasks and descriptions.
- Django – High-level Python web framework
- Django Ninja – Fast, async-ready REST framework with automatic OpenAPI schema generation
- Next.js 15 – React framework for building performant apps with the best developer experience
- TypeScript – Typed superset of JavaScript
- Tailwind CSS v4 – Utility-first CSS framework for rapid UI development
- Shadcn UI – Re-usable components built using Radix UI and Tailwind CSS
- Tanstack Query – Powerful asynchronous state management for TS/JS
- React Hook Form – Performant, flexible and extensible forms with easy-to-use validation
- Zod – TypeScript-first schema validation with static type inference
- Docker – Containerization platform for easy deployment and scaling
- PostgreSQL – Powerful, open-source object-relational database system
- Complete deployment configuration
- Set up production environment
- Configure domain and SSL
- Implement logging and monitoring
- Fully containerize with Docker and PostgreSQL
- Create production-ready Dockerfiles
- Set up Docker Compose for local development
- Configure PostgreSQL for scalability
- Add comprehensive testing suite
- Unit tests for backend APIs
- Integration tests for frontend components
- End-to-end testing with Cypress
- Performance testing
- Implement CI/CD pipeline
- Automated testing on pull requests
- Continuous deployment to staging
- Production deployment automation
- Security scanning and checks
Created by Jonas Tischer in 2025.