π Payroll Management Backend (FastAPI)
This is a complete Payroll Management API developed as part of Anshumat Internship Backend Assignment. It demonstrates authentication, authorization, salary slip CRUD operations, and role-based access using FastAPI.
π§° Tech Stack
| Component | Technology |
|---|---|
| Backend | FastAPI |
| ORM | SQLAlchemy |
| Database | SQLite |
| Auth | JWT + OAuth2PasswordRequestForm |
| Password Hashing | bcrypt |
β¨ Features π Authentication
- Login (OAuth2)
- JWT access tokens
- Password hashing
π₯ Authorization
| Role | Access |
|---|---|
| Admin | Create + Update + View all salary slips |
| Employee | View only own salary slips |
πΈ Salary Slips
- Create salary slip
- Update salary slip
- Get salary slips by role
π° Expenses
- Employee expense submission
- Admin expense approval
π¦ Project Structure
backend/ main.py auth.py models.py schemas.py database.py requirements.txt
cd backend python -m venv .venv .venv\Scripts\Activate pip install -r requirements.txt uvicorn main:app --reload --port 8000
Open Swagger UI:
http://127.0.0.1:8000/docs π Admin Login
email: hire-me@anshumat.org password: HireMe@2025!
Use this to generate token for testing protected endpoints.
π§ͺ Sample Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/login | Login & get JWT token |
| GET | /auth/me | Current user |
| POST | /salary-slip | Create slip |
| PUT | /salary-slip/{id} | Update slip |
| GET | /salary-slip | List slips |
| POST | /expense | Create expense |
| GET | /expense | View expenses |
- Login success
- Salary slip POST 200
- Salary slip GET 200
- Swagger endpoints working
π’ Notes
This assignment demonstrates backend development skills including:
- Authentication
- Role based access
- Database CRUD
- Secure API patterns
πββοΈ Author
Venkata Sai Deepthi
Email: venkatasaideepthi3@gmail.com




