This project implements a secure user authentication system using FastAPI for the backend.
- User registration with validation
- Secure login with password protection
- JWT-based authentication
- Protected routes
- Password hashing
- SQLite database
- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Run the application:
uvicorn main:app --reload- POST
/users/- Create a new user - POST
/token- Get JWT token - GET
/protected- Protected route (requires authentication)
- Passwords are hashed using bcrypt
- JWT tokens for authentication
- Protected routes with token validation
- Input validation for user registration
- Secure password handling