How sheikhsarim/online-aptitde-test works
Project type and purpose
• This is a full-stack web application built with ASP.NET Core MVC.
• Purpose: deliver an online aptitude testing platform with three user roles (Admin, Manager, Candidate), backed by a SQL Server database and Entity Framework Core.
File structure and architectural patterns
• Top-level folders:
• Controllers – MVC controllers for each role and test flow
• Models (and ViewModels) – domain entities (Admin, Manager, Candidate, Test, Question, Result, Role, UserRole) plus DTOs for views
• Views – Razor pages organized by controller (Account, Admin, Manager, Test, Shared, Home)
• Data – EF Core ApplicationDbContext + Migrations
• wwwroot – static assets (CSS, JS, libraries)
• Program.cs / launchSettings.json – application startup configuration
• Architectural pattern: classic layered MVC
• Presentation layer (Razor Views + static assets)
• Controller layer (HTTP endpoints, authentication, role checks)
• Domain/model layer (business objects)
• Data access layer (EF Core DbContext, Migrations)
• Cross-cutting concerns: authentication & authorization, password hashing (BCrypt.Net), configuration (appsettings.json)
Key insights from the README
• Roles & use cases: Admin manages managers; Manager manages candidates/questions/tests; Candidate takes tests & views results
• Tech stack: ASP.NET Core MVC, EF Core (SQL Server), Bootstrap + jQuery on frontend
Main components
a. Client (Browser)
• Renders Razor views + static assets (CSS, JS)
• Sends HTTP requests (GET/POST)
b. Web Server (ASP.NET Core MVC App)
• Presentation Layer: Razor Views (.cshtml) & wwwroot content
• Controllers:
• AccountController (login/register)
• AdminController (dashboard, manager CRUD)
• ManagerController (candidate & question/test management)
• TestController (test flow for candidates)
• HomeController (landing & privacy)
• Models & ViewModels: data structures passed between Controllers and Views
• Data Access Layer: ApplicationDbContext (EF Core)
• Migrations: code-first schema evolution
• Services & Middleware: authentication, authorization, configuration
c. Database (SQL Server)
• Stores Users, Roles, Tests, Questions, Results, etc.
• Accessed via EF Core
Relationships and data flows
• Browser → Web Server
• User requests pages or submits forms
• Web Server.Controllers → Data Access Layer
• Controllers invoke DbContext to query/update database
• Data Access Layer → SQL Server
• EF Core translates LINQ to SQL
• SQL Server → Web Server
• Data records returned to DbContext
• Web Server → Browser
• Razor Views render HTML + embed dynamic data
Important architectural patterns & principles
• MVC separation of concerns
• Layered architecture (Presentation → Business/Controllers → Data)
• Code-first migrations for database versioning
• Role-based access control enforced in Controllers
• Dependency injection for DbContext and configuration