In 2022, I took a front-end test to work at Warren. The API used in the test was hosted on Heroku, but it's currently offline. To continue consuming my front-end code, I decided to create my own API using Go and Fiber. You can find the front-end code for the project at https://github.com/johanguse/warren-desafio-web.
I'm happy to say that I passed the test and worked at the company for some time.
- Go 1.21 or later
- MySQL 5.7 or later
- Clone the repository:
git clone https://github.com/johanguse/api-go-lang-transations.git
- Install the dependencies:
cd transactions-api
go mod download
- Set up the database:
mysql -u root -p < database/sql/database.sql
- Start the server:
go run main.go
The server will start on http://127.0.0.1:8000/api/.
You can use the healthcheck to verify the status.
https://api-go-lang-transations.fly.dev/api/swagger/index.html
Base URL
http://127.0.0.1:8000/api
GET /healthchecker
You can use the healthcheck to verify the status and proper functioning of your application. It returns a status of success and a welcome message.
"status": "success",
"message": "Welcome to Golang, Fiber, and GORM",
GET /transactions
List transactions with pagination.
POST /transactions
Create a new transaction.
GET /transactions/:id
Find a transaction by its unique ID.
PUT /transactions/:id
Update a transaction by its unique ID.
DELETE /transactions/:id
Delete a transaction by its unique ID.
This project is licensed under the MIT License - see the LICENSE file for details.