Educational System is a comprehensive backend Web API designed for an online learning platform. Built with .NET 9, it provides robust features for managing courses, instructors, students, enrollments, and learning progress. The application utilizes modern architecture patterns and best practices, including N-Layer architecture, Repository Pattern, and JWT Authentication.
-
User Management:
- Secure Authentication & Authorization using ASP.NET Core Identity.
- JWT Bearer token-based authentication.
- Role-based access control (Admin, Instructor, Student).
- Automatic seeding of default users and roles.
-
Course Management:
- CRUD operations for Courses, Categories, and Specializations.
- Instructor assignment and management.
- Discount management for courses.
-
Content Delivery:
- Hierarchical content structure: Courses -> Lessons -> SubLessons.
- Support for various question types and assessments (quizzes, assignments).
-
Student Engagement:
- Course Enrollment system.
- Progress tracking (Lesson completion, Prerequisites).
- Submissions (File and Text) for assignments.
-
Performance & Infrastructure:
- Redis caching for high-performance data retrieval.
- Serilog for structured logging (Console and File).
- Entity Framework Core with SQL Server.
- AutoMapper for efficient object mapping.
- MailKit for email services.
- Swagger UI for API documentation and testing.
- Framework: .NET 9.0 Web API
- Language: C#
- Database: SQL Server
- ORM: Entity Framework Core 8
- Caching: Redis (StackExchange.Redis)
- Logging: Serilog
- Mapping: AutoMapper
- Documentation: Swashbuckle (Swagger)
- Email: MailKit
The solution follows a clean N-Layer Architecture:
- Educational_System (API): The entry point, containing Controllers, DTOs, and Configuration.
- EducationalSystem.BLL (Business Logic Layer): Contains Services, Repositories, and business rules.
- EducationalSystem.DAL (Data Access Layer): Contains Database Context, Entity Models, and Migrations.
Before running the application, ensure you have the following installed:
- .NET 9.0 SDK
- SQL Server (LocalDB or Full instance)
- Redis (Running on
localhost:6379)
git clone https://github.com/yourusername/Educational_System.git
cd Educational_SystemUpdate the connection string in Educational_System/appsettings.json (or appsettings.Development.json) to point to your SQL Server instance.
"ConnectionStrings": {
"DB1": "Server=.;Database=EducationalSystemDb;Trusted_Connection=True;TrustServerCertificate=True;"
}Ensure Redis is running locally on the default port (6379). If your Redis setup is different, update the configuration in Program.cs:
builder.Services.AddStackExchangeRedisCache(options =>
{
options.Configuration = "localhost:6379";
});The application is configured to automatically apply migrations and seed data on startup. You can also manually update the database using the CLI:
cd Educational_System
dotnet ef database update --project ../EducationalSystem.DALdotnet runThe API will start, and you can access the Swagger UI at:
http://localhost:5088/swagger/index.html(or the port configured in launchSettings.json)
The API is fully documented using Swagger. Once the application is running, navigate to /swagger to explore the endpoints, test requests, and view the data models.
Educational_System/
├── EducationalSystem.BLL/ # Business Logic (Repositories, Interfaces)
├── EducationalSystem.DAL/ # Data Access (DbContext, Models, Migrations)
├── Educational_System/ # Web API (Controllers, DTOs, Program.cs)
├── Educational_System.sln # Solution File
└── README.md # Project Documentation
Contributions are welcome! Please fork the repository and submit a Pull Request.