A modern full-stack authentication system built with Django REST Framework, Djoser, JWT, and React + TypeScript.
This project demonstrates a production-style authentication workflow with secure JWT authentication, email activation, password reset, automatic token refresh, protected routes, modern UI, and clean architecture.
A detailed architecture document is available here:
- User Registration
- Email Account Activation
- Login using JWT
- Logout
- Automatic JWT Refresh
- Protected Routes
- Guest Routes
- Persistent Authentication
- Session Restoration
- Authorization Guards
- View Current Profile
- Edit Profile
- Change Password
- Forgot Password
- Password Reset via Email
- Resend Activation Email
- Django REST Framework
- Djoser Authentication
- JWT Authentication
- Email Activation
- Password Reset Flow
- Token Blacklisting Support
- CORS Configuration
- SMTP Email Configuration
- Environment Variables
- React 19
- TypeScript
- Vite
- TailwindCSS v4
- shadcn/ui
- Responsive Layout
- Dark Mode
- Light Mode
- Beautiful Authentication Pages
- Modern Dashboard
- Error Handling
- Loading States
- Axios Instance
- Request Interceptors
- Response Interceptors
- Automatic Access Token Refresh
- Retry Failed Requests
- Secure Token Storage
- Centralized API Layer
React Frontend
β
β
Axios Instance
β
βββββββββββββββ΄ββββββββββββββ
β β
Access Token Refresh Token
β β
βΌ βΌ
Django REST Framework + Djoser + JWT
β
βΌ
SQLite Database
User Registration
β
βΌ
Activation Email Sent
β
βΌ
User Clicks Activation Link
β
βΌ
Account Activated
β
βΌ
Login
β
βΌ
Access Token + Refresh Token
β
βΌ
Protected Pages
β
βΌ
Access Token Expired
β
βΌ
Automatic Refresh
β
βΌ
Retry Original Request
Djoser_SimpleApp/
β
βββ djoser_api/
β βββ manage.py
β βββ api.http
β βββ schema.yml
β βββ djoser_api/
β
βββ frontend/
β βββ src/
β β
β βββ api/
β βββ components/
β βββ context/
β βββ hooks/
β βββ pages/
β βββ routes/
β βββ services/
β βββ types/
β βββ utils/
β
βββ README.md
| Method | Endpoint |
|---|---|
| POST | /auth/users/ |
| POST | /auth/users/activation/ |
| POST | /auth/users/resend_activation/ |
| POST | /auth/jwt/create/ |
| POST | /auth/jwt/refresh/ |
| POST | /auth/jwt/verify/ |
| POST | /auth/jwt/logout/ |
| Method | Endpoint |
|---|---|
| GET | /auth/users/me/ |
| PATCH | /auth/users/me/ |
| Method | Endpoint |
|---|---|
| POST | /auth/users/set_password/ |
| POST | /auth/users/reset_password/ |
| POST | /auth/users/reset_password_confirm/ |
- Python 3.12
- Django
- Django REST Framework
- Djoser
- SimpleJWT
- React 19
- TypeScript
- Vite
- TailwindCSS v4
- shadcn/ui
- Axios
- React Router
git clone https://github.com/yourusername/Djoser_SimpleApp.git
cd Djoser_SimpleAppcd djoser_api
python -m venv .venvActivate environment
Linux
source .venv/bin/activateWindows
.venv\Scripts\activateInstall dependencies
pip install -r requirements.txtRun migrations
python manage.py migrateStart server
python manage.py runservercd frontend
npm install
npm run devSECRET_KEY=your_secret_key
EMAIL_USER=your_email@gmail.com
EMAIL_PASS=your_app_password
FRONTEND_URL=http://localhost:5173VITE_API_URL=http://127.0.0.1:8000- JWT Authentication
- Access Token Rotation
- Refresh Token
- Token Blacklisting Ready
- Protected API Endpoints
- Route Guards
- Email Verification
- Password Validation
- CORS Protection
This project demonstrates:
- Building a complete authentication system
- Connecting React with Django REST Framework
- Using Djoser without writing authentication logic manually
- JWT Authentication
- Automatic Token Refresh
- Axios Interceptors
- Protected Routes
- Guest Routes
- Context API
- Custom Hooks
- Service Layer Architecture
- Modern Folder Structure
- Environment Variables
- Production Ready Project Organization
- Custom User Model
- Social Authentication (Google/GitHub)
- Two-Factor Authentication (2FA)
- User Avatar Upload
- Celery Email Queue
- Redis Integration
- Docker Support
- CI/CD Pipeline
- PostgreSQL Deployment
- Nginx + Gunicorn
- GitHub Actions
This project is intended for educational purposes and learning Django REST Framework, Djoser, JWT authentication, and React integration.
Mohammed Al-Basha
Backend & Frontend Developer
- Django
- Django REST Framework
- React
- TypeScript
- REST APIs
β If you found this project helpful, don't forget to give it a star!





