Welcome to Django-React-Jollof (DRJ)! This package scaffolds a fully functional full-stack web application with Django for the backend and React for the frontend. It simplifies the entire setup process by automating key tasks like configuration, database migrations, API integration, and dependency installation.
With Django-React-Jollof, you can quickly set up a robust web app and focus on bringing your ideas to life, leaving the repetitive boilerplate setup to the tool. Whether you're building a simple project or a scalable application, DRJ equips you with the essentials to get started effortlessly.
- Features
- Tech Stack
- Getting Started
- Setting Up the Environment
- Authentication Setup
- Additional Features
- Development Workflow
- Final Project Structure
- Contribution
- License
- Connect with Us
- Conclusion
- π§ 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.
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) |
Make sure you have the following installed:
- Python 3.10+
- pip
- virtualenv
- Node.js 20+ (recommended version)
- npm or Yarn
-
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 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).
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
.
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.
- 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.
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.
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
-
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.
This project is licensed under the MIT License - see the LICENSE file for details.
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. Thank you!
- Documentation: django-react-jollof Docs
- Changelog: Releases
- Bug Tracker: Issues
With Django-React-Jollof, building a full-stack app has never been easier! π² Let us know what you create!