Skip to content

peterprospl12/academic-management-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ Academic Management System (AMS)

A comprehensive academic management system built with .NET that demonstrates Clean Architecture principles and Clean Code practices. The system manages students, professors, courses, departments, and academic relationships with advanced features like automatic index generation, enrollment tracking, and academic reporting.

πŸ“‹ Table of Contents

✨ Features

Core Functionality

  • Student Management: Complete CRUD operations for students with automatic university index generation
  • Professor Management: Manage academic staff with titles and office assignments
  • Course Management: Define courses with ECTS credits, prerequisites, and lecturer assignments
  • Department Management: Organize courses and staff by departments
  • Enrollment System: Many-to-many relationship handling between students and courses with grades and semester tracking
  • Master's Students: Extended student entity with thesis topics and promoter assignments

Advanced Features

  • Automatic Index Numbering: Transactional sequence generation for student and professor indexes (e.g., S1001, P101)
  • Smart Index Decrement: Automatic rollback of sequence counters when the highest-numbered entity is deleted
  • Prerequisites System: Self-referencing many-to-many relationship for course prerequisites
  • Office Assignment: One-to-one relationship between professors and offices
  • Academic Reports:
    • Most popular professor (by total enrolled students)
    • Course GPA by department
    • Student with the hardest study plan (based on ECTS credits)
  • Data Generation: Bogus-powered fake data generator for testing and development
  • Terminal GUI: Interactive console interface using Terminal.Gui

πŸ—οΈ Architecture

This project follows Clean Architecture principles with clear separation of concerns:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           AMS.ConsoleUI (UI)            β”‚
β”‚     Terminal.Gui, Dependency Injection  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    AMS.Infrastructure (Infrastructure)  β”‚
β”‚  Entity Framework Core, SQL Server,     β”‚
β”‚  Configurations, Migrations, Seeder     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     AMS.Application (Application)       β”‚
β”‚   Services, DTOs, Business Logic,       β”‚
β”‚   CRUD Operations, Reports              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚        AMS.Domain (Domain)              β”‚
β”‚   Entities, Value Objects, Enums,       β”‚
β”‚   Domain Interfaces                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Layer Responsibilities

  • Domain: Core business entities and rules (Student, Professor, Course, etc.)
  • Application: Business logic, services, and data transfer objects
  • Infrastructure: Data access, Entity Framework Core context, and database configurations
  • UI: User interface layer with Terminal.Gui for interactive console application

πŸ› οΈ Technology Stack

  • .NET 10.0: Latest .NET framework
  • Entity Framework Core 10.0: ORM for data access
  • SQL Server: Database engine
  • Terminal.Gui 1.19.0: Cross-platform terminal UI toolkit
  • Bogus 35.6.5: Fake data generator
  • Microsoft.Extensions.Hosting: Dependency injection and hosting
  • C# 13: Latest C# language features

πŸš€ Getting Started

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/peterprospl12/academic-management-system.git
    cd academic-management-system
  2. Update the connection string

    Edit AMS.ConsoleUI/appsettings.json and update the connection string:

    {
      "ConnectionStrings": {
        "DefaultConnection": "Server=localhost;Database=AcademicManagementDB;Trusted_Connection=True;TrustServerCertificate=True;"
      }
    }
  3. Restore dependencies

    dotnet restore
  4. Build the solution

    dotnet build
  5. Run the application

    cd AMS.ConsoleUI
    dotnet run

    The application will automatically:

    • Apply database migrations
    • Seed initial data if the database is empty
    • Launch the interactive Terminal.Gui interface

πŸ“ Project Structure

academic-management-system/
β”œβ”€β”€ AMS.Domain/
β”‚   β”œβ”€β”€ Entities/           # Domain entities (Student, Professor, Course, etc.)
β”‚   β”œβ”€β”€ ValueObjects/       # Value objects (Address)
β”‚   β”œβ”€β”€ Enums/             # Enumerations (AcademicTitle)
β”‚   β”œβ”€β”€ Common/            # Base classes and interfaces
β”‚   └── Interfaces/        # Domain interfaces
β”œβ”€β”€ AMS.Application/
β”‚   β”œβ”€β”€ Services/          # Business logic services
β”‚   β”œβ”€β”€ DTOs/              # Data transfer objects
β”‚   β”œβ”€β”€ Interfaces/        # Service interfaces
β”‚   └── Common/            # Common application models
β”œβ”€β”€ AMS.Infrastructure/
β”‚   └── Persistence/
β”‚       β”œβ”€β”€ ApplicationDbContext.cs
β”‚       β”œβ”€β”€ Configurations/    # Entity configurations
β”‚       β”œβ”€β”€ Migrations/        # EF Core migrations
β”‚       └── Seeder/           # Data seeding with Bogus
└── AMS.ConsoleUI/
    β”œβ”€β”€ Views/             # Terminal.Gui views
    β”œβ”€β”€ Helpers/           # UI helper classes
    β”œβ”€β”€ Extensions/        # Extension methods
    └── Program.cs         # Application entry point

