gin-boilerplate-api
is a Go-based microservice designed to handle client-related operations. This API provides endpoints for managing user data and authentication.
- RESTful API for client management.
- Built with Go for high performance and scalability.
- Easy to integrate with other microservices.
- Clone the repository:
git clone https://github.com/mathleite/gin-boilerplate-api-api.git
- Navigate to the project directory:
cd gin-boilerplate-api-api
- Create and fill .env:
cp .env.example .env && \ vim .env
- Run the application:
docker compose up --build --no-cache -d
http://localhost:8000/api/v1
- GET /health: Application health-check.
- POST /register: Register a user.
- POST /signin: SignIn a user.
- GET /transactions: Access a authenticated endpoint (has no logic here).
Request:
curl --request POST \
--url http://localhost:8000/api/v1/register \
--header 'Content-Type: application/json' \
--data '{
"name": "Boiler Plate",
"email": "[email protected]",
"password": "123root"
}'
Request:
curl --request POST \
--url http://localhost:8000/api/v1/auth/signin \
--header 'Content-Type: application/json' \
--data '{
"email": "[email protected]",
"password": "123root"
}'
Response:
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDEzMDUxMTcsImlhdCI6MTc0MTMwMzMxNywidXNlcl9pZCI6ImRiNGI5YWE4LTMwZDMtNDExMy05MjE2LTUwZTE0MTQ2OGQ1NSJ9.ZvUjK32lDg6OTFdNl-OTQDV_2ywcYLAWNWu3V23QYgo"
}
Request:
curl --request GET \
--url http://localhost:8000/api/v1/transactions \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDEzMDUxMTcsImlhdCI6MTc0MTMwMzMxNywidXNlcl9pZCI6ImRiNGI5YWE4LTMwZDMtNDExMy05MjE2LTUwZTE0MTQ2OGQ1NSJ9.ZvUjK32lDg6OTFdNl-OTQDV_2ywcYLAWNWu3V23QYgo'