This project implements a user authentication system using Django and React. It includes user registration, login, logout, and fetching user data. Authentication is handled using JWT (JSON Web Tokens) and HTTP-only cookies for improved security. The application's frontend is styled using Bootstrap.
The project consists of two directories:
client
: Contains the React applicationserver
: Contains the Django backend
To run this project on your local machine, follow the steps below:
Ensure you have the following installed on your local machine:
- Python 3.8 or higher
- Node.js v14.15.0 or higher
- npm 6.14.9 or higher
- Navigate to the
server
directory:cd server
- Install Django and other dependencies:
pip install -r requirements.txt
- Run the server:
python manage.py runserver
- Navigate to the
client
directory:cd ../client
- Install all the dependencies:
npm install
- Run the client:
npm start
Now, your application should be running at localhost:3000
.
Note:
- The Django server should be running at the same time as the React application for the system to function properly.
- The application uses the email field instead of the username field for user identification.
- Add an input field for the user's Ethereum wallet address to the registration page. When a user registers an account, this wallet address must be saved to the database.
- After login, the homepage must show the balance of the user's Ethereum wallet address.