Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ Student Management System

A secure and scalable Student Management System built with FastAPI, implementing JWT Authentication, Role-Based Authorization, Redis Caching, Logging & Monitoring, and Comprehensive API Testing.


πŸ“Œ Project Overview

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.


πŸš€ Features

Authentication & Security

  • User Registration
  • User Login
  • JWT Token Generation
  • JWT Token Validation
  • Password Hashing
  • Protected Routes

Role-Based Authorization

Admin

  • Create Students
  • View Students
  • Update Students
  • Delete Students
  • Access All Student Records

Student

  • View Own Profile
  • Update Limited Profile Information

Student Management

  • 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

Redis Caching

  • Cache GET All Students
  • Cache GET Student By ID
  • Cache Invalidation After:
    • Create
    • Update
    • Delete

Logging

The application logs:

  • Incoming Requests
  • Response Status Codes
  • Response Time
  • Authentication Events
  • CRUD Operations
  • Errors and Exceptions

Monitoring Dashboard

Dashboard displays:

  • API Request Count
  • Response Time
  • Error Rate
  • System Health Status

Possible Technologies:

  • Prometheus
  • Grafana

API Testing

Implemented using:

  • Pytest
  • FastAPI TestClient

Tests cover:

  • Authentication
  • Authorization
  • CRUD Operations
  • Validation Errors
  • Edge Cases
  • Protected Endpoints

πŸ› οΈ Tech Stack

Backend

  • FastAPI
  • Python
  • SQLAlchemy
  • PostgreSQL / MySQL
  • Pydantic

Authentication

  • JWT
  • Passlib

Caching

  • Redis

Monitoring

  • Prometheus
  • Grafana

Testing

  • Pytest
  • TestClient

Version Control

  • Git
  • GitHub

πŸ“‚ Project Structure

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

πŸ”‘ API Endpoints

Authentication

Method Endpoint Description
POST /auth/register Register User
POST /auth/login Login User

Students

Method Endpoint
GET /students
GET /students/{id}
POST /students
PUT /students/{id}
DELETE /students/{id}

βš™οΈ Installation

Clone Repository

git clone https://github.com/your-username/student-management-system-fastapi.git

Create Virtual Environment

python -m venv venv

Activate Environment

venv\Scripts\activate

Install Dependencies

pip install -r requirements.txt

Run Application

uvicorn app.main:app --reload

πŸ§ͺ Run Tests

pytest

πŸ“Š Monitoring

Prometheus collects:

  • Request Count
  • Response Time
  • Error Rate

Grafana visualizes metrics through dashboards.


πŸ‘₯ Team Members

Name Role
Member 1 Backend
Member 2 Authentication
Member 3 Authorization
Member 4 Caching
Member 5 Testing & Monitoring

πŸ“„ License

This project is developed for educational purposes as part of the Backend Development with FastAPI course.

About

Student Management System built with FastAPI, JWT Authentication, Redis Caching, Docker, Role-Based Access Control and API Testing.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages