Skip to content

A modern, high-performance .NET-based Student Enrollment System API built with Clean Architecture principles and Domain-Driven Design patterns.

Notifications You must be signed in to change notification settings

ahmedabougabal/StudentEnrollmentSystemAPI

Repository files navigation

πŸŽ“ Student Enrollment System API

Project Information

Project Information

.NET 6+ FastEndpoints Last Updated Author

A modern, high-performance .NET-based Student Enrollment System API built with Clean Architecture principles and Domain-Driven Design patterns.

Table of Contents

Architecture & Design Patterns Entity Relationships Technical Stack API Structure Deployment & Setup


Access swaggerUI to test the endpoints steps :

dotnet run 

then access the link at the specified port that shows up in the terminal after running the app.

it should look sth like this : http://localhost:5260/swagger/index.html

image


πŸ— Architecture & Design Patterns

Clean Architecture Layers

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    API (Features) Layer     β”‚  β†’ FastEndpoints for HTTP endpoints
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚    Application Layer        β”‚  β†’ Business logic & use cases
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚    Domain Layer            β”‚  β†’ Entities & business rules
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚    Infrastructure Layer     β”‚  β†’ Data access & external services
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ— Architecture Overview

The project follows a clean architecture pattern with distinct layers:

1. Domain Layer

  • Contains core business entities:
    • Student
    • Class
    • Enrollment
    • Mark

2. Application Layer

  • Implements business logic through services:
    • StudentService: Manages student operations
    • ClassService: Handles class management
    • EnrollmentService: Processes student enrollments
    • MarkService: Manages academic performance tracking

3. Infrastructure Layer

  • Repository implementations for data persistence
  • Uses repository pattern with interfaces:
    • IStudentRepository
    • IClassRepository
    • IEnrollmentRepository
    • IMarkRepository

4. API Layer (Features)

  • Built using FastEndpoints for efficient API endpoint handling
  • Organized by feature folders:
    • Students
    • Classes
    • Enrollments
    • Marks

πŸš€ Key Features

Student Management

  • Create, update, and delete student records
  • View student details and academic history
  • Generate comprehensive student reports
  • Track student enrollments across multiple classes

Class Management

  • Create and manage classes
  • Assign teachers to classes
  • Track class enrollment statistics
  • Calculate class average performance

Enrollment System

  • Enroll students in classes
  • Prevent duplicate enrollments
  • Track enrollment dates
  • Manage class capacity

Academic Performance Tracking

  • Record and manage student marks
  • Calculate individual and class averages
  • Track examination and assignment scores
  • Generate performance reports

πŸ›  Technical Implementation

Modern Technology Stack

  • Framework: .NET 6+
  • API Architecture: REST with FastEndpoints
  • Documentation: Swagger/OpenAPI
  • Authentication: Built-in authorization support
  • Testing: Includes PowerShell and Shell scripts for testing

Best Practices

1. Clean Architecture

  • Clear separation of concerns
  • Dependency injection
  • Interface-based design

2. RESTful API Design

  • Consistent endpoint naming
  • Proper HTTP method usage
  • Standardized response formats

3. Error Handling

  • Custom exception types
  • Meaningful error messages
  • Global exception handling

4. Performance Optimization

  • Pagination support
  • Lazy loading for related entities
  • Efficient query optimization

5. Data Validation

  • Input validation
  • Business rule enforcement
  • Data consistency checks

API Endpoints

Students

GET /api/students/{id}         # Get student details
GET /api/students/{id}/report  # Generate student report
POST /api/students            # Create new student
PUT /api/students/{id}        # Update student
DELETE /api/students/{id}     # Delete student

Classes

GET /api/classes/{id} - Get class details
GET /api/classes - List all classes
POST /api/classes - Create new class
PUT /api/classes/{id} - Update class
DELETE /api/classes/{id} - Delete class

Enrollments

POST /api/enrollments - Create new enrollment
GET /api/enrollments/{id} - Get enrollment details
GET /api/enrollments/student/{studentId} - Get student enrollments
GET /api/enrollments/class/{classId} - Get class enrollments

Marks

POST /api/marks                                # Record marks for a student
GET /api/classes/{classId}/average-marks       # Calculate average marks for a class
GET /api/students/{studentId}/marks            # Get marks for a specific student

About

A modern, high-performance .NET-based Student Enrollment System API built with Clean Architecture principles and Domain-Driven Design patterns.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published