Skip to content

IBRA110/APU_Python_Assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📘 Education Management System (Functional Python Project)

It provides command‑line interfaces for:

  • Student/User management
  • Tutor management
  • Course management
  • Enrollment management
  • Payment tracking

🗂️ Project Structure

project/
│
├── app/
│   └── app.py                     # Main CLI application
│
├── core/
│   ├── validators.py              # Pure validation functions
│   └── storage.py                 # Data storage utilities
│
├── infrastructure/
│   ├── user_manager.py            # CRUD operations for users
│   ├── tutor_manager.py           # CRUD operations for tutors
│   ├── course_manager.py          # CRUD operations for courses
│   ├── enrollment_manager.py      # CRUD operations for enrollments
│   └── payment_manager.py         # CRUD operations for payments
│
└── README.md

🧠 Architecture Overview

The project follows a three‑layer functional architecture:

1. App Layer (app/app.py)

  • Displays menus
  • Collects user input
  • Validates input
  • Calls infrastructure functions
  • Shows results to the user

2. Core Layer (core/)

  • validators.py — input validation
  • storage.py — persistent storage abstraction

3. Infrastructure Layer (infrastructure/)

  • Domain‑specific CRUD operations
  • Searching, filtering, updating, deleting
  • Business logic implemented with pure functions

🔧 Key Components

Validators (core/validators.py)

Pure functions that validate:

  • Names
  • Emails
  • Passwords
  • Contact numbers
  • Student levels

The CLI uses ask_until_valid() to repeatedly prompt until valid input is provided.


Storage (core/storage.py)

Handles:

  • Reading data
  • Writing data
  • Managing in‑memory or file‑based storage

Infrastructure modules rely on this layer for persistence.


Managers (infrastructure/*.py)

Each manager contains pure functions for CRUD operations.

user_manager.py

  • create_user()
  • get_all_users()
  • update_user()
  • delete_user()
  • report_active_users_by_category()

course_manager.py

  • create_course()
  • get_course_by_name()
  • search_courses_by_level()

payment_manager.py

  • create_payment()
  • update_payment_status()
  • total_revenue_report()

CLI Application (app/app.py)

Features:

  • Main menu and submenus
  • Input validation
  • Error messages
  • Re‑prompting on invalid input
  • Empty‑list reporting (e.g., “No users found.”)
  • Clean, interactive user experience

🧪 Data Flow

User Input
↓
Validators (core.validators)
↓
Managers (infrastructure.*)
↓
Storage (core.storage)
↓
Output to CLI

🚀 Running the Application

From the project root:

python app/app.py

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages