Simple HTTP REST API that helps you take control of your money, manage multiple
resources, like: users
, wallets
and transactions
.
Currently supported database is SQLite. Any SQL database should work.
All endpoints are available below.
POST /api/v1/users
Creates an user with email and password. Example:
curl --request POST \
--url http://localhost:3333/api/v1/users \
--header 'Content-Type: application/json' \
--data '{
"email": "bruno.vbl@hotmail.com",
"name": "Bruno Lombardi",
"password": "123456",
"password_confirmation": "123456"
}'
201 CREATED:
{
"id": "u_uZpAwRNITM",
"email": "bruno.vbl@hotmail.com",
"name": "Bruno Lombardi"
}
GET /api/v1/users
List all users. Example:
curl --request GET \
--url 'http://localhost:3333/api/v1/users?Page=1&Limit=10'
200 OK:
{
"total_pages": 1,
"count": 1,
"per_page": 10,
"page": 1,
"data": [
{
"id": "u_uZpAwRNITM",
"email": "bruno.vbl@hotmail.com",
"name": "Bruno Lombardi"
}
]
}
GET /api/v1/users/{user_id}
Fetch user by id. Example:
curl --request GET \
--url http://localhost:3333/api/v1/users/u_uZpAwRNITM
200 OK:
{
"id": "u_uZpAwRNITM",
"email": "bruno.vbl@hotmail.com",
"name": "Bruno Lombardi"
}
➜ go mod download
➜ go run main.go
➜ go build