JobMagnetic is a platform designed to revolutionize how professionals manage and showcase their career profiles. This repository contains the C# backend application that powers the entire ecosystem. It provides a robust and scalable RESTful API for profile management, AI-driven CV parsing, and all core data handling, built with .NET and Clean Architecture principles.
This backend enables the following key platform features:
- AI-Powered CV Parsing: Intelligently extracts key information from user-provided CV files to automatically build and populate professional profiles.
- Comprehensive Profile Management: Exposes full CRUD (Create, Read, Update, Delete) operations for all domain entities.
- Public Profile Generation: Provides all necessary data endpoints for front-end applications to render elegant and optimized public-facing professional sites.
- Secure & Versioned API: A well-defined RESTful API with versioning to ensure stable and predictable interactions.
Core Stack:
- C# & .NET 9.0
- ASP.NET Core (for RESTful APIs)
- Entity Framework Core (for data access and migrations)
- MS SQL Server
API & Framework Libraries:
Asp.Versioning.Mvc(for API versioning)FastAdapter.Adaptor(for high-performance object mapping)
Development & Build:
- .NET SDK 9.0
- JetBrains Rider / Visual Studio / VS Code
The project adheres to a Clean Architecture approach, promoting a clear separation of concerns which enhances maintainability, scalability, and testability.
-
Domain Layer (
JobMagnet.Domain): Contains the core business logic: entities (e.g.,ProfileEntity), value objects, and domain-specific interfaces (e.g.,ICommandRepository,IUnitOfWork). It has no dependencies on other layers. -
Application Layer (
JobMagnet.Application): Orchestrates the application's use cases (features). Contains command/query handlers, DTOs, mappers, and application-level service interfaces. Depends on the Domain layer. -
Infrastructure Layer (
JobMagnet.Infrastructure): Provides concrete implementations for interfaces defined in the layers above. This includes data persistence logic (EF CoreDbContext, Repositories) and integrations with external services (e.g.,GeminiRawCvParserfor CV parsing). -
Presentation Layer (
JobMagnet.Host): Exposes the API endpoints using ASP.NET Core Controllers. It handles the HTTP lifecycle, request validation, authentication, and serialization. This is the entry point of the application. -
Shared Layer (
JobMagnet.Shared): Contains common utilities and extensions that can be used across multiple layers without introducing unwanted dependencies.
The solution is organized into the following key projects, located under the sources and tests directories:
sources/JobMagnet.Domain/: Core business entities and domain interfaces.sources/JobMagnet.Application/: Application logic, use cases (commands/queries), and DTOs.sources/JobMagnet.Infrastructure/: Data access (EF Core), repository implementations, and third-party services.sources/JobMagnet.Host/: ASP.NET Core API project, controllers, and startup configuration.sources/JobMagnet.Shared/: Shared utilities and extensions.tests/: Contains all unit, integration, and shared test projects.
- .NET SDK 9.0
- An IDE like JetBrains Rider, Visual Studio, or VS Code.
- A local or remote MS SQL Server instance.
- dotnet-ef tools installed globally.
-
Clone the repository:
git clone https://github.com/henksandoval/JobMagnetic-BackEnd.git cd JobMagnetic-BackEnd -
Restore NuGet packages:
dotnet restore JobMagnet.sln
-
Configure Database Connection:
- In
sources/JobMagnet.Host/, renameappsettings.Example.jsontoappsettings.Development.json. - Update the
DefaultConnectionstring with your database details. Example for LocalDB:"ConnectionStrings": { "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=JobMagnetDB;Trusted_Connection=True;MultipleActiveResultSets=true" }
- In
-
Apply Database Migrations:
Note: Because our
DbContextlives inInfrastructureand our configuration lives inHost, you must specify both projects when running EF Core commands from the solution root.# Create a new migration dotnet ef migrations add InitialDb --project sources/JobMagnet.Infrastructure --startup-project sources/JobMagnet.Host # Apply migrations to the database dotnet ef database update --project sources/JobMagnet.Infrastructure --startup-project sources/JobMagnet.Host
-
Build the project:
dotnet build JobMagnet.sln
-
(Optional) Populate the database with sample data:
-
To fill the database with sample data, send
POSTrequests to theAdminControllerendpoints. You can usecurlas shown below, or tools like Postman or the Swagger UI.Execute the following
curlcommands:# To seed master tables curl -X POST 'https://localhost:7109/api/v0.1/admin/seedmastertables' \ -H 'accept: */*' \ -d '' # To seed sample profiles curl -X POST 'https://localhost:7109/api/v0.1/admin/seedprofile' \ -H 'accept: */*' \ -d ''
-
These requests will trigger the seeding logic defined within the
JobMagnet.Hostproject. The Swagger UI is typically available at/swaggerif your project is configured for it.
-
- Navigate to the Host project directory:
cd sources/JobMagnet.Host - Run the application:
Alternatively, you can run
dotnet run
JobMagnet.Hostdirectly from your IDE.
The API will typically be accessible at:
https://localhost:7XXX(HTTPS)http://localhost:5XXX(HTTP)
Check the console output from JobMagnet.Host for the exact ports.
Once the application is running, the interactive Swagger UI is available at:
https://localhost:7109/swagger/index.html
Use the Swagger UI or the curl commands below to populate the database with initial data.
# To seed master tables (e.g., skills, languages)
curl -X POST 'https://localhost:7109/api/v0.1/admin/seedmastertables'
# To seed a sample profile for testing
curl -X POST 'https://localhost:7109/api/v0.1/admin/seedprofile'Run these commands from the root directory of the solution.
-
Run all tests:
dotnet test JobMagnet.sln --no-build -
Generate a coverage report (HTML):
- First, install the report generator tool:
dotnet tool install --global dotnet-reportgenerator-globaltool
- Run tests and generate the report in one step:
dotnet test JobMagnet.sln --collect:"XPlat Code Coverage" reportgenerator -reports:"**/TestResults/**/coverage.cobertura.xml" -targetdir:"coverage_report" -reporttypes:Html
This creates a detailed HTML report in the
coverage_reportdirectory. - First, install the report generator tool:
We welcome contributions! Whether it's fixing bugs, adding features, or improving documentation, your help is appreciated. Please feel free to fork the repository and submit a pull request.
This project is licensed under the MIT License - see the LICENSE.md file for details.
For the Spanish version, click here.