This is a simple and secure backend API built using FastAPI for handling user registration, login, password hashing, and JWT-based authentication.
- β User Signup with Email Validation
- π Password Hashing using
passlib - π JWT Token Generation on Login
- π§ Email format validation (
EmailStr) - π Protected endpoints using OAuth2 Bearer Token
- ποΈ SQLite Database (with SQLAlchemy ORM)
- π Environment-based configuration (
.envsupport)
- user_signup_project/
- main.py # FastAPI app entry point
- models.py # Pydantic models & DB models
- database.py # Database setup (SQLAlchemy + SQLite)
- utils.py # Utility functions (hashing, JWT)
- auth.py # JWT creation & token handling
- .env # Environment variables
git clone https://github.com/vinay-dev95/user_signup_project.git
cd user_signup_project
uvicorn main:app --host 0.0.0.0 --port 8000 --reload
Dependencies
fastapi
uvicorn
python-dotenv
passlib[bcrypt]
sqlalchemy
pydantic
python-jose (for JWT)