Django + Nextjs Template: Standardised CFC Tech Stack
The easiest way to get started is using the VS Code Dev Container:
-
Prerequisites:
-
Open in Dev Container:
- Clone this repository
- Open the project in VS Code
- When prompted, click "Reopen in Container" or use
Ctrl+Shift+P→ "Dev Containers: Reopen in Container"
-
Start the application:
# Terminal 1: Start the frontend cd client && npm run dev # Terminal 2: Start the backend cd server && python manage.py runserver
-
Access the application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- Admin panel: http://localhost:8000/admin
Note: Only follow these steps if you're NOT using the dev container.
- Node.js 20+ and npm - Download here
- Python 3.12+ - Download here
- Poetry (Python package manager) - Installation guide
git clone <your-repo-url>
cd <project-name>The client and server are configured by .env files, local to your device and not tracked by git.
To set these up you can simply copy the .env.example files in each to a new .env file.
Run the command below to do this automatically (system dependant).
cp ./client/.env.example ./client/.env && cp ./server/.env.example ./server/.envcd server
poetry install
eval $(poetry env activate) #Bash/Zsh/Csh
Invoke-Expression (poetry env activate) #Powershell
python manage.py migrate
python manage.py createsuperuser # optional
python manage.py runservercd client
npm install
npm run dev- Frontend: http://localhost:3000
- Admin panel: http://localhost:8000/admin
cd server
# Run development server
python manage.py runserver
# Create migrations
python manage.py makemigrations
# Apply migrations
python manage.py migrate
# Create superuser
python manage.py createsuperuser
# Run tests
python manage.py test
# Reset database (nuclear option)
./nuke.shcd client
# Development server
npm run dev
# Build for production
npm run build
# Start production server
npm start
# Run linting
npm run lint
# Fix linting issues
npm run lint:fix
# Type checking
npm run typecheck
# Format code
npm run formatIf the models are updated, be sure to create a migration:
python manage.py makemigrations # create migration
python manage.py migrate # apply migrationsIf you run into migration conflicts that you can't be bothered to fix, run nuke.sh to clear your database. Then, run migrations again.
You can run npm install and poetry install in the respective client and server folders to install the newest dependencies.
If you modify anything in the docker folder, you need to add the --build flag or Docker won't give you the latest changes.
Edit the .env file in the respective directory (client or server).