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
- Features
- Tech Stack
- Getting Started
- Setting Up the Environment
- Authentication Setup
- Additional Features
- Development Workflow
- Final Project Structure
- Contribution
- License
- Connect with Us
- 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
-
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
- On Linux/macOS:
-
Install the Package:
With the virtual environment activated, install the package via pip:
pip install django-react-jollof
-
Run the Setup Command:
django-react-jollof cookDuring 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
-
Fork the repository.
-
Clone your fork:
git clone https://github.com/your-username/django-react-jollof.git
-
Create a branch:
git checkout -b feature/your-feature
-
Make your changes and commit:
git commit -m "Add your feature"
-
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
- Documentation: django-react-jollof Docs
- Changelog: Releases
- Bug Tracker: Issues
Conclusion
With Django-React-Jollof, building a full-stack app has never been easier! ๐ฒ Let us know what you create!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ca57b1f0fcae44c1eb25cdc4c5271cc2aa34c3404ae827d0ea48434dfd0986d
|
|
| MD5 |
c842597cabda1c169192a7c2ae7017cb
|
|
| BLAKE2b-256 |
4275c34b9e81199807a6dba6acbeaef99312b4b4bc0276f02d269a8f33cf3c97
|
File details
Details for the file django_react_jollof-1.0.1-py3-none-any.whl.
File metadata
- Download URL: django_react_jollof-1.0.1-py3-none-any.whl
- Upload date:
- Size: 46.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af98a0ba6c255db28d19725fd7de98c89f2b5e1481b310e1eb8cad632aa295aa
|
|
| MD5 |
7c19d152969bb154d924a3ae18ecd318
|
|
| BLAKE2b-256 |
fb1a8cf2fe8b9929e9001e4a38363c97baf1e0ba63d9eced55d0c45adfed3422
|