This is a simple project to demonstrate the use of the Go programming language to create a simple REST API.
To install the project, you need to have Go and Docker installed on your machine. You can find the installation instructions for Go here and for Docker here.
After installing Go, you can clone the project using the following command:
git clone
To run the project, first you need to setup the database. Copy the .env.example
file to .env
and set the environment variables to the desired values. Then, you can start the database using the following command:
docker-compose up -d
After starting the database, you can run the project using the following command:
go run main.go
By default, the project will run the project with Swagger UI enabled. You can access the Swagger UI by navigating to http://localhost:8080/swagger/index.html
.
Alternatively, you can use the following make
commands to interact with the project:
make run
: Run the projectmake run-with-docs
: Generate the Swagger documentation and run the projectmake test
: Run the testsmake build
: Build the project into a binary filemake docs
: Generate the Swagger documentationmake clean
: Clean the project by removing the binary file and the generated documentation
The project is structured as follows:
config
: Contains the configuration files for the projectdocs
: Contains the generated Swagger documentationhandler
: Contains the request handlers for the projectrouter
: Contains the router for the projectschema
: Contains the schema definitions for the project