A secure and scalable Student Management System built with FastAPI, implementing JWT Authentication, Role-Based Authorization, Redis Caching, Logging & Monitoring, and Comprehensive API Testing.
This project provides a backend system for managing university students with secure authentication and role-based access control.
The system allows administrators to manage student records while students can view and update their own profiles.
- User Registration
- User Login
- JWT Token Generation
- JWT Token Validation
- Password Hashing
- Protected Routes
- Create Students
- View Students
- Update Students
- Delete Students
- Access All Student Records
- View Own Profile
- Update Limited Profile Information
- Create Student
- Retrieve All Students
- Retrieve Student By ID
- Update Student Information
- Delete Student
- Pagination Support
- Filtering Support
Examples:
- Filter by Department
- Filter by GPA
- Cache GET All Students
- Cache GET Student By ID
- Cache Invalidation After:
- Create
- Update
- Delete
The application logs:
- Incoming Requests
- Response Status Codes
- Response Time
- Authentication Events
- CRUD Operations
- Errors and Exceptions
Dashboard displays:
- API Request Count
- Response Time
- Error Rate
- System Health Status
Possible Technologies:
- Prometheus
- Grafana
Implemented using:
- Pytest
- FastAPI TestClient
Tests cover:
- Authentication
- Authorization
- CRUD Operations
- Validation Errors
- Edge Cases
- Protected Endpoints
- FastAPI
- Python
- SQLAlchemy
- PostgreSQL / MySQL
- Pydantic
- JWT
- Passlib
- Redis
- Prometheus
- Grafana
- Pytest
- TestClient
- Git
- GitHub
student-management-system-fastapi/
β
βββ app/
β βββ main.py
β β
β βββ routes/
β β βββ auth.py
β β βββ students.py
β β
β βββ models/
β β βββ user.py
β β βββ student.py
β β
β βββ schemas/
β β βββ auth.py
β β βββ student.py
β β
β βββ services/
β β βββ auth_service.py
β β βββ student_service.py
β β
β βββ core/
β β βββ config.py
β β βββ security.py
β β βββ roles.py
β β
β βββ database/
β β βββ connection.py
β β βββ base.py
β β
β βββ cache/
β βββ redis.py
β
βββ tests/
β βββ test_auth.py
β βββ test_students.py
β βββ test_roles.py
β
βββ logs/
β
βββ requirements.txt
β
βββ .env
β
βββ README.md| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/register | Register User |
| POST | /auth/login | Login User |
| Method | Endpoint |
|---|---|
| GET | /students |
| GET | /students/{id} |
| POST | /students |
| PUT | /students/{id} |
| DELETE | /students/{id} |
git clone https://github.com/your-username/student-management-system-fastapi.gitpython -m venv venvvenv\Scripts\activatepip install -r requirements.txtuvicorn app.main:app --reloadpytestPrometheus collects:
- Request Count
- Response Time
- Error Rate
Grafana visualizes metrics through dashboards.
| Name | Role |
|---|---|
| Member 1 | Backend |
| Member 2 | Authentication |
| Member 3 | Authorization |
| Member 4 | Caching |
| Member 5 | Testing & Monitoring |
This project is developed for educational purposes as part of the Backend Development with FastAPI course.