School Management System - Clean Architecture Backend
SchoolManagement/
├── Domain/ # Domain Layer (Entities)
│ └── Entities/
│ └── Class.cs
│ └── Student.cs
├── Application/ # Application Layer (Business Logic)
│ ├── DTOs/
│ │ └── Dtos.cs
│ ├── Interfaces/
│ │ ├── IRepositories.cs
│ │ └── IServices.cs
│ └── Services/
│ └── Services.cs
├── Infrastructure/ # Infrastructure Layer (Data Access)
│ ├── Data/
│ │ └── ApplicationDbContext.cs
│ └── Repositories/
│ └── Repositories.cs
├── Presentation/ # Presentation Layer (Controllers)
│ └── Controllers/
│ └── Controllers.cs
├── Program.cs # Application Entry Point
├── appsettings.json
└── appsettings.Development.json
GET /api/classes - Get all classes
GET /api/classes/{id} - Get class details
POST /api/classes - Create new class
GET /api/students - Get all students
GET /api/students/{id} - Get student details
POST /api/students - Add new student
PUT /api/students/{id} - Update student
DELETE /api/students/{id} - Delete student
Domain Layer : Contains entities (Class, Student)
Application Layer : Contains business logic (Services), DTOs, and interfaces
Infrastructure Layer : Contains data access logic (DbContext, Repositories)
Presentation Layer : Contains API Controllers
Client (Postman)
↓
Controller (Presentation Layer)
↓
Service (Application Layer - Business Logic)
↓
Repository (Infrastructure Layer - Data Access)
↓
Database (In-Memory EF Core)
.NET 8.0 SDK
Visual Studio Code or Visual Studio
Navigate to project directory:
Restore dependencies:
Run the application:
Access Swagger UI at: https://localhost:5001/swagger
POST /api/classes
Content-Type: application/json
{
"name" : " 10A" ,
"description" : " Grade 10 Class A"
}
POST /api/students
Content-Type: application/json
{
"fullName" : " Nguyen Van A" ,
"email" : " nguyenvana@example.com" ,
"dateOfBirth" : " 2008-01-15" ,
"classId" : 1
}
PUT /api/students/{id}
Content-Type: application/json
{
"fullName" : " Nguyen Van A Updated" ,
"email" : " newemail@example.com" ,
"dateOfBirth" : " 2008-01-15" ,
"classId" : 1
}
DELETE /api/students/{id}
Column
Type
Description
Id
int (PK)
Class ID
Name
varchar
Class Name
Description
varchar
Class Description
Column
Type
Description
Id
int (PK)
Student ID
FullName
varchar
Student Full Name
Email
varchar
Student Email
DateOfBirth
date
Date of Birth
ClassId
int (FK)
Class Reference
Using EF Core In-Memory Database for data persistence
All relationships are configured with cascade delete
CORS is enabled for all origins
Swagger/OpenAPI documentation is available in development environment