A full-stack authentication system built with Django (backend) & React (frontend). Features modern auth flows: π JWT, π refresh tokens, and π‘οΈ role-based access control.


An open-source project template designed to help developers quickly build full-stack applications with a modern React frontend and a Django REST Framework backend. It provides a ready-to-use authentication system with login and registration functionality, token-based authentication using SimpleJWT, responsive design styled with Tailwind CSS v4, and seamless API integration between frontend and backend. This project serves as a starting point for developers looking to bootstrap Django-React applications efficiently, offering a clean, maintainable structure that can be easily extended or customized.
- User authentication with JWT tokens
- Secure password management
- Responsive design with Tailwind CSS
- Real-time form validation
- Interactive UI with animations
- Protected routes and API endpoints
- Node.js (latest version)
- Python 3.12+
- npm or yarn
- Clone the repository
git clone https://github.com/Bitxo92/react-django-auth-system.git
- Setup Backend
cd Backend
python -m venv .venv
source .venv/bin/activate # On Windows use: .venv\Scripts\activate
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver
- Setup Frontend
cd Frontend
npm install
npm run dev
The application will be available at:
- Frontend: http://localhost:5173
- Backend: http://localhost:8000
Frontend tests:
cd Frontend
npm test # Run tests in watch mode
npm run test:run # Run tests once
npm run test:coverage # Run tests with coverage
Backend tests:
cd Backend
python manage.py test
Frontend:
npm run dev
- Start development servernpm run build
- Build for productionnpm run preview
- Preview production buildnpm run lint
- Lint codenpm test
- Run testsnpm run test -- -t"<test-name>"
- Run specific testnpm run test:coverage
- Run tests with coverage
Backend:
python manage.py runserver
- Start development serverpython manage.py migrate
- Run migrationspython manage.py createsuperuser
- Create admin user
Project/
βββ Frontend/
β βββ src/
β β βββ components/
β β βββ pages/
β β βββ test/
β β βββ main.jsx
β βββ public/
β βββ package.json
βββ Backend/
βββ api/
β βββ migrations/
β βββ models.py
β βββ serializers.py
β βββ views.py
β βββ urls.py
βββ Backend/
βββ settings.py
POST /api/auth/register/
- Register new userPOST /api/auth/login/
- Login userGET /api/auth/profile/
- Get user profilePOST /api/auth/verify/
- Verify JWT tokenGET /api/auth/health/
- Health check endpointPOST /api/token/refresh/
- Refresh JWT token
This project is licensed under the MIT License.
See the LICENSE file for the full details.
We welcome contributions from the community! Your help improves this template and benefits developers building React-Django applications.
- Bug reports β If you find a bug, please open an issue with a clear description and steps to reproduce.
- Feature requests β Suggest new features or improvements that enhance the template.
- Code contributions β Submit code improvements, fixes, or new features.
- Documentation updates β Improve clarity, add examples, or update guides.
- Tests β Add or enhance tests for backend and frontend functionality.
-
Fork the repository and create a descriptive branch:
git checkout -b feature/your-feature-name
-
Implement your changes following the existing code style.
-
Include/run tests for new features or bug fixes:
# Backend Django tests python manage.py test # Frontend Vitest npm run test
-
Commit your changes with a clear and concise message following conventional commit guidelines:
Type | Description | Example |
---|---|---|
feat | A new feature | feat(auth): add social login |
fix | A bug fix | fix(api): correct login endpoint |
docs | Documentation only | docs(readme): update installation steps |
style | Code style changes (formatting, missing semi-colons, etc.) | style(css): fix button padding |
refactor | Code change that neither fixes a bug nor adds a feature | refactor(auth): simplify login logic |
perf | Performance improvements | perf(api): optimize query |
test | Adding or updating tests | test(auth): add tests for login |
chore | Other changes that do not modify src or test files (e.g., build scripts) | chore(deps): update npm packages |
ci | Changes to CI configuration or scripts |
- Push your branch and open a Pull Request.
- Follow the existing Python/Django and JavaScript/React code conventions.
- Ensure code is readable, maintainable, and well-documented.
- Keep commits small, focused, and atomic.
- PRs should clearly describe the changes and motivation.
- Include screenshots for UI changes when possible.
- Link any related issues.