Skip to content

johanguse/api-go-lang-transations

Repository files navigation

Transactions API

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.

Getting Started

Prerequisites

  • Go 1.21 or later
  • MySQL 5.7 or later

Installing

  1. Clone the repository:
git clone https://github.com/johanguse/api-go-lang-transations.git
  1. Install the dependencies:
cd transactions-api
go mod download
  1. Set up the database:
mysql -u root -p < database/sql/database.sql
  1. 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.

API Reference

Swagger Documentatio

https://api-go-lang-transations.fly.dev/api/swagger/index.html

Postman Collection

Run in Postman

Base URL

http://127.0.0.1:8000/api

Healthcheck

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",

List Transactions

GET /transactions

List transactions with pagination.

Create Transaction

POST /transactions

Create a new transaction.

Find Transaction by ID

GET /transactions/:id

Find a transaction by its unique ID.

Update Transaction

PUT /transactions/:id

Update a transaction by its unique ID.

Delete Transaction

DELETE /transactions/:id

Delete a transaction by its unique ID.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Golang API w/ Fiber. Used in the test of Warren Brasil front-end challenge

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published