This project implements a sophisticated user authentication system using Django as the backend and React as the frontend. It includes features like user roles, permissions, JWT-based authentication, email verification, password reset, and user profile management. The frontend state is managed using Redux, providing a scalable and maintainable solution.
- User Authentication: Secure login and registration functionalities.
- User Roles: Define roles for users (admin, user) with corresponding permissions.
- JWT Authentication: JSON Web Tokens for secure authentication.
- Email Verification: Verify user email addresses during registration.
- Password Reset: Allow users to reset their passwords via email.
- User Profile Management: Enable users to update their personal information.
- Django: Python-based web framework for building the backend.
- Django Rest Framework (DRF): Toolkit for building RESTful APIs with Django.
- Django Rest Framework Simple JWT: Provides JWT authentication for DRF.
- django-cors-headers: Handles Cross-Origin Resource Sharing (CORS) in Django.
- React: JavaScript library for building user interfaces.
- Redux: State management library for managing application state.
- React Router: Declarative routing for React applications.
- Axios: Promise-based HTTP client for making AJAX requests.
- Python: Install Python from python.org.
- Node.js: Install Node.js from nodejs.org.
- npm: Node.js package manager, included with Node.js installation.
- Git: Install Git from git-scm.com.
-
Clone the repository:
git clone https://github.com/yourusername/advanced-user-authentication.git cd advanced-user-authentication
-
Set up the Django 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 createsuperuser python manage.py runserver
-
Set up the React frontend:
cd ../frontend npm install npm start
-
Open your browser and navigate to
http://localhost:3000
to access the application.
- Register a new user: Navigate to
/register
and fill out the registration form. - Log in: Navigate to
/login
and enter your credentials. - Access user profile: Once logged in, you can access and update your profile information.
- Manage users (admin only): Admin users can manage other users, including assigning roles and permissions.
Contributions are welcome! If you have any ideas for improvements or feature suggestions, please open an issue or submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.