πŸ—„οΈ Database Schema

Key Entities

  • Student: FirstName, LastName, UniversityIndex, YearOfStudy, Address (owned entity)
  • Professor: FirstName, LastName, UniversityIndex, AcademicTitle, Address (owned entity)
  • MasterStudent: Inherits from Student, adds ThesisTopic and Promoter relationship
  • Course: Name, CourseCode, Ects, Department, Lecturer, Prerequisites (self-referencing)
  • Enrollment: Many-to-many join entity between Student and Course with Grade and Semester
  • Department: Name
  • Office: One-to-one relationship with Professor
  • SequenceCounter: Manages auto-incrementing indexes with Prefix and CurrentValue

Relationships

  • Student ↔ Course: Many-to-many through Enrollment
  • Course ↔ Course: Many-to-many self-referencing for prerequisites
  • Professor ↔ Office: One-to-one
  • MasterStudent β†’ Professor: Many-to-one (Promoter) with SetNull on delete
  • Course β†’ Professor: Many-to-one (Lecturer)
  • Course β†’ Department: Many-to-one

πŸ“Έ Screenshots

Main Menu

image

Courses Management

image image

Assigning office (key: O in Professors List)

image

Academic Reports

image

Data Generator

image

🧹 Clean Code Practices

This project demonstrates various Clean Code principles:

SOLID Principles

  • Single Responsibility: Each service class has a single, well-defined purpose
  • Open/Closed: Extensible through inheritance (e.g., MasterStudent extends Student)
  • Liskov Substitution: Derived entities can replace base entities
  • Interface Segregation: Small, focused interfaces for services
  • Dependency Inversion: Depends on abstractions (IApplicationDbContext, service interfaces)

Code Quality Features

  • Meaningful Names: Clear, descriptive names for classes, methods, and variables
  • Small Functions: Methods focused on single tasks
  • Async/Await: Proper asynchronous programming throughout
  • LINQ Queries: Declarative data access with optimizations:
    • AsNoTracking() for read-only queries
    • Projection with Select() to minimize data retrieval
    • Include()/ThenInclude() to avoid N+1 query problems
  • Result Pattern: Consistent error handling with Result type
  • Value Objects: Immutable Address record for better domain modeling
  • Repository Pattern: DbContext acts as repository with service layer abstraction
  • Dependency Injection: Constructor injection throughout the application
  • Configuration Over Code: Entity configurations separated from entities

Entity Framework Optimizations

  • Server-side query evaluation
  • Eager loading for related data
  • Unique indexes on frequently queried columns
  • Transactional operations for data consistency
  • Owned entities for value objects

🎯 Key Functionalities

1. Automatic Index Generation

Students and professors receive unique indexes automatically:

// Transactional sequence generation
var counter = await GetOrCreateSequenceAsync(prefix);
counter.CurrentValue++;
var newIndex = $"{prefix}{counter.CurrentValue}";

2. Smart Index Management

When deleting the last entity in a sequence, the counter rolls back:

// Prevents gaps at the end of sequences
if (entity.UniversityIndex == $"{prefix}{counter.CurrentValue}")
{
    counter.CurrentValue--;
}

3. Complex LINQ Queries

Optimized queries for academic reports:

// Most popular professor
var topProf = await context.Professors
    .AsNoTracking()
    .Select(p => new { /* projection */ })
    .OrderByDescending(x => x.TotalStudents)
    .FirstOrDefaultAsync();

4. Terminal UI Navigation

Interactive console application with:

  • List views with filtering
  • Create/Update/Delete operations
  • Report generation and display
  • Data seeding control

About

Comprehensive academic management system built with .NET 10.0 that demonstrates Clean Architecture

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages