Skip to main content

A CLI tool to scaffold Django + React projects with options for social login and styling frameworks.

Project description

๐Ÿฅ˜ Django-React-Jollof

Welcome to Django-React-Jollof! This package scaffolds a full-stack web application with Django for the backend and React for the frontend. It simplifies the setup process by automating configuration, migration, and installation of necessary dependencies.


๐Ÿ“– Table of Contents

  1. Features
  2. Tech Stack
  3. Getting Started
  4. Setting Up the Environment
  5. Authentication Setup
  6. Additional Features
  7. Development Workflow
  8. Final Project Structure
  9. Contribution
  10. License
  11. Connect with Us
  12. Conclusion

๐ŸŒŸ Features

  • ๐Ÿ”ง Full-Stack Scaffolding: Django + React setup in seconds.
  • โšก Modern Frontend: React with Vite for fast development.
  • ๐Ÿ” Authentication: Optional Google login integration.
  • ๐ŸŽจ Customizable: Choose Bootstrap or Material UI for styling.
  • ๐Ÿ“ก API Ready: Django REST Framework for seamless backend/frontend communication.

๐Ÿ› ๏ธ Tech Stack

Component Technology
Backend Django, Django REST Framework
Frontend React, Axios
Database SQLite (default, configurable)
Styling Bootstrap or Material UI
Tools ESLint, Prettier, Vite (for fast React development)

๐Ÿš€ Getting Started

โœ… Prerequisites

Make sure you have the following installed:

Backend:

  • Python 3.10+
  • pip
  • virtualenv

Frontend:

  • Node.js 20+ (recommended version)
  • npm or Yarn

๐Ÿ”— Installation

  1. Create a Virtual Environment:

    Navigate to your project directory and run the following commands to create and activate a virtual environment:

    python -m venv env
    

    Activate the virtual environment:

    • On Linux/macOS:
      source env/bin/activate
      
    • On Windows:
      .\env\Scripts\activate
      
  2. Install the Package:

    With the virtual environment activated, install the package via pip:

    pip install django-react-jollof
    
  3. Run the Setup Command:

    django-react-jollof cook
    

    During the setup, you will be prompted to provide a project name. Choose your desired name, and it will be automatically configured throughout the app, including:

    • App name in the NavBar.
    • The browser tab title for the frontend.

    The command will also:

    • Set up the Django backend and install necessary requirements.
    • Set up the React frontend and install dependencies.
    • Run database migrations.
    • Configure social login (if selected).

Setting Up the Environment

In the frontend/ directory, create a .env file:

VITE_GOOGLE_CLIENT_ID=<your_google_client_id>

To start the backend server, navigate to the backend directory, activate your virtual environment, and run:

cd backend
source env/bin/activate  # For Linux/macOS
# venv\Scripts\activate  # For Windows
python manage.py runserver

The backend will be available at http://localhost:8000.

Next, start the frontend development server. Navigate to the frontend directory and run:

cd frontend
npm run dev

The React app will be available at http://localhost:5173.


๐Ÿ”‘ Authentication Setup

To enable Google login, configure the following in your .env files:

Backend:

GOOGLE_CLIENT_ID=<your_google_client_id>
GOOGLE_CLIENT_SECRET=<your_google_client_secret>

Frontend:

VITE_GOOGLE_CLIENT_ID=<your_google_client_id>

Obtain the credentials from the Google Developer Console.


๐ŸŽ Additional Features

  • Styling Frameworks: Choose between Bootstrap and Material UI for the frontend.
  • API Integration: Powered by Django REST Framework.
  • CORS: Pre-configured for frontend-backend communication.

๐Ÿ”„ Development Workflow

Edit backend code in the backend/ directory and use Django's tools for migrations, testing, and database management. Modify React components in frontend/src/ and use Vite for hot-reload development.


Final Project Structure

