A comprehensive web-based application designed to digitize and streamline administrative operations of educational institutions. Built with Clean Architecture principles using .NET 9.0 and modern development practices.
- Overview
- Features
- Architecture
- Technology Stack
- Project Structure
- Getting Started
- API Documentation
- Database Schema
- Authentication & Security
- Testing
- Contributing
- License
The University Management System is a RESTful API application that manages core academic functions including student enrollment, course administration, faculty management, and academic scheduling. The system follows Clean Architecture principles with strict layer separation and dependency inversion to ensure maintainability, testability, and separation of concerns.
- Student Lifecycle Management: Complete enrollment workflow from application to graduation
- Academic Operations: Course catalog, scheduling, and registration management
- Faculty Administration: Professor profiles, specializations, and employment records
- Financial Management: Financial holds and resolution tracking
- Document Verification: Academic credential and document validation
- Administrative Workflows: Service applications and interview coordination
- Student enrollment and profile management
- Course catalog with prerequisite handling
- Academic scheduling and section management
- Grade processing and transcript generation
- Program and semester management
- Faculty management and assignments
- Financial hold management
- Document verification workflows
- Service application processing
- Interview scheduling and coordination
- Entrance exam management
- JWT-based authentication and authorization
- Comprehensive audit logging
- RESTful API with OpenAPI documentation
- Robust error handling with Result pattern
- Automated testing suite
- Database migrations
The system implements Clean Architecture with four distinct layers:
graph TD
%% Define the layers with enhanced styling
A["π **Presentation Layer**<br/>Controllers, API Endpoints<br/>Web UI, REST APIs<br/><code>Presentation.csproj</code>"]
B["βοΈ **Application Layer**<br/>Use Cases, Services<br/>DTOs, Validators<br/><code>Application.csproj</code>"]
C["ποΈ **Domain Layer**<br/>Entities, Value Objects<br/>Domain Services<br/><code>Domain.csproj</code>"]
D["π§ **Infrastructure Layer**<br/>Repositories, DbContext<br/>External Services, File I/O<br/><code>Infrastructure.csproj</code>"]
%% Dependencies (solid lines for compile-time dependencies)
A -->|"depends on"| B
B -->|"depends on"| C
%% Infrastructure implements domain interfaces (dashed line for runtime dependency)
D -.->|"implements interfaces from"| C
%% Dependency Injection (dotted line)
A -.->|"injected at runtime"| D
%% Styling
classDef presentation fill:#e1f5fe,stroke:#0277bd,stroke-width:2px,color:#000
classDef application fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px,color:#000
classDef domain fill:#fff3e0,stroke:#f57c00,stroke-width:2px,color:#000
classDef infrastructure fill:#e8f5e8,stroke:#388e3c,stroke-width:2px,color:#000
class A presentation
class B application
class C domain
class D infrastructure
%% Add notes
E["π **Key Principles:**<br/>β’ Domain has no dependencies<br/>β’ Application depends only on Domain<br/>β’ Infrastructure implements Application's interfaces<br/>β’ Presentation depends on Application<br/>β’ Dependencies point inward"]
classDef notes fill:#fff9c4,stroke:#f57f17,stroke-width:1px,color:#000,stroke-dasharray: 5 5
class E notes
- Dependency Inversion: Inner layers define interfaces, outer layers implement them
- Single Responsibility: Each layer has a specific purpose
- Repository Pattern: Abstraction over data access
- Unit of Work: Transaction coordination across repositories
- Result Pattern: Consistent error handling and operation outcomes
- .NET 9.0 - Target framework with C# 13 features
- ASP.NET Core 9.0 - Web API framework
- Entity Framework Core 9.0 - Object-Relational Mapping
- PostgreSQL - Primary database
- Npgsql - PostgreSQL provider for EF Core
- JWT Bearer Authentication - Token-based authentication
- BCrypt.Net - Password hashing and verification
- AutoMapper - Object-to-object mapping
- Swagger/OpenAPI - API documentation
- Scalar - Enhanced API documentation UI
- xUnit - Primary testing framework
- Moq - Mocking framework
- FluentAssertions - Fluent assertion library
- EF Core InMemory - In-memory database for testing
UniversityManagementSystem/
βββ Domain/ # Core business entities and rules
β βββ Entities/ # Domain entities (Student, Course, etc.)
β βββ Enums/ # Domain enumerations
β βββ Domain.csproj
βββ Applications/ # Business logic and use cases
β βββ Services/ # Application services
β βββ Interfaces/ # Service, repository, Auth, Unit of work, and custom Logger interfaces
β βββ DTOs/ # Data transfer objects
β βββ Mappers/ # AutoMapper Profiles
β βββ Helpers/ # Utility classes
β βββ Shared/ # Result pattern
β βββ DependencyInjection.cs
β βββ Applications.csproj
βββ Infrastructure/ # Data access and external services
β βββ Data/ # Database context and configurations
β βββ Repositories/ # Repository implementations
β βββ Logger/ # Custom Logger Implementation
β βββ Settings/ # Jwt Settings
β βββ UnitOfWokrs/ # UnitOfWork implementation
β βββ Authentication/ # JWT and Password Hashing services
β βββ DependencyInjection.cs
β βββ Infrastructure.csproj
βββ Presentation/ # API controllers and HTTP handling
β βββ Controllers/ # REST API controllers
β βββ Extensions/ # Result handling extensions
β βββ Presentation.csproj
βββ UnitTests/ # Test suite
β βββ Services/ # Service tests
β βββ UnitTests.csproj
βββ README.md
-
Clone the repository
git clone https://github.com/yourusername/university-management-system.git cd university-management-system -
Set up the database
# Create a PostgreSQL database createdb university_management -
Configure environment variables Create an
appsettings.jsonfile in the Presentation project:DefaultConnection=Host=your_host;Database=your_database;Username=your_username;Password=your_password JWT Configuration JWT_SECRET=your-jwt-secret-key-minimum-32-characters-long JWT_ISSUER=your-app-name JWT_AUDIENCE=your-app-users JWT_EXPIRY_MINUTES=jwt_lifetime
-
Install dependencies
dotnet restore
-
Run database migrations
dotnet ef database update --project Infrastructure --startup-project Presentation
-
Build and run the application
dotnet build dotnet run --project Presentation
The API will be available at https://localhost:5001 (HTTPS) or http://localhost:5000 (HTTP).
The application requires the following environment variables:
| Variable | Description | Required |
|---|---|---|
JWT_SECRET_KEY |
Secret key for JWT token generation | Yes |
JWT_ISSUER |
JWT token issuer | Yes |
JWT_AUDIENCE |
JWT token audience | Yes |
JWT_ACCESS_TOKEN_LIFETIME |
Token lifetime in minutes | Yes |
Once the application is running, you can access the interactive API documentation at:
- Swagger UI:
https://localhost:5001/swagger - Scalar UI:
https://localhost:5001/scalar/v1
POST /api/auth/login- User authenticationPOST /api/auth/register- User registration
GET /api/students- Get all studentsGET /api/students/{id}- Get student by IDPOST /api/students- Create new studentPUT /api/students/{id}- Update studentDELETE /api/students/{id}- Delete student
GET /api/courses- Get all coursesGET /api/courses/{id}- Get course by IDPOST /api/courses- Create new coursePUT /api/courses/{id}- Update coursePATCH /api/courses/{id}/deactivate- Deactivate course
GET /api/enrollments- Get all enrollmentsPOST /api/enrollments- Create new enrollmentPUT /api/enrollments/{id}- Update enrollment
GET /api/grades- Get all gradesGET /api/grades/student/{studentId}- Get grades by studentGET /api/grades/course/{courseId}- Get grades by coursePOST /api/grades- Create new grade
GET /api/financial-holds- Get all financial holdsPOST /api/financial-holds- Create new financial holdPATCH /api/financial-holds/{id}/resolve- Resolve financial hold
- Person: Base entity for all individuals
- Student: Extends Person with academic information
- Professor: Faculty members and instructors
- User: System authentication users
- Program: Academic programs and degrees
- Course: Course catalog
- Section: Course sections with scheduling
- Semester: Academic semester definitions
- Prerequisite: Course prerequisite relationships
- Enrollment: Student program enrollments
- Registration: Student course registrations
- Grade: Academic grade records
- FinancialHold: Financial holds and restrictions
- ServiceApplication: Student service applications
- DocsVerification: Document verification tracking
- EntranceExam: Entrance examination records
- Interview: Interview process management
The system uses JSON Web Tokens (JWT) for secure authentication:
- Token-based authentication: Stateless authentication mechanism
- Bearer token: Include token in Authorization header
- Configurable expiration: Token lifetime management
- Secure password hashing: BCrypt for password security
- Controller-level authorization: Most endpoints require authentication
- Anonymous access: Limited to public endpoints (e.g., countries)
- Role-based access: Extensible for future role implementations
- Environment-based configuration
- Secure password hashing with BCrypt
- JWT token validation
- Input validation and sanitization
- Comprehensive error handling
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Make your changes
- Add tests for new functionality
- Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.