Logo Lanfrica

pingoboxer/Course-Enrollment-Management-API

Domain:

education

Record type:

software
Creator:
pin
Host:
Altschool Africa Second Semester Project Exam # πŸ“˜ Course Management & Enrollment API A modern, modular backend system built with **FastAPI** that manages users, courses, and student enrollments. This project demonstrates clean architecture principles, role-based access control, validation handling, and relationship management using in-memory storage. --- ## πŸš€ Features ### πŸ‘€ User Management * Create users (student/admin) * Retrieve all users * Retrieve a specific user by ID * Email validation using Pydantic `EmailStr` * Duplicate email prevention ### πŸ“š Course Management * Admin-only course creation * Update course details * Delete course (with cascading enrollment cleanup) * Prevent duplicate course codes * Public course retrieval ### πŸŽ“ Enrollment System * Student enrollment into courses * Duplicate enrollment prevention * Student deregistration * Admin force deregistration * View student enrollments * View course enrollments (admin) --- ## πŸ— Architecture & Design This project follows a **layered architecture pattern**: ``` β”œβ”€β”€ README.md β”œβ”€β”€ app β”‚ β”œβ”€β”€ __init__.py β”‚ β”œβ”€β”€ __pycache__ β”‚ β”‚ β”œβ”€β”€ __init__.cpython-314.pyc β”‚ β”‚ └── main.cpython-314.pyc β”‚ β”œβ”€β”€ api β”‚ β”‚ └── v1 β”‚ β”‚ β”œβ”€β”€ courses.py β”‚ β”‚ β”œβ”€β”€ enrollments.py β”‚ β”‚ └── users.py β”‚ β”œβ”€β”€ core β”‚ β”‚ β”œβ”€β”€ __init__.py β”‚ β”‚ β”œβ”€β”€ __pycache__ β”‚ β”‚ └── storage.py β”‚ β”œβ”€β”€ main.py β”‚ β”œβ”€β”€ schemas β”‚ β”‚ β”œβ”€β”€ __init__.py β”‚ β”‚ β”œβ”€β”€ __pycache__ β”‚ β”‚ β”œβ”€β”€ common.py β”‚ β”‚ β”œβ”€β”€ course_schema.py β”‚ β”‚ β”œβ”€β”€ enrollment_schema.py β”‚ β”‚ └── user_schema.py β”‚ └── services β”‚ β”œβ”€β”€ __init__.py β”‚ β”œβ”€β”€ __pycache__ β”‚ β”œβ”€β”€ course_service.py β”‚ β”œβ”€β”€ enrollment_service.py β”‚ └── user_service.py β”œβ”€β”€ env β”‚ β”œβ”€β”€ pytest.ini β”œβ”€β”€ requirements.txt └── tests β”œβ”€β”€ __pycache__ β”‚ β”œβ”€β”€ test_courses.py β”œβ”€β”€ test_enrollments.py └── test_users.py ``` ### πŸ”Ή Separation of Concerns | Layer | Responsibility | | ------- | ----------------------- | | api/v1 | HTTP handling only | | Schema | Input/output validatio …