This template is designed to make it easy for you to get started with building a full stack web application using Django and Next.js.
AGPL-3.0 License
I made this project template to make it easy to quickly bootstrap a full stack application following modern practices 🚀.
cookiecutter gh:sicksid/django-nextjs-boilerplate
/docs
endpoint and exportable /schema
file 📜./client
by running the command npm run generate-client
📦task
command (see available tasks by running task --list
after installing task) 🛠The project is structured with two separate directories for the frontend and backend 📂. The backend, which is built using Django REST framework 🐍, is located in the ./backend
directory 💻, where you can find the api, settings, shared, urls and wsgi files. The frontend, which is built using Next.js 🚀, is located in the ./frontend
directory 💻, where you can find the pages, styles, and server files.
For a more detailed view of the project structure 📜, you can run the command tree -L 3 -I 'node_modules|.venv|client|__pycache__'
🌳.
Additionally, the project includes:
pyproject.toml
in ./backend
for managing python dependencies using pdm 🐍package.json
in ./frontend
for managing frontend dependencies using npm 📦Taskfile.yml
for easy task running using task 🛠docker-compose.yml
that contains the necessary configurations to run the project with Docker 🐳Note: If you don't want to use Docker, you can install the dependencies manually and run the project locally. See the Dockerfile
and docker-compose.yml
for more details.
Optionally install asdf to run asdf install
and get python and node.js automatically installed 🛠️
git clone https://github.com/sicksid/django-nextjs-project-template.git
mv django-nextjs-project-template yourprojectname
and cd yourprojectname
docker-compose up --build
http://localhost:3000
for the frontend and http://localhost:8080
for the backend 🎉git clone https://github.com/sicksid/django-nextjs-project-template.git
mv django-nextjs-project-template yourprojectname
and cd yourprojectname
docker-compose up -d database
cd backend && pdm install
cd frontend && npm install
cd frontend && npm run dev
cd backend && python manage.py runserver
http://localhost:3000
for the frontend and http://localhost:8000
for the backend 🎉