This project provides an API for subscribing to job notifications and querying job listings based on user preferences.
- Swagger/OpenAPI Documentation: Documentation for the API endpoints.
- Docker
- Docker Compose
- Go 1.22
- Postgresql
If you need to configure specific environment variables, create a .env file in the root directory with the following variables (See .env_example)
To bring up your application containers, use the following command:
docker compose up --build
This command builds the Docker images according to the Dockerfile and docker-compose.yml files in the project and starts the necessary containers.
Method: POST
Path: /V1/subscribe
Description: Allows a user to subscribe to job notifications.
{
"name": "John Doe",
"email": "john.doe@example.com",
"job_titles": ["Full Stack Developer"],
"country": ["Argentina"],
"salary_min": 50000
}
{
"id": "uuid",
"name": "John Doe",
"timestamp": "2024-08-27T12:00:00Z",
"message": "Subscription created successfully"
}
400 Bad Request
422 Validation Error
500 Internal Server Error
Method: GET
Path: /V1/jobs
Description: Retrieves job listings based on user preferences and query parameters.
id (optional): User ID.
posted_date (optional): Job posted date.
job_titles (optional): List of job titles.
country (optional): List of preferred countries.
{
"internal_jobs": ["uuid1", "uuid2"],
"external_jobs": [
{
"title": "Full Stack Developer",
"salary": 58000,
"skills": {
"skills": ["JavaScript", "Node.js", "React"]
}
}
]
}
Errors:
400 Bad Request
422 Validation Error
500 Internal Server Error
Check openpi.yml file
Use tools like curl, Postman, or Swagger UI to send requests to the endpoints and verify the API functionality.
I'm using Pyroscope to show metrics:
- Run and go to http://localhost:4040/
Also there is a Benchmark task running in 1 of the GH actions (using pprof)
You can view the logs of the containers with:
docker compose logs -f