A modern, production-ready boilerplate for building full-stack web applications with Django and React.
- Django REST Framework with JWT authentication
- Custom user model with email and name fields
- Token-based authentication with refresh tokens
- Swagger/OpenAPI documentation
- CORS configuration for frontend communication
- Environment-based configuration
- Poetry for dependency management
- Vite for fast development and building
- TypeScript for type safety
- React Router for navigation
- Chakra UI for beautiful, accessible components
- React Query for efficient data fetching
- Form handling with React Hook Form and Yup validation
- Protected routes with authentication
- Modern dashboard layout
- Responsive design
- Python 3.13+
- Node.js 18+
- Poetry (Python package manager)
- npm or yarn
- Clone the repository:
git clone [email protected]:sayonetech/boilerplate-with-cursor.git
cd boilerplate-with-cursor- Set up the backend:
# Install Poetry if you haven't already
curl -sSL https://install.python-poetry.org | python3 -
# Install dependencies
poetry install
# Copy environment file
cp .env.example .env
# Activate virtual environment
poetry shell
# Run migrations
python manage.py migrate- Set up the frontend:
cd frontend
# Install dependencies
npm install
# Copy environment file
cp .env.example .env- Start the development servers:
# From the root directory
make devThis will start:
- Backend server at http://127.0.0.1:8000
- Frontend server at http://localhost:5173
- Swagger documentation at http://127.0.0.1:8000/swagger/
.
├── api/ # Django API app
│ ├── serializers.py # API serializers
│ ├── views.py # API views
│ └── urls.py # API URL routing
├── core/ # Django project settings
│ ├── settings.py # Project settings
│ └── urls.py # Main URL routing
├── frontend/ # React frontend
│ ├── src/
│ │ ├── components/ # Reusable components
│ │ ├── context/ # React context providers
│ │ ├── pages/ # Page components
│ │ └── services/ # API services
│ └── package.json
├── .env.example # Example environment variables
├── manage.py # Django management script
├── Makefile # Development commands
└── pyproject.toml # Python dependencies
POST /api/register/- User registrationPOST /api/token/- Get JWT tokensPOST /api/token/refresh/- Refresh JWT tokenGET /api/users/me/- Get current user profile
# Run migrations
python manage.py migrate
# Create superuser
python manage.py createsuperuser
# Run tests
python manage.py testcd frontend
# Start development server
npm run dev
# Build for production
npm run build
# Run tests
npm testDEBUG=True
SECRET_KEY=your-secret-key
ALLOWED_HOSTS=localhost,127.0.0.1
CORS_ALLOWED_ORIGINS=http://localhost:5173
VITE_API_URL=http://127.0.0.1:8000/api
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.