This is a Next.js project bootstrapped with create-next-app
and integrated with a Django backend.
next/font
nextjs_django_boilerplate/
├── backend/ # Django backend
│ ├── api/ # Django app for API
│ ├── backend/ # Django project settings
│ └── db.sqlite3 # SQLite database (for development)
├── src/ # Next.js frontend
│ ├── app/ # App directory (Next.js pages)
│ ├── lib/ # Shared utilities (store, API, types)
│ └── styles/ # Global styles
├── public/ # Static assets
├── .gitignore # Git ignore rules
├── package.json # Frontend dependencies
├── tsconfig.json # TypeScript configuration
└── README.md # Project documentation
npm
, yarn
, or pnpm
for frontend dependencies.cd backend
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver
Navigate to the root folder of this project.
Install dependencies:
npm install
# or
yarn install
# or
pnpm install
Start the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
Open http://localhost:3000 with your browser to view the app.
Set the environment variable for API URL:
NEXT_PUBLIC_API_URL=http://localhost:8000/api
You can start editing the page by modifying src/app/page.tsx
. The page auto-updates as you edit the file.
This project uses next/font
to automatically optimize and load Geist, a new font family for Vercel.
To learn more about the technologies used in this project, check out the following resources:
[https://nextjs.org/docs](Next.js Documentation) - Learn about Next.js features and API. [https://docs.djangoproject.com/en/stable/](Django Documentation) - Learn about Django features and API. [https://tailwindcss.com/docs](Tailwind CSS Documentation) - Learn about Tailwind CSS utilities. [https://redux-toolkit.js.org/rtk-query/overview](Redux Toolkit Query) - Learn about RTK Query for API integration.
The easiest way to deploy your Next.js app is to use Vercel. Follow the Next.js deployment documentation for more details.
Alternatively, you can use Cloudflare Pages to host your Next.js app. Cloudflare Pages provides a fast, globally distributed platform for deploying static and server-rendered applications. It is particularly advantageous if you are already using Cloudflare for DNS or other services, as it integrates seamlessly with their ecosystem. Additionally, Cloudflare's global CDN ensures low latency and high performance for users worldwide. Refer to the Cloudflare Pages documentation for setup instructions.
You can deploy the Django backend using platforms like:
Ensure you:
SECRET_KEY
, DATABASE_URL
, etc.).This project is licensed under the MIT License. See the LICENSE file for more information.