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 âŠ