CareerCloud Web API is a RESTful service built using ASP.NET Core, providing endpoints for managing applicant profiles, job applications, resumes, and various other career-related entities. This project uses Entity Framework for data access, a generic repository pattern for CRUD operations, and includes Swagger for API documentation and testing.
- Applicant Education Management
- Job Application Management
- Resume Management
- Company Job Management
- Security and Roles Management
- .NET 6 or higher
- Docker (for containerization)
git clone https://github.com/your-repo/careercloud-webapi.git
cd careercloud-webapiMake sure you have Docker and .NET SDK installed. Then, restore the dependencies:
dotnet restoreTo run the project using Docker, you need to build the Docker image. Make sure you have Docker installed and running on your machine.
- Build the Docker image:
docker build -t careercloud-api .- Run the container:
docker run -d -p 5000:80 careercloud-apiThis will run the API inside a Docker container, exposing it on port 5000.
To ensure all tests are passing, you can run the tests via Visual Studio Test Explorer or use the command line.
dotnet testAll tests should pass successfully. If any issues arise, ensure that the project has been properly built and dependencies are correctly restored.
Once the application is running, you can access the Swagger UI to test the API. Navigate to:
http://localhost:5000/swagger
The Swagger UI provides an interactive interface where you can test various API endpoints. You can make requests and check the responses for all endpoints such as Applicant Education, Applicant Profile, Company Job, etc.
While interacting with the Applicant Education API through Swagger, you may encounter an issue when trying to get the ID due to a conflict with two constructors in the ApplicantEducationPoco class.
This issue happens because the class has more than one constructor that can be invoked, causing ambiguity when trying to fetch or manipulate the ID. To resolve this issue, ensure that Swagger uses the correct constructor by adjusting the class or adding annotations like JsonConstructor to specify which constructor should be used.
For example:
[JsonConstructor]
public ApplicantEducationPoco(Guid id, string name, string description)
{
Id = id;
Name = name;
Description = description;
}- Swagger ID Conflict: When testing the
ApplicantEducationendpoint, a conflict may occur due to multiple constructors in theApplicantEducationPococlass. This issue can be resolved by using theJsonConstructorattribute on the correct constructor to inform Swagger which constructor to use.
If you're facing issues while building, running tests, or with Docker, here are a few tips:
- Ensure that Docker is properly installed and running. Check the status with
docker --version. - Make sure the database connection string in
appsettings.jsonis correctly configured. - If tests fail, try running them individually to isolate the issue:
dotnet test path/to/test
For any further assistance, feel free to raise an issue on the GitHub repository.
MIT License. See the LICENSE file for more details.