backend
โ”‚   โ”œโ”€โ”€ backend
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ”œโ”€โ”€ asgi.py
โ”‚   โ”‚   โ”œโ”€โ”€ settings.py
โ”‚   โ”‚   โ”œโ”€โ”€ urls.py
โ”‚   โ”‚   โ””โ”€โ”€ wsgi.py
โ”‚   โ”œโ”€โ”€ db.sqlite3
โ”‚   โ”œโ”€โ”€ manage.py
โ”‚   โ”œโ”€โ”€ requirements.txt
โ”‚   โ””โ”€โ”€ users
โ”‚       โ”œโ”€โ”€ models.py
โ”‚       โ”œโ”€โ”€ permissions.py
โ”‚       โ”œโ”€โ”€ serializers.py
โ”‚       โ”œโ”€โ”€ tests
โ”‚       โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚       โ”‚   โ”œโ”€โ”€ test_models.py
โ”‚       โ”‚   โ”œโ”€โ”€ test_permissions.py
โ”‚       โ”‚   โ”œโ”€โ”€ test_serializers.py
โ”‚       โ”‚   โ””โ”€โ”€ test_views.py
โ”‚       โ”œโ”€โ”€ urls.py
โ”‚       โ””โ”€โ”€ views.py
frontend
โ”‚   โ”œโ”€โ”€ env.d.ts
โ”‚   โ”œโ”€โ”€ index.html
โ”‚   โ”œโ”€โ”€ jsconfig.json
โ”‚   โ”œโ”€โ”€ package-lock.json
โ”‚   โ”œโ”€โ”€ package.json
โ”‚   โ”œโ”€โ”€ public
โ”‚   โ”‚   โ””โ”€โ”€ vite.svg
โ”‚   โ”œโ”€โ”€ src
โ”‚   โ”‚   โ”œโ”€โ”€ App.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ actions
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ authActions.js
โ”‚   โ”‚   โ”œโ”€โ”€ assets
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ react.svg
โ”‚   โ”‚   โ”œโ”€โ”€ components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Navbar.jsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ auth_buttons
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ AuthButtons.jsx
โ”‚   โ”‚   โ”‚       โ””โ”€โ”€ GoogleLoginButton.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ context
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ AuthContext.jsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ThemeContext.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ main.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ pages
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Login.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Profile.jsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ Register.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ services
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ api.js
โ”‚   โ”‚   โ””โ”€โ”€ styles
โ”‚   โ”‚       โ””โ”€โ”€ main.css
โ”‚   โ””โ”€โ”€ vite.config.js
LICENSE
README.md

๐Ÿค Contribution

  1. Fork the repository.

  2. Clone your fork:

    git clone https://github.com/your-username/django-react-jollof.git
    
  3. Create a branch:

    git checkout -b feature/your-feature
    
  4. Make your changes and commit:

    git commit -m "Add your feature"
    
  5. Push to your fork and submit a pull request.


๐Ÿ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ“ฃ Connect with Us

Feel free to open an issue on GitHub for bugs, feature requests, or questions.

If you find Django-React-Jollof helpful, please give the repository a โญ on GitHub. Your support helps us grow and improve!

๐ŸŒ Useful Links


Conclusion

With Django-React-Jollof, building a full-stack app has never been easier! ๐Ÿฒ Let us know what you create!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_react_jollof-1.0.1.tar.gz (36.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_react_jollof-1.0.1-py3-none-any.whl (46.7 kB view details)

Uploaded Python 3

File details

Details for the file django_react_jollof-1.0.1.tar.gz.

File metadata

  • Download URL: django_react_jollof-1.0.1.tar.gz
  • Upload date:
  • Size: 36.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.2

File hashes

Hashes for django_react_jollof-1.0.1.tar.gz
Algorithm Hash digest
SHA256 9ca57b1f0fcae44c1eb25cdc4c5271cc2aa34c3404ae827d0ea48434dfd0986d
MD5 c842597cabda1c169192a7c2ae7017cb
BLAKE2b-256 4275c34b9e81199807a6dba6acbeaef99312b4b4bc0276f02d269a8f33cf3c97

See more details on using hashes here.

File details

Details for the file django_react_jollof-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_react_jollof-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 af98a0ba6c255db28d19725fd7de98c89f2b5e1481b310e1eb8cad632aa295aa
MD5 7c19d152969bb154d924a3ae18ecd318
BLAKE2b-256 fb1a8cf2fe8b9929e9001e4a38363c97baf1e0ba63d9eced55d0c45adfed3422

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page