Here’s the content formatted specifically for a README.md
file:
Next-DRF: The Ultimate Full-Stack Framework
🚀 Next-DRF is a developer-friendly, highly scalable full-stack framework combining the power of Next.js for the frontend and Django Rest Framework (DRF) for the backend. Designed for simplicity and flexibility, it enables developers to build robust applications effortlessly while supporting modern best practices like Tailwind CSS for styling and seamless authentication integrations.
Why Next-DRF?
- Seamless Full-Stack Development: Combines the best of React and Django under one roof.
- Flexibility: Offers multiple authentication providers like AWS Cognito, Firebase, Auth0, Okta, and custom implementations.
- Preconfigured Setup: Get started with built-in routing, Tailwind CSS, and API integrations out of the box.
- Developer-Centric: Supports environment-based configurations, secure API key management, and auto-migration commands.
- Scalable: Ready for microservices, multi-database support, and modern deployment strategies.
Features
- Frontend: Built with Next.js 15 using both App Router and Page Router for flexibility.
- Backend: Powered by Django Rest Framework with pre-configured user authentication and APIs.
- Styling: Pre-integrated with Tailwind CSS for rapid and responsive UI development.
- Authentication: Support for multiple authentication providers:
- AWS Cognito
- Firebase
- Auth0
- Okta
- Custom User Authentication
- CLI Tools: Simplifies project setup and management with commands like
npx next-drf-cli
. - Scalable Architecture: Ideal for modern full-stack and microservice-based applications.
Getting Started
Installation
git clone https://github.com/Cointavia/next-drf.git
cd next-drf
npm install
Starting the Project
Run the frontend and backend servers with a single command:
npm run dev
This will:
- Start the Next.js frontend server at http://localhost:3000.
- Start the Django backend server at http://localhost:8000.
Backend Setup
Virtual Environment
Set up a Python virtual environment:
python -m venv env
source env/bin/activate
env\Scripts\activate
Install Backend Dependencies
pip install -r requirements.txt
Database Migrations
Run migrations to set up the database:
npm run migrate
Frontend Development
The frontend is built with Next.js:
npm run dev:frontend
Backend Development
Run the Django server:
npm run dev:backend
Authentication Providers
Next-DRF supports multiple authentication providers. Select your preferred provider by setting the AUTH_PROVIDER
environment variable in .env
:
AUTH_PROVIDER=cognito # Options: cognito, firebase, auth0, okta, custom
Example .env
File
API_KEY=your_api_key_here
AUTH_PROVIDER=cognito
AWS_REGION=your_aws_region
AWS_COGNITO_APP_CLIENT_ID=your_cognito_app_client_id
CLI Commands
Next-DRF comes with a powerful CLI tool:
npx next-drf-cli
Available Commands:
-
Initialize a New Project
npx next-drf-cli init
Sets up the project structure and installs dependencies.
-
Add a New Django App
npx next-drf-cli add-app <app-name>
-
Run Migrations
npx next-drf-cli migrate
-
Start the Servers
npx next-drf-cli dev
Directory Structure
next-drf/
├── next-frontend/ # Next.js application
│ ├── public/ # Static assets
│ ├── src/ # Source files
│ └── tailwind.config.js # Tailwind CSS configuration
├── dra-backend/ # Django application with DRF
│ ├── env/ # Virtual environment
│ ├── draBackend/ # Django project settings
│ └── manage.py # Django management script
├── scripts/ # CLI and helper scripts
├── package.json # Node.js dependencies
└── README.md # Project documentation
Roadmap
- Add GraphQL Support for more flexible API queries.
- Introduce Microservices for larger-scale applications.
- Extend Authentication to include SSO and OAuth providers.
- Automate Deployment with Docker and Kubernetes configurations.
Contributing
We welcome contributions from the community! 🚀
Feel free to open issues or submit pull requests on GitHub.
License
Next-DRF is developed by Cointavia and is licensed under the MIT License.
Built with ❤️ by Cointavia
Empowering developers to build faster, smarter, and more scalable applications.
Let me know if there’s anything you’d like to adjust! 🚀