NeoTemplate is a full-stack website template built using Next.js with Material UI, NextAuth, and i18next for the frontend, and Django with Django Rest Framework (DRF) for the backend. It provides a foundation for creating websites with essential features already implemented, including:
- Email-based sign-in/sign-up
- Email validation
- Password reset functionality
- Profile management with profile picture upload
- A basic home page
- Theme (light/dark) selection (stored client-side)
- Language selection (stored client-side)
Before you begin, ensure you have the following installed:
- Docker (version 20.10 or higher)
- Docker Compose (version 2.0 or higher)
To verify your installation:
docker --version
docker compose versionRight-click this button to create a repository using this one as a template:
Or clone the repository:
git clone <your-repo-url>
cd NeoTemplateCreate .env files in both backend/ and frontend/ directories with the required environment variables.
Create backend/.env with the following variables:
# Django Settings
SECRET_KEY=your-secret-key-here
DEBUG=1
FRONTEND_HOST=http://localhost:3000
# Database Configuration
SQL_ENGINE=django.db.backends.postgresql
POSTGRES_DB=neotemplate
POSTGRES_USER=postgres
POSTGRES_PASSWORD=your-db-password
POSTGRES_HOST=db
POSTGRES_PORT=5434
# JWT Configuration
JWT_SECRET_KEY=your-jwt-secret-key-here
# Email Configuration (for production, use real SMTP settings)
EMAIL_HOST=smtp.gmail.com
EMAIL_HOST_USER=[email protected]
EMAIL_HOST_PASSWORD=your-email-passwordNote: For local development without an email server, see the Troubleshooting section below.
Create frontend/.env with the following variables:
NEXT_PUBLIC_BACKEND_URL=http://localhost:8000
NEXT_PRIVATE_BACKEND_URL=http://localhost:8000
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-nextauth-secret-hereSecurity Note: Generate secure random strings for SECRET_KEY, JWT_SECRET_KEY, and NEXTAUTH_SECRET. You can use:
# Generate a secure random string
python3 -c "import secrets; print(secrets.token_urlsafe(32))"For local development with hot-reload enabled:
docker compose up --build -dThis will:
- Build the Docker images for all services
- Start the database, backend, and frontend containers
- Enable hot-reload for both frontend and backend (code changes will be reflected automatically)
Access the application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- Django Admin: http://localhost:8000/admin
For production deployment:
docker compose -f docker-compose.prod.yml up --build -dProduction differences:
- Frontend is built and optimized (no hot-reload)
- Backend runs without reload flag
- No volume mounts (code is baked into images)
- Smaller, optimized Docker images
Important: Before deploying to production:
- Set
DEBUG=0inbackend/.env - Update
FRONTEND_HOSTandNEXTAUTH_URLwith your production domain - Configure proper email SMTP settings
- Update
ALLOWED_HOSTSinbackend/core/settings.pywith your domain - Use strong, unique secrets for all keys
If you encounter permission issues with Docker:
sudo chown -R $(id -u):$(id -g) $HOME/.dockerOr add your user to the docker group:
sudo usermod -aG docker $USER
# Then log out and log back inView logs for all services:
docker compose logs -fView logs for a specific service:
docker compose logs -f backend
docker compose logs -f frontend
docker compose logs -f dbdocker compose downStop and remove volumes (
docker compose down -vdocker compose restart backend
docker compose restart frontendAccess the backend container shell:
docker exec -it backend bashAccess the frontend container shell:
docker exec -it frontend shIf you modify Dockerfiles or dependencies:
docker compose up --build -dTo access the Django admin panel, create a superuser:
docker exec -it backend python manage.py createsuperuserFollow the prompts to create your admin account, then navigate to: http://localhost:8000/admin
# Make migrations
docker exec -it backend python manage.py makemigrations
# Apply migrations
docker exec -it backend python manage.py migrate
# Collect static files
docker exec -it backend python manage.py collectstatic# Run all tests
docker exec -it backend python manage.py test
# Run all tests with verbose output
docker exec -it backend python manage.py test --verbosity=2
# Run specific test file
docker exec -it backend python manage.py test api.tests.test_domain
# Run tests and stop at first failure
docker exec -it backend python manage.py test --failfast- Change every occurence of
NeoTemplate,neotemplate,NeoandTemplateby your desired name. - Change the logo at
frontend/public/favicon.ico,frontend/public/logo.pngand atfrontend/components/icons/logo.png.
And that's it, start implementing your ideas!
If you don't have an email server configured for local development:
- Open
backend/core/settings.py - Uncomment these lines (around line 205-206):
if DEBUG:
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'- Set
ACCOUNT_EMAIL_VERIFICATIONto"none"(around line 218):
ACCOUNT_EMAIL_VERIFICATION = "none" # Change from "mandatory"- Restart the backend container:
docker compose restart backendEmails will now be printed to the console instead of being sent.


