1.0.1 β€’ Published 8 months ago

next-drf v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

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?

  1. Seamless Full-Stack Development: Combines the best of React and Django under one roof.
  2. Flexibility: Offers multiple authentication providers like AWS Cognito, Firebase, Auth0, Okta, and custom implementations.
  3. Preconfigured Setup: Get started with built-in routing, Tailwind CSS, and API integrations out of the box.
  4. Developer-Centric: Supports environment-based configurations, secure API key management, and auto-migration commands.
  5. 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

# Clone the repository
npx next-drf@latest

# Install dependencies
npm install

Starting the Project

Run the frontend and backend servers with a single command:

npm run dev

This will: 1. Start the Next.js frontend server at http://localhost:3000. 2. 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  # For Linux/Mac
env\Scripts\activate     # For Windows

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:

  1. Initialize a New Project

    npx next-drf-cli init

    Sets up the project structure and installs dependencies.

  2. Add a New Django App

    npx next-drf-cli add-app <app-name>
  3. Run Migrations

    npx next-drf-cli migrate
  4. 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

  1. Add GraphQL Support for more flexible API queries.
  2. Introduce Microservices for larger-scale applications.
  3. Extend Authentication to include SSO and OAuth providers.
  4. 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! πŸš€