https://github.com/halilomergurgan/financeapp
Go Lang Finance App
https://github.com/halilomergurgan/financeapp
golang rest-api
Last synced: over 1 year ago
JSON representation
Go Lang Finance App
- Host: GitHub
- URL: https://github.com/halilomergurgan/financeapp
- Owner: halilomergurgan
- Created: 2024-08-10T11:43:16.000Z (almost 2 years ago)
- Default Branch: Main
- Last Pushed: 2024-08-10T20:14:00.000Z (almost 2 years ago)
- Last Synced: 2025-03-15T10:09:07.836Z (over 1 year ago)
- Topics: golang, rest-api
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Personal Finance Management API
This is a simple personal finance management API built with Go. The API allows users to manage their finances by creating, updating, and deleting transactions and categories. User authentication is also implemented with password hashing.
## Features
- **User Management**: Users can be created with secure password hashing, and user details can be updated or deleted.
- **Category Management**: Users can create, update, list, and delete categories for their transactions.
- **Transaction Management**: Users can create, update, list, and delete financial transactions associated with specific categories.
## Technologies Used
- **Go**: The core language used for developing the API.
- **Gorilla Mux**: Router for handling HTTP requests.
- **MySQL**: Database for storing users, categories, and transactions.
- **bcrypt**: For securely hashing user passwords.
## Endpoints
### User Endpoints
- **POST /users**: Create a new user with password confirmation and secure password hashing.
- **GET /users**: List all users.
- **GET /users/{id}**: Get details of a specific user by ID.
- **PUT /users/{id}**: Update user details.
- **DELETE /users/{id}**: Delete a user by ID.
### Category Endpoints
- **POST /categories**: Create a new category.
- **GET /categories**: List all categories.
- **GET /categories/{id}**: Get details of a specific category by ID.
- **PUT /categories/{id}**: Update category details.
- **DELETE /categories/{id}**: Delete a category by ID.
### Transaction Endpoints
- **POST /transactions**: Create a new transaction.
- **GET /transactions**: List all transactions.
- **GET /transactions/{id}**: Get details of a specific transaction by ID.
- **PUT /transactions/{id}**: Update transaction details.
- **DELETE /transactions/{id}**: Delete a transaction by ID.
## Setup
### Prerequisites
- Go 1.16 or later
- MySQL
### Installation
1. **Clone the repository**:
```bash
git clone https://github.com/halilomergurgan/go-financeApp.git
cd go-financeApp
```
2. **Install dependencies**:
```bash
go mod tidy
```
3. **Set up MySQL**:
- Create a database named `financeApp`.
- Update the database credentials in `main.go` (DSN string).
4. **Run the application**:
```bash
go run main.go
```
5. **Test with Postman**:
- Use the provided endpoints to interact with the API.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Contributing
Feel free to submit issues and pull requests.