# jaimemontanares/uni-system architecture

> Architecture diagram of the GitHub repository jaimemontanares/uni-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jaimemontanares/uni-system
- Repository: https://github.com/jaimemontanares/uni-system

## Overview

1. This is a small C# .NET console application for university administration. The architecture is intentionally simple and in-memory: no database, no web layer, and no persistence beyond process lifetime.

2. The application entry point is `Program.cs`. From the README flow, startup initializes demo data through `Data/SeedData.cs` and then hands control to the console UI in `UI/Menu.cs`.

3. The repo is organized into three main runtime boundaries:
   - `UI/` for console interaction and user prompts
   - `Services/` for business rules and operations
   - `Models/` for the domain entities that hold state

4. `Services/UniversityManager.cs` is the central business component. It likely acts as the in-memory application service/facade that coordinates student, course, book, and loan operations, enforcing rules such as enrollment limits and loan availability.

5. `Models/` contains the core domain objects:
   - `User` as the base identity concept
   - `Student` and `ExchangeStudent` as student variants
   - `Employee` as staff representation
   - `Course` for course data and enrollment
   - `Book` and `Loan` for library operations
   These are simple data/behavior classes rather than persistence entities.

6. `Data/SeedData.cs` provides the initial graph of objects used at startup. It populates sample students, courses, and books so the console menu can be exercised immediately without manual setup.

7. The main data flow is linear and synchronous: seeded collections are created at startup, the menu receives user input, the UI delegates actions to `UniversityManager`, and the manager updates the in-memory model collections. There is no background processing or external integration.

8. The repository currently combines multiple business domains in one service layer:
   - student management
   - course management
   - library/book loans
   This makes `UniversityManager` the main aggregation point, but also means domain boundaries are not yet split into separate services.

9. The README shows the current feature set is centered on CRUD-style operations and basic rules:
   - create/view courses
   - enroll/remove students
   - register/loan/return books
   - view participants and available books
   The important constraints are enforced in application logic, not by infrastructure.

10. The architecture is designed for learning and incremental refactoring. The README roadmap indicates planned future separation into role-based users, dedicated services, and role-specific menus, but the current codebase is still a single-console-flow, in-memory design.

11. For an architecture diagram, the key components are:
   - `Program.cs` as the startup node
   - `SeedData` as the bootstrap data source
   - `Menu` as the interactive UI boundary
   - `UniversityManager` as the business logic hub
   - `Models/*` as the shared domain state
   - no external services, database, or API layer

