MVCLM React-Django
A starter kit for shipping React and Django applications. Authentication, admin tooling, operational controls, and a tested Docker setup for both local development and production.
What Is Included
The foundation most projects rebuild from scratch, already working.
Authentication
Admin
Operations
Developer Experience
How It Is Laid Out
A standard Django and Vite layout. Backend apps map to domain concerns; the frontend source is organised by responsibility.
backend/
config/ # settings, URLs, ASGI/WSGI
users/ # User model, auth, admin endpoints
app_settings/ # maintenance + demo flags
contact/ # contact form endpoint
frontend/src/
api/ # fetch wrapper, 401-refresh guard
auth/ # AuthContext, route wrapper
app-settings/ # context + maintenance banner
flash/ # toast provider + stack
layouts/ # public and admin layouts
components/ # shared UI primitives
pages/ # route pages
Getting Started
Requirements
That is the whole list. Node, Python and PostgreSQL all run inside containers, so nothing has to be installed on the machine to work on this.
One Thing To Know
The development stack installs the frontend packages inside the container, so the host folder stays empty. An IDE will then flag every JSX file, because the TypeScript service cannot resolve the types. Run the install once on the host after cloning and it stops.
Installation
# Clone and start the stack
git clone https://github.com/jaanus-saarnak/mvclm-react-django.git
cd mvclm-react-django
cp .env.example .env
docker compose up
# In a second terminal
docker compose exec backend python manage.py migrate
docker compose exec backend python manage.py createsuperuser
# Optional, so the IDE resolves types
cd frontend && npm install
Then open http://localhost:8080. Everything is served from a single origin behind nginx, which is what lets the authentication cookie work the same way locally and in production.
Decisions Worth Knowing About
Why it is put together the way it is.
Tokens live in cookies, not in storage
Authentication rides in an HTTP-only cookie with CSRF protection, so no token is reachable from JavaScript. Refresh tokens rotate, and the old one is blacklisted at sign-out.
One origin, locally and in production
nginx fronts both the API and the frontend, so there is no CORS configuration to get wrong and the cookie behaves the same in both places.
The admin table is hand-rolled
Sorting, searching and pagination are written out rather than pulled from a table library, so there is no dependency to upgrade and nothing to fight when the columns change.
Operators get switches, not a redeploy
Maintenance mode and demo mode are toggles on an App Settings page rather than environment variables, so turning the site off does not mean shipping a new build.
License
MIT. Use it, change it, ship it, sell what you build with it.