https://github.com/felipeversiane/picpay-golang
simple bank transfer system made for a challenge from 𝗽𝗶𝗰𝗽𝗮𝘆 bank with 𝗴𝗼𝗹𝗮𝗻𝗴.
https://github.com/felipeversiane/picpay-golang
docker gin-gonic git golang migrations postgresql zap-logger
Last synced: about 1 year ago
JSON representation
simple bank transfer system made for a challenge from 𝗽𝗶𝗰𝗽𝗮𝘆 bank with 𝗴𝗼𝗹𝗮𝗻𝗴.
- Host: GitHub
- URL: https://github.com/felipeversiane/picpay-golang
- Owner: felipeversiane
- Created: 2024-05-18T03:20:34.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-23T03:18:32.000Z (over 1 year ago)
- Last Synced: 2025-03-23T04:22:07.067Z (over 1 year ago)
- Topics: docker, gin-gonic, git, golang, migrations, postgresql, zap-logger
- Language: Go
- Homepage: https://picpay-golang.onrender.com/docs/index.html
- Size: 92.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PicPay Challenge API
API for managing users and transfers, developed for PicPay's challenge.
## Introduction
The API allows for the management of users and transfers. Below are described the main functionalities available, as well as instructions for setup and usage.
## Main Libraries Used
- **github.com/jackc/pgx/v5** - PostgreSQL database driver for Go.
- **github.com/joho/godotenv** - Loads environment variables from a .env file.
- **go.uber.org/zap** - Fast, structured logging for Go.
- **github.com/gin-gonic/gin** - Fast, and concurrency way to make a api.
For a full list of dependencies, please refer to the [go.mod](https://github.com/felipeversiane/picpay-golang/blob/main/go.mod) file.
## Endpoints
### Users
#### Create User
- **Description:** Creates a new user with the provided information.
- **Method:** `POST`
- **Endpoint:** `/api/v1/user`
- **Request Body:**
```json
{
"email": "pedro@xx.com",
"password": "senha123!F",
"first_name": "Pedro",
"last_name": "Silva",
"is_merchant": false,
"document": "1234567220",
"balance": 200.00
}
#### Get User By ID
- **Description:** Find a user with the provided id.
- **Method:** `GET`
- **Endpoint:** `/api/v1/user/{id}`
#### Get User By Email
- **Description:** Find a user with the provided email.
- **Method:** `GET`
- **Endpoint:** `/api/v1/user/find_user_by_email/{email}`
#### Get User By Document
- **Description:** Find a user with the provided document.
- **Method:** `GET`
- **Endpoint:** `/api/v1/user/find_user_by_document/{document}`
#### Update User
- **Description:** Update a user with the provided ID.
- **Method:** `PUT`
- **Endpoint:** `/api/v1/user/{id}`
- **Request Body:**
```json
{
"first_name": "Pedro",
"last_name": "Silva",
"is_merchant": false,
"balance": 200.00
}
#### Delete User
- **Description:** Delete a user with the provided id.
- **Method:** `DELETE`
- **Endpoint:** `/api/v1/user/{id}`
### Orders
#### Create Order
- **Description:** Creates a new order with the provided information.
- **Method:** `POST`
- **Endpoint:** `/api/v1/order`
- **Request Body:**
```json
{
"amount": 1000.00,
"payee": "d260ff06-5369-4269-8d54-91bbf42fd26a",
"payer": "103cdecf-6e1c-4ec9-9e54-2dc6a4f185f8"
}
#### Get Order By ID
- **Description:** Find a order with the provided id.
- **Method:** `GET`
- **Endpoint:** `/api/v1/order/{id}`
The API is deployed and accessible at [picpay-golang.onrender.com](https://picpay-golang.onrender.com/docs/index.html).