Main entry points: [`Services/UniversityManager.cs`](https://github.com/jaimemontanares/uni-system/blob/main/Services/UniversityManager.cs) (University Manager), [`Models/Student.cs`](https://github.com/jaimemontanares/uni-system/blob/main/Models/Student.cs) (Student), [`Program.cs`](https://github.com/jaimemontanares/uni-system/blob/main/Program.cs) (Program), [`Data/SeedData.cs`](https://github.com/jaimemontanares/uni-system/blob/main/Data/SeedData.cs) (Seed Data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_program(("Program<br/>entry point<br/>[Program.cs]"))
  node_seeddata["Seed Data<br/>bootstrap data<br/>[SeedData.cs]"]
  node_menu["Menu<br/>console UI<br/>[Menu.cs]"]
  node_manager{{"University Manager<br/>service facade"}}
end

subgraph group_domain["Domain"]
  node_user["User<br/>base model<br/>[User.cs]"]
  node_student["Student<br/>domain model<br/>[Student.cs]"]
  node_exchange_student["Exchange Student<br/>student variant<br/>[ExchangeStudent.cs]"]
  node_employee["Employee<br/>staff model<br/>[Employee.cs]"]
  node_course["Course<br/>academic model<br/>[Course.cs]"]
  node_book["Book<br/>library model<br/>[Book.cs]"]
  node_loan["Loan<br/>library model<br/>[Loan.cs]"]
end

node_program -->|"seeds"| node_seeddata
node_program -->|"starts"| node_menu
node_menu -->|"calls"| node_manager
node_seeddata -->|"loads"| node_manager
node_manager -->|"manages"| node_student
node_manager -->|"manages"| node_course
node_manager -->|"manages"| node_book
node_manager -->|"manages"| node_loan
node_student -->|"inherits"| node_user
node_exchange_student -->|"inherits"| node_student
node_employee -->|"inherits"| node_user
node_loan -->|"references"| node_book
node_course -->|"enrolls"| node_student

click node_program "https://github.com/jaimemontanares/uni-system/blob/main/Program.cs"
click node_seeddata "https://github.com/jaimemontanares/uni-system/blob/main/Data/SeedData.cs"
click node_menu "https://github.com/jaimemontanares/uni-system/blob/main/UI/Menu.cs"
click node_manager "https://github.com/jaimemontanares/uni-system/blob/main/Services/UniversityManager.cs"
click node_user "https://github.com/jaimemontanares/uni-system/blob/main/Models/User.cs"
click node_student "https://github.com/jaimemontanares/uni-system/blob/main/Models/Student.cs"
click node_exchange_student "https://github.com/jaimemontanares/uni-system/blob/main/Models/ExchangeStudent.cs"
click node_employee "https://github.com/jaimemontanares/uni-system/blob/main/Models/Employee.cs"
click node_course "https://github.com/jaimemontanares/uni-system/blob/main/Models/Course.cs"
click node_book "https://github.com/jaimemontanares/uni-system/blob/main/Models/Book.cs"
click node_loan "https://github.com/jaimemontanares/uni-system/blob/main/Models/Loan.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_program,node_seeddata,node_menu,node_manager toneBlue
class node_user,node_student,node_exchange_student,node_employee,node_course,node_book,node_loan toneAmber
```

## Components

### Runtime

Startup, console interaction, and orchestration

- [Program](https://github.com/jaimemontanares/uni-system/blob/main/Program.cs): entry point · Application startup and wiring · `Program.cs`
- [Seed Data](https://github.com/jaimemontanares/uni-system/blob/main/Data/SeedData.cs): bootstrap data · Creates initial demo objects · `Data/SeedData.cs`
- [Menu](https://github.com/jaimemontanares/uni-system/blob/main/UI/Menu.cs): console UI · Reads user input and dispatches actions · `UI/Menu.cs`
- [University Manager](https://github.com/jaimemontanares/uni-system/blob/main/Services/UniversityManager.cs): service facade · Central in-memory business logic and rules · `Services/UniversityManager.cs`

### Domain

In-memory university and library model

- [User](https://github.com/jaimemontanares/uni-system/blob/main/Models/User.cs): base model · Shared identity concept · `Models/User.cs`
- [Student](https://github.com/jaimemontanares/uni-system/blob/main/Models/Student.cs): domain model · Student state and behavior · `Models/Student.cs`
- [Exchange Student](https://github.com/jaimemontanares/uni-system/blob/main/Models/ExchangeStudent.cs): student variant · Specialized student type · `Models/ExchangeStudent.cs`
- [Employee](https://github.com/jaimemontanares/uni-system/blob/main/Models/Employee.cs): staff model · University staff representation · `Models/Employee.cs`
- [Course](https://github.com/jaimemontanares/uni-system/blob/main/Models/Course.cs): academic model · Course data and enrollment · `Models/Course.cs`
- [Book](https://github.com/jaimemontanares/uni-system/blob/main/Models/Book.cs): library model · Library inventory item · `Models/Book.cs`
- [Loan](https://github.com/jaimemontanares/uni-system/blob/main/Models/Loan.cs): library model · Borrowing record · `Models/Loan.cs`

## Connections

- Program → Seed Data: seeds · Initializes demo data at startup
- Program → Menu: starts · Hands control to the console UI
- Menu → University Manager: calls · Delegates user actions to business logic
- Seed Data → University Manager: loads · Supplies initial in-memory collections
- University Manager → Student: manages · Applies student rules and updates
- University Manager → Course: manages · Creates and updates courses
- University Manager → Book: manages · Tracks books and availability
- University Manager → Loan: manages · Handles checkout and return flows
- Student → User: inherits · Student extends the shared user concept
- Exchange Student → Student: inherits · Exchange student specializes student
- Employee → User: inherits · Employee shares base identity behavior
- Loan → Book: references · Loan is tied to a borrowed book
- Course → Student: enrolls · Courses hold enrolled students
