https://github.com/ivangrana/Go-Gin-restAPI
A financial management system API made with Go language, Gin and PostgreSQL
https://github.com/ivangrana/Go-Gin-restAPI
api-rest backend finance-management gin golang gorm-orm
Last synced: 8 months ago
JSON representation
A financial management system API made with Go language, Gin and PostgreSQL
- Host: GitHub
- URL: https://github.com/ivangrana/Go-Gin-restAPI
- Owner: ivangrana
- License: apache-2.0
- Created: 2025-02-15T17:34:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-15T17:52:58.000Z (over 1 year ago)
- Last Synced: 2025-02-15T18:31:26.603Z (over 1 year ago)
- Topics: api-rest, backend, finance-management, gin, golang, gorm-orm
- Language: Go
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Phinance
## Getting Started
### Prerequisites
- Go 1.16+
- PostgreSQL
- Docker
### Installation
1. Clone the repository
2. Create a .env file in the root directory and add the following variables:
```
DB_USER=postgresql
DB_PASSWORD=password
DB_NAME=postgres
DB_HOST=localhost
DB_PORT=5432
```
3. Run the following command to start the database:
```
docker-compose up -d
```
4. Run the following command to install the dependencies:
```
go mod download
```
5. Run the following command to run the application:
```
go run main.go
```
## Request workflow example:

## Components Diagram:

## Database Diagram:

## API endpoints
| Method | Endpoint | Description |
| ------ | ----------------------- | ---------------------------- |
| GET | /users | Get all users |
| POST | /users | Create a new user |
| GET | /users/:id | Get user by ID |
| PUT | /users/:id | Update user |
| DELETE | /users/:id | Delete user |
| GET | /categories | Get all categories |
| POST | /categories | Create a new category |
| GET | /categories/:category_id | Get category by ID |
| PUT | /categories/:category_id | Update category |
| DELETE | /categories/:category_id | Delete category |
| GET | /market-products | Get all market products |
| POST | /market-products | Create a new market product |
| GET | /market-products/:product_id | Get market product by ID |
| PUT | /market-products/:product_id | Update market product |
| DELETE | /market-products/:product_id | Delete market product |
| GET | /budgets | Get all budgets |
| POST | /budgets | Create a new budget |
| GET | /budgets/:budget_id | Get budget by ID |
| PUT | /budgets/:budget_id | Update budget |
| DELETE | /budgets/:budget_id | Delete budget |
| GET | /goals | Get all goals |
| POST | /goals | Create a new goal |
| GET | /goals/:goal_id | Get goal by ID |
| PUT | /goals/:goal_id | Update goal |
| DELETE | /goals/:goal_id | Delete goal |
| GET | /transactions | Get all transactions |
| POST | /transactions | Create a new transaction |
| GET | /transactions/:transaction_id | Get transaction by ID |
| PUT | /transactions/:transaction_id | Update transaction |
| DELETE | /transactions/:transaction_id | Delete transaction |