A comprehensive ASP.NET Core MVC web application for managing students, courses, and branches in educational institutions.
- β Student Management - Full CRUD operations for students
- β Course Management - Create and manage academic courses
- β Branch Management - Handle different educational branches
- β Relationships - Establish connections between students, courses, and branches
- π Repository Pattern - Clean separation of data access layer
- π― Service Layer - Business logic separation
- π Dependency Injection - Proper dependency management
- π¨ Bootstrap UI - Responsive and modern user interface
- π Security - Anti-forgery tokens and input validation
- π Entity Framework Core - ORM with SQL Server
- π Migrations - Database version control
- π Logging - Comprehensive application logging
- β‘ Caching - Memory caching for performance
- π‘ Exception Handling - Global error handling middleware
- π§ͺ Testable Design - Built with unit testing in mind
- Backend: ASP.NET Core 8.0 MVC
- Frontend: Bootstrap 5.3, Font Awesome
- Database: SQL Server with Entity Framework Core
- Architecture: Repository Pattern, Service Layer, Dependency Injection
- Security: Anti-Forgery Tokens, Input Validation
StudentManagementSystem/
βββ Controllers/ # MVC Controllers
βββ Models/ # Entity Models
βββ Views/ # Razor Views
βββ Services/ # Business Logic Layer
βββ Interfaces/ # Repository Contracts
βββ Repositories/ # Data Access Layer
βββ Context/ # DbContext Configuration
βββ Middlewares/ # Custom Middlewares
βββ wwwroot/ # Static Files
Id(PK, Identity)Name(Required, NVARCHAR(100))Address(Nullable)CreatedAt(DateTime)CourseId(FK)BranchId(FK)
Id(PK, Identity starting from 100, increment by 100)Title(Required, NVARCHAR(50))CreatedAt(DateTime)BranchId(FK)
Id(PK, Identity starting from 1001)Title(Required, NVARCHAR(50))Location(Required, NVARCHAR(100))
- Student M:1 Course - Many students can belong to one course
- Student M:1 Branch - Many students can belong to one branch
- Course 1:1 Branch - One course belongs to one branch
- .NET 8.0 SDK
- SQL Server
- Visual Studio 2022 or VS Code
-
Clone the repository
git clone https://github.com/NadaAshraf12/StudentManagementSystem.git cd StudentManagementSystem -
Configure database connection Update
appsettings.jsonwith your SQL Server connection string:"ConnectionStrings": { "DefaultConnection": "Server=your-server;Database=StudentManagementDB;Trusted_Connection=true;" }
-
Run database migrations
dotnet ef database update
-
Run the application
dotnet run
-
Access the application Navigate to
https://localhost:7000
- Manage Branches: Create educational branches with locations
- Manage Courses: Set up courses and assign to branches
- Manage Students: Add students with course and branch assignments
- View Relationships: See how entities are connected
GET /Student- List all studentsGET /Student/Create- Create student formPOST /Student/Create- Create new studentGET /Student/Edit/{id}- Edit student formPOST /Student/Edit/{id}- Update studentGET /Student/Delete/{id}- Delete confirmationPOST /Student/Delete/{id}- Delete student
GET /Course- List all courses with student countsGET /Course/Create- Create course formPOST /Course/Create- Create new courseGET /Course/Edit/{id}- Edit course formPOST /Course/Edit/{id}- Update courseGET /Course/Delete/{id}- Delete confirmationPOST /Course/Delete/{id}- Delete course
GET /Branch- List all branchesGET /Branch/Create- Create branch formPOST /Branch/Create- Create new branchGET /Branch/Edit/{id}- Edit branch formPOST /Branch/Edit/{id}- Update branchGET /Branch/Delete/{id}- Delete confirmation (with safety checks)POST /Branch/Delete/{id}- Delete branch (if no students)
public interface IStudentRepository
{
Task<IEnumerable<Student>> GetAllAsync();
Task<Student> GetByIdAsync(int id);
Task<Student> AddAsync(Student student);
Task<Student> UpdateAsync(Student student);
Task DeleteAsync(int id);
}public interface IStudentService
{
Task<IEnumerable<Student>> GetAllStudentsAsync();
Task<Student> GetStudentByIdAsync(int id);
Task<Student> CreateStudentAsync(Student student);
Task<Student> UpdateStudentAsync(Student student);
Task DeleteStudentAsync(int id);
}// Program.cs
builder.Services.AddScoped<IStudentRepository, StudentRepository>();
builder.Services.AddScoped<IStudentService, StudentService>();{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"ConnectionStrings": {
"DefaultConnection": "Server=.;Database=StudentManagementDB;Trusted_Connection=true;"
}
}The application is built with testability in mind:
- Repository pattern allows mocking data access
- Service layer enables business logic testing
- Dependency injection supports unit testing
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - 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.md file for details.
-NadaAshraf12 - GitHub Profile
- ASP.NET Core Team
- Bootstrap Team
- Entity Framework Core Team
β Star this repo if you find it helpful!
If you have any questions or need help with setup, please open an issue on GitHub.
Happy Coding! π