JobCandidateHub is a .NET-based web application that provides an API for storing and managing job candidate information. The application supports adding and updating candidate details, with potential for future extension to store a large volume of candidate data.
This project is part of an interview test task.
- Add or update candidate information via REST API.
- Validate candidate data, including email format, time interval format, and URLs.
- Cache candidate data for improved performance.
- Unit tests to ensure functionality and correctness.
- .NET 8
- Entity Framework Core
- SQLite
- In-Memory Cache
- xUnit
- Swagger for API documentation
-
Clone the repository:
git clone https://github.com/tigyijanos/JobCandidateHub.git cd JobCandidateHub
-
Build the project:
dotnet build
-
Run the database migrations:
dotnet ef database update
- To run the application, use the following command:
dotnet run --project JobCandidateHub
- The application will start, and Swagger UI will be available at http://localhost:5276/swagger.
- Upsert Candidate
- URL: POST /api/candidates
- Description: Add or update candidate information.
- json:
{ "firstName": "John", "lastName": "Doe", "phoneNumber": "123-456-7890", "email": "john.doe@example.com", "bestTimeToCall": "09:00-17:00", "linkedInProfile": "https://www.linkedin.com/in/johndoe", "gitHubProfile": "https://github.com/johndoe", "comments": "Great candidate" }
- 200 OK: Candidate information added or updated successfully.
- 400 Bad Request: Validation error.
- First Name: Required
- Last Name: Required
- Email: Required, valid email format
- Best Time to Call: Valid time interval (HH:mm-HH ), start time should be before end time, within 24 hours.
- LinkedIn Profile: Optional, valid URL
- GitHub Profile: Optional, valid URL
- Comments: Required
To run the unit tests, use the following command:
dotnet test
JobCandidateHub
├── Controllers
│ └── CandidatesController.cs
├── Data
│ └── CandidateDbContext.cs
├── Models
│ └── Candidate.cs
├── Services
│ ├── CandidateService.cs
│ ├── ICandidateService.cs
│ ├── IValidationService.cs
│ ├── ValidationService.cs
├── Validators
│ └── TimeIntervalAttribute.cs
├── Properties
│ └── launchSettings.json
├── appsettings.json
├── Program.cs
├── JobCandidateHub.http
README.md
JobCandidateHub.Tests
├── Controllers
│ └── CandidatesControllerTests.cs
├── Services
│ ├── CandidateServiceTests.cs
│ ├── ValidationServiceTests.cs
├── Validators
│ └── TimeIntervalAttributeTests.cs
└── SequentialTestsCollection.cs
- Implement authentication and authorization.
- Add more detailed logging.
- Implement pagination for fetching candidate lists.
- Extend API to support bulk operations.
- Optimize database queries for large data sets.
Contributions are welcome! Please create a pull request or submit an issue for any feature requests or bugs.
This project is licensed under the MIT License - see the LICENSE file for details