How belalbeb/graduation_project works
1. Overall shape
- This repository is an ASP.NET Core backend API for a graduation project that looks like a job/recruitment platform.
- The codebase follows a clear layered pattern: Controllers → Services → Repositories → Entity models / EF Core DbContext.
- API contracts are separated into a large Dtos layer, which is used to keep request/response payloads distinct from persistence models.
2. Primary business domains
- The main functional areas are:
- Auth / user management
- Applicant profiles
- Company profiles and settings
- Job postings
- Applications and saved jobs
- Interviews
- Subscriptions / plans / coupons
- Admin analytics and moderation
- Website settings
- The number of domain-specific controllers and services suggests the system supports both applicant-facing and company-facing workflows, plus an admin layer.
3. HTTP API layer
- The Controllers folder contains the outward-facing endpoints.
- Controllers are split by feature, such as ApplicantController, CompanyController, JobPostingController, InterviewController, SubscriptionController, AdminController, and AuthController.
- This layer is likely thin: it receives requests, validates/forwards data, and delegates business logic to services.
4. Application/service layer
- The Services folder contains the core business rules and orchestration.
- There are feature services for applicants, companies, job postings, resumes, interviews, subscriptions, settings, and admin operations.
- Several service interfaces exist alongside implementations, indicating explicit dependency injection and a maintainable separation between contract and implementation.
- This layer is where workflows like “apply for a job”, “schedule interview”, “update company settings”, or “expire subscriptions” are coordinated.
5. Persistence and data access
- The Repositories folder contains the data-access boundary.
- Each major entity/domain has a repository interface and implementation, including applicants, applications, companies, interviews, jobs, resumes, saved jobs, subscriptions, settings, and website settings.
- Models/ApplicationDbContext.cs is the EF Core database context, and the large Migrations folder confirms Entity Framework Core is the persistence engine.
- The architecture is therefore: service logic does not talk to the database directly; it goes through repositories backed by EF Core.
6. Domain model
- The Models folder contains the persistent entities used by EF Core.
- Key entities include Applicant, Company, Application, JobPosting, Interview, Resume, Project, Experience, Skill, SubscriptionPlan, CompanySubscription, Coupon, SavedJobs, WebsiteSettings, and various supporting entities.
- There is also an ApplicationUser model and Roles, indicating authentication/authorization is integrated into the domain model rather than being external.
7. API contract and DTO design
- The Dtos folder is extensive and organized by feature and consumer.
- There are dedicated DTOs for:
- public job cards and profiles,
- applicant/company details,
- admin dashboards,
- interview scheduling and updates,
- subscription flows,
- settings/profile editing,
- filter/search operations.
- This indicates the API is designed to serve multiple UI surfaces with tailored payloads rather than exposing entities directly.
8. Cross-cutting concerns
- Middlewares/ExceptionMiddleware.cs provides centralized exception handling.
- Exceptions contains custom exception types such as bad request, not found, unauthorized, and a base custom exception.
- Responses/ErrorResponse.cs suggests standardized API error payloads.
- This means error handling is handled as a platform concern, not repeated in each controller.
9. Background processing
- BackgroundJobs/SubscriptionExpirationJob.cs shows the project includes an asynchronous maintenance task.
- Its purpose appears to be subscription lifecycle management, likely checking and expiring company subscriptions on a schedule.
- This is an important architectural boundary because it handles time-based business logic outside of request/response traffic.
10. External integrations
- Services/CloudinaryService.cs and Configurations/CloudinarySettings.cs show integration with Cloudinary for file/image storage, likely for profile photos, resumes, logos, or documents.
- Services/EmailService.cs indicates outbound email notifications, probably for verification, account actions, or interview/subscription events.
- These are the main external service boundaries visible in the repository.
11. Authentication, authorization, and identity
- The presence of ApplicationUser, CustomClaims, auth-related DTOs, and AuthController indicates the system likely uses ASP.NET Core Identity or a similar identity setup.
- Seeds/RoleSeeder.cs, UserSeeder.cs, and UserRoleSeeder.cs imply roles and initial users are bootstrapped into the system.
- Authorization is probably role-based, separating applicants, companies, and admins.
12. Initialization and test data
- The Seeds folder contains seeders for applicants, companies, jobs, interviews, resumes, skills, applications, saved jobs, roles, and users.
- Seeds/SeederRunner.cs suggests a coordinated startup seed process.
- This is important for architecture because it means the application can initialize a realistic dataset and role structure on startup or during deployment.
13. Admin and reporting subsystem
- AdminController plus admin-specific DTOs and Services/AdminServices.cs point to a distinct admin management plane.
- The admin side appears to cover dashboards, applicant/company summaries, job overviews, statistics, and likely moderation or verification review.
- This is a separate concern from the normal applicant/company workflows and should be shown as its own subsystem in a diagram.
14. Runtime, deployment, and tooling
- The repo is a .NET solution (Graduation_Project.sln) with a Dockerfile and .http request file for local API testing.
- Program.cs is the composition root where dependency injection, middleware, EF Core, and hosted/background services are likely wired together.
- The migration history shows the database schema is managed through EF Core migrations rather than handcrafted SQL.
15. Primary request/data flow to diagram
- Typical flow: client → controller → service → repository → DbContext/SQL database.
- For file/email/async operations, the service layer branches out to Cloudinary and EmailService.
- For scheduled lifecycle actions, the background job works against the same subscription data model.
- For startup state, seeders populate the database before normal traffic begins.
Main entry points: Repositories Repositories · Program.cs Program · ApplicationDbContext.cs App DbContext · Services Services
Components 20
API layer
HTTP controllers and request/response contracts
- Controllers · Feature controllers for auth, applicants, companies, jobs, applications, interviews, subscriptions, admin, and settings
Controllers - DTOs · Request/response shapes for public, company, applicant, interview, subscription, and admin flows
Dtos
Application layer
Business services and orchestration
- Services · Core workflows and orchestration for platform features
Services - Auth & users · Authentication, registration, claims, and role-aware user flows
Services/SubscriptionService.cs - Profiles · Applicant, company, resume, project, skill, and experience management
Services/ProfileService.cs - Jobs & apps · Job postings, applications, saved jobs, and matching workflows
Services/JobPostingService.cs - Interviews · Interview creation, updates, and company interview workflows
Services/InterviewService.cs - Subscriptions · Plans, company subscriptions, coupons, and lifecycle management
Services/SubscriptionService.cs - Admin · Dashboards, moderation, statistics, and back-office operations
Services/AdminServices.cs - Settings · Website and company configuration plus profile settings
Services/SettingsServices.cs
Persistence layer
EF Core models, repositories, and database context
- App DbContext · EF Core unit of work over the application database
Models/ApplicationDbContext.cs - Models · Persisted users, applicants, companies, jobs, applications, interviews, subscriptions, and settings
Models - Migrations · EF Core schema evolution and snapshot history
Migrations - Repositories · Persistence boundary for applicants, jobs, interviews, subscriptions, settings, profiles, and admin data
Repositories
Infrastructure
Cross-cutting concerns, integrations, background jobs, and startup
- Program · Wires DI, middleware, EF Core, and hosted services
Program.cs - Exception middleware · Centralized API error handling and response normalization
Middlewares/ExceptionMiddleware.cs - Custom errors · Domain and HTTP exception types plus standardized error payloads
Exceptions - External services · Cloudinary file storage and email delivery
Services/CloudinaryService.cs - Subscription job · Scheduled expiration processing for company subscriptions
BackgroundJobs/SubscriptionExpirationJob.cs - Seeders · Initial users, roles, and sample domain data for startup and testing
Seeds/SeederRunner.cs
Connections 23
- Program → Controllers: hosts · Registers controllers into the HTTP pipeline
- Program → Exception middleware: adds · Enables centralized exception handling
- Program → App DbContext: configures · Connects EF Core to the database
- Program → Services: injects · Registers application services for DI
- Program → Repositories: injects · Registers repositories for DI
- Program → Seeders: runs · Bootstraps initial data and roles
- Controllers → DTOs: uses · Accepts and returns feature-specific payloads
- Controllers → Services: delegates · Forwards feature requests to business services
- Exception middleware → Custom errors: maps · Converts exceptions to standardized API responses
- Services → Repositories: reads/writes · Uses repositories as the persistence boundary
- Services → External services: integrates · Uploads files and sends emails
- Subscription job → Subscriptions: invokes · Executes scheduled subscription-expiration logic
- Seeders → App DbContext: populates · Loads initial data into the database
- Repositories → App DbContext: queries · Implements EF Core data access through the context
- App DbContext → Models: tracks · Maps and persists domain entities
- App DbContext → Migrations: evolves · Schema changes are captured as EF Core migrations
- Auth & users → Repositories: auth data · Coordinates user and role persistence
- Profiles → Repositories: profile data · Manages applicant and company profile records
- Jobs & apps → Repositories: job data · Manages postings, applications, and saved jobs
- Interviews → Repositories: interview data · Schedules and updates interview records
- Subscriptions → Repositories: billing data · Manages plans, subscriptions, and coupons
- Admin → Repositories: admin data · Builds dashboards and moderation views from persisted data
- Settings → Repositories: settings data · Updates website and company configuration