How mohamedahmed2005/skillmatcher works
1. Purpose and runtime entry point
SkillMatch is a .NET 8 ASP.NET Core REST API for recruitment: candidates manage profiles/CVs, employers manage job postings, and matching combines skills with AI CV analysis. Startup, dependency injection, middleware, authentication, EF Core, and API documentation are composed in SkillMatch.API/SkillMatch.API/Program.cs; HTTP entry points are in SkillMatch.API/SkillMatch.API/Controllers/.
2. HTTP and application boundary
Controllers are the API boundary and should remain thin, delegating work to service contracts and exchanging DTOs rather than entities:
• Authentication: Controllers/AuthController.cs
• Candidate profile/CV workflows: Controllers/ProfilesController.cs
• Job search and employer job management: Controllers/JobsController.cs
• Recommendations and CV-vs-job analysis: Controllers/MatchingController.cs
DTOs separate request/response payloads from the domain, notably Core/DTOs/Auth/, Core/DTOs/Jobs/, and Core/DTOs/Matching/. Global error translation is centralized in Middlewares/ExceptionHandlingMiddleware.cs.
3. Domain model
Core recruitment state is modeled independently of infrastructure. All entities share ID and audit fields through Core/Entities/Base/BaseEntity.cs. Principal aggregates are users/profiles, jobs, skills, resumes, and applications:
• Core/Entities/ApplicationUser.cs
• Core/Entities/CandidateProfile.cs
• Core/Entities/CompanyProfile.cs
• Core/Entities/JobPosting.cs
• Core/Entities/ResumeDocument.cs
• Core/Entities/Skill.cs
• Core/Entities/JobApplication.cs
Roles, application state, and experience levels are explicit domain enums under Core/Enums/.
4. Authentication and authorization
The API uses custom JWT access/refresh tokens rather than ASP.NET Core Identity. Infrastructure/Services/AuthService.cs implements the authentication workflow behind Core/Interfaces/Services/IAuthService.cs; token construction/validation support is in Helpers/JwtHelper.cs. Role-based authorization distinguishes Candidate, Employer, and Admin via Core/Enums/UserRole.cs. Auth configuration and signing secrets are runtime configuration in appsettings.json.
5. Business services and matching pipeline
Service contracts isolate controller workflows from persistence and provider details:
• Candidate/profile and CV upload: Core/Interfaces/Services/ICandidateService.cs, implemented by Infrastructure/Services/CandidateService.cs.
• Job creation, updates, listings, and filtering: Core/Interfaces/Services/IJobService.cs, implemented by Infrastructure/Services/JobService.cs.
• Resume ingestion: uploaded document → storage → PDF text/skill extraction via Infrastructure/Services/PdfCvParserService.cs.
• Matching: candidate skills support recommendations; CV text plus job description is sent through Core/Interfaces/Services/IAiMatchingService.cs to yield Core/DTOs/Matching/MatchResultDto.cs.
6. Persistence architecture
EF Core persists the domain to SQL Server through Infrastructure/Data/ApplicationDbContext.cs, with schema history under Migrations/. Services access persistence through repository and unit-of-work abstractions, not the DbContext directly:
• Contracts: Core/Interfaces/Repositories/IGenericRepository.cs, Core/Interfaces/Repositories/IUnitOfWork.cs
• Generic and specialized query implementations: Infrastructure/Repositories/GenericRepository.cs, Infrastructure/Repositories/CandidateRepository.cs, Infrastructure/Repositories/JobRepository.cs
• Transaction/save boundary: Infrastructure/Repositories/UnitOfWork.cs
This creates the key boundary: controllers → services → repository interfaces/unit of work → EF Core/SQL Server.
7. External-provider adapters and deployment dependencies
Files are stored behind Core/Interfaces/Services/IFileStorageService.cs; implementations permit local filesystem or Azure Blob Storage: Infrastructure/Services/LocalFileStorageService.cs and Infrastructure/Services/AzureBlobStorageService.cs. AI matching is similarly replaceable between Google Gemini and OpenAI: Infrastructure/Services/GeminiAiService.cs and Infrastructure/Services/OpenAiService.cs. These providers use configured credentials/endpoints and are selected through DI at startup. Material runtime dependencies are .NET 8, SQL Server, configured JWT keys, AI API credentials, and optionally Azure Blob Storage.
Main entry points: Program.cs Startup & DI
Components 18
API Host
- Startup & DI · Composes middleware, auth, EF Core, services, and provider implementations.
SkillMatch.API/SkillMatch.API/Program.cs - REST Controllers · Auth, profiles, jobs, and matching endpoints delegate to service contracts.
- Exception Middleware
Core Domain
- API DTOs
- Recruitment Aggregates · Users, profiles, jobs, resumes, skills, and applications share audited base state.
- Roles & States · Candidate, Employer, and Admin authorization roles plus recruitment states.
- Repository Contracts · Service-facing persistence and transaction boundary.
Application Services
- Authentication Service · Authenticates users and issues custom JWT access and refresh tokens.
- Candidate & CV Service · Manages candidate profiles and CV upload workflows.
- Job Service · Creates, updates, lists, and filters job postings.
- Matching Service Contract · Produces CV-versus-job analysis and match results through a replaceable AI adapter.
Infrastructure
- PDF CV Parser · Extracts text and skills from uploaded PDF CVs.
- File Storage Adapter · DI selects local filesystem or Azure Blob Storage.
- Repositories & Unit of Work · Generic and specialized repositories execute queries and commits.
- EF Core DbContext · Maps domain state and migrations to SQL Server.
External Dependencies
- SQL Server
- AI Provider · DI selects the configured AI matching implementation.
- Azure Blob Storage
Connections 23
- Startup & DI → REST Controllers: hosts
- Startup & DI → Exception Middleware: registers
- Startup & DI → Authentication Service: wires
- Startup & DI → Candidate & CV Service: wires
- Startup & DI → Job Service: wires
- Startup & DI → Matching Service Contract: selects implementation
- REST Controllers → API DTOs: exchanges
- REST Controllers → Authentication Service: auth workflows
- REST Controllers → Candidate & CV Service: profile and CV workflows
- REST Controllers → Job Service: job workflows
- REST Controllers → Matching Service Contract: recommendations and analysis
- Authentication Service → Roles & States: authorizes by
- Candidate & CV Service → PDF CV Parser: parses uploaded CV
- Candidate & CV Service → File Storage Adapter: stores document
- Candidate & CV Service → Repository Contracts: persists through
- Job Service → Repository Contracts: persists through
- Matching Service Contract → AI Provider: sends CV text and job description
- Matching Service Contract → Repository Contracts: reads skills and jobs
- Repository Contracts → Repositories & Unit of Work: implemented by
- Repositories & Unit of Work → EF Core DbContext: uses
- EF Core DbContext → Recruitment Aggregates: maps
- EF Core DbContext → SQL Server: persists to
- File Storage Adapter → Azure Blob Storage: optional backend