This repository houses the backend service for a full-stack CV application, designed to serve as a personal website. Developed using Go 1.21, this REST API incorporates various technologies to deliver a robust and scalable solution. The frontend app can be found at cv-frontend-vuejs
- Postgres
- Docker
- Gin
- golang-migrate
- sqlc
- testify
- Viper
- gin cors
- gin-swagger
- Clone the repository
- Go to the project's root directory
- Rename
app.env.example
toapp.env
and replace the values - In the
Dockerfile
changePRODUCTION
tofalse
- Run in your terminal:
docker-compose up
to run the containers - Now everything should be ready and server running on
SERVER_ADDRESS
specified inapp.env
-
Run the containers (
docker-compose up
) -
Run in your terminal:
make test
to run all tests
or
make test_coverage p={PATH}
- to get the coverage in the HTML format - where{PATH}
is the path to the target directory for which you want to generate test coverage. The{PATH}
should be replaced with the actual path you want to use. For example./internal/api
or
- use standard
go test
commands (e.g.go test -v ./internal/api
)
All endpoints are available to test at http://localhost:8080/swagger/index.html after running the containers.
This endpoint is used to get the details of a CV profile with a provided ID.
id
(integer, required): The ID of the CV profile. This parameter is included in the path of the request.
200 OK
: The request was successful and the response body contains the CV profile details.400 Invalid ID
: The provided ID is invalid.404 CV profile with given ID does not exist
: There is no CV profile with the provided ID.500 Any other server-side error
: There was a server-side error while processing the request.
The endpoint produces responses in the application/json
format.
This endpoint is used to list projects for a CV profile with a provided ID and skill.
id
(integer, required): The ID of the CV profile. This parameter is included in the path of the request.skill
(string, required): The name of the skill. This parameter is included in the path of the request.page
(integer, required): The page number. This parameter is included in the query of the request.page_size
(integer, required): The page size. This parameter is included in the query of the request.
200 OK
: The request was successful and the response body contains a list of projects.400 Invalid ID, skill name, page or page size
: The provided ID, skill name, page or page size is invalid.404 CV profile with given ID or skill with given name does not exist
: There is no CV profile with the provided ID or no skill with the provided name.500 Any other server-side error
: There was a server-side error while processing the request.
The endpoint produces responses in the application/json
format.
This endpoint is used to list projects for a CV profile with a provided ID.
id
(integer, required): The ID of the CV profile. This parameter is included in the path of the request.page
(integer, required): The page number. This parameter is included in the query of the request.page_size
(integer, required): The page size. This parameter is included in the query of the request.
200 OK
: The request was successful and the response body contains a list of projects.400 Invalid ID, page or page size
: The provided ID, page or page size is invalid.404 CV profile with given ID does not exist
: There is no CV profile with the provided ID.500 Any other server-side error
: There was a server-side error while processing the request.
The endpoint produces responses in the application/json
format.
This endpoint is used to list skills for a CV profile with a provided ID.
id
(integer, required): The ID of the CV profile. This parameter is included in the path of the request.
200 OK
: The request was successful and the response body contains a list of skills.400 Invalid ID
: The provided ID is invalid.404 CV profile with given ID does not exist
: There is no CV profile with the provided ID.500 Any other server-side error
: There was a server-side error while processing the request.
The endpoint produces responses in the application/json
format.