A production-oriented authentication backend built using FastAPI, PostgreSQL, SQLAlchemy, JWT Authentication, Docker, and Docker Compose.
- User Registration
- User Login
- JWT Authentication
- Protected Routes
- Password Hashing with bcrypt
- PostgreSQL Database
- SQLAlchemy ORM
- Dockerized Backend
- Docker Compose Setup
- REST API Documentation with Swagger UI
- FastAPI
- PostgreSQL
- SQLAlchemy
- Pydantic
- JWT
- Passlib (bcrypt)
- Docker
- Docker Compose
- pgAdmin
auth-practice/
│
├── routers/
│ ├── auth.py
│ └── users.py
│
├── main.py
├── models.py
├── schemas.py
├── database.py
├── auth.py
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
└── .env
| Method | Endpoint | Description |
|---|---|---|
| POST | /register | Register a new user |
| POST | /user-login | Login and receive JWT token |
| GET | /profile | Verify token |
| GET | /me | Get current authenticated user |
| Method | Endpoint | Description |
|---|---|---|
| GET | /get-users | Get all users |
| GET | /A-user/{id} | Get user by ID |
| PUT | /user/{id}/{new_name} | Update username |
| DELETE | /delete_user/{name} | Delete user |
git clone <https://github.com/pranavroy22/Authentication-sys.git>
cd auth-practicepython -m venv auth-pracWindows:
auth-prac\Scripts\activatepip install -r requirements.txtCreate a .env file:
SECRET_KEY=your-secret-key
DATABASE_URL=postgresql+psycopg2://postgres:postgres@postgres:5432/auth_dbdocker compose up --buildApplication:
http://localhost:8000
Swagger Documentation:
http://localhost:8000/docs
This project is being continuously improved while learning backend engineering concepts including:
- Alembic Migrations
- Environment-based Configuration
- Docker Networking
- Docker Volumes
- Deployment
- CI/CD
- Testing
Completed:
- FastAPI CRUD APIs
- PostgreSQL Integration
- JWT Authentication
- Docker
- Docker Compose
Upcoming:
- Alembic Migrations
- Production Deployment
- Testing
- CI/CD Pipeline