A production-ready monorepo template for building full-stack applications with Django (backend) and SvelteKit (frontend).
django-sveltekit-starter/
โโโ backend/ # Django REST API
โ โโโ project/ # Django project
โ โโโ docker/ # Docker configuration
โ โโโ ansible/ # Deployment automation
โ โโโ terraform/ # Infrastructure as code
โโโ frontend/ # SvelteKit application
โ โโโ src/ # Source code
โ โโโ static/ # Static assets
โโโ docker-compose.yml # Development environment
โโโ Makefile # Common development commands
โโโ docs/ # Project documentation
โ โโโ engineering-handbook/ # Engineering practices and standards
โโโ .github/ # CI/CD workflows
Clone the repository
git clone https://github.com/auros-one/django-sveltekit-starter.git
cd django-sveltekit-starter
Install dependencies
make install
Start development environment
make run
Access the applications
Set up development data (optional)
make fresh-start
This creates a clean database with default admin credentials:
[email protected]
admin
make help # Show all available commands
make install # Install all dependencies + pre-commit hooks
make setup-pre-commit # Install pre-commit hooks only
make sync-types # Sync API types from backend to frontend
make run # Start Docker Compose stack
make test # Run all tests
make format # Format code
make lint # Lint code
make clean # Clean generated files
cd backend/
poetry run python manage.py runserver # Dev server
poetry run python manage.py migrate # Run migrations
poetry run pytest # Run tests
poetry run python manage.py shell # Django shell
cd frontend/
npm run dev # Dev server (port 5173)
npm run sync-types # Sync API types from backend (CRITICAL)
npm run build # Production build
npm run check # Type checking
npm run lint # Lint code
npm run format # Format code
The project uses PostgreSQL. For development, the database runs in Docker via docker-compose.yml
.
This monorepo emphasizes type safety between frontend and backend:
drf-spectacular
openapi-typescript
make sync-types
Always run after backend API changes:
make sync-types
This monorepo uses intelligent pre-commit hooks that only run when relevant files change:
backend/**/*.py
): black, isort, ruff, pyupgrade, django-upgrade, Django system checksfrontend/**/*.{js,ts,svelte}
): prettier, eslint, svelte-checkPre-commit hooks are automatically installed with make install
, or manually with make setup-pre-commit
.
Path-based GitHub Actions workflows for efficient CI/CD:
backend/**
changes - runs Django tests, migrations, lintingfrontend/**
OR any backend/**
changes - syncs types, runs tests/lintingโ Backend changes โ backend tests + frontend type sync (safe & reliable) โ Frontend changes โ frontend tests only โ Integration tests catch full-stack issues
site_id-email
This starter template implements multi-tenancy using Django's built-in Sites framework:
{site_id}-{email}
(e.g., "[email protected]"
)cd backend/
poetry run pytest # Run all tests
poetry run pytest --cov # With coverage
poetry run pytest tests/test_api.py # Specific test file
cd frontend/
npm run check # Type checking
npm run lint # Linting
npm test # Unit tests (if configured)
Use the root docker-compose.yml
for simple development:
make run # Starts all services
The backend includes comprehensive deployment configurations:
See backend/deploy.md
for detailed deployment instructions.
main
make test
make format
Built with ๐ using Django 4.2+, SvelteKit 2+, and modern development practices.