{"id":28328672,"url":"https://github.com/mth-ribeiro-dev/finance-api-go","last_synced_at":"2026-04-18T19:31:44.473Z","repository":{"id":293749361,"uuid":"984934342","full_name":"mth-ribeiro-dev/finance-api-go","owner":"mth-ribeiro-dev","description":"REST API in Go for personal finance tracking with local JSON storage.","archived":false,"fork":false,"pushed_at":"2025-05-24T20:06:55.000Z","size":6889,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-05T00:48:00.318Z","etag":null,"topics":["backend","gin","go","json-api","personal-finance","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mth-ribeiro-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-16T19:02:38.000Z","updated_at":"2025-05-24T20:02:08.000Z","dependencies_parsed_at":"2025-08-06T11:26:24.536Z","dependency_job_id":"960cf0b5-965f-4652-800c-d548810fa8eb","html_url":"https://github.com/mth-ribeiro-dev/finance-api-go","commit_stats":null,"previous_names":["mth-ribeiro-dev/finance-api-go"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/mth-ribeiro-dev/finance-api-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mth-ribeiro-dev%2Ffinance-api-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mth-ribeiro-dev%2Ffinance-api-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mth-ribeiro-dev%2Ffinance-api-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mth-ribeiro-dev%2Ffinance-api-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mth-ribeiro-dev","download_url":"https://codeload.github.com/mth-ribeiro-dev/finance-api-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mth-ribeiro-dev%2Ffinance-api-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31982508,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T17:30:12.329Z","status":"ssl_error","status_checked_at":"2026-04-18T17:29:59.069Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend","gin","go","json-api","personal-finance","rest-api"],"created_at":"2025-05-26T08:16:20.280Z","updated_at":"2026-04-18T19:31:44.452Z","avatar_url":"https://github.com/mth-ribeiro-dev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"📘 Read this documentation in [Português 🇧🇷](./README.pt-BR.md)\n\n# 📊 Finance API - Personal Finance Management in Go\n\nThis project is a REST API for managing personal finances developed in Go. It allows recording income and expenses, automatic balance calculation, local data persistence using a JSON file, and includes user management features.\n\n## Features\n\n- Transaction recording (income and expenses)\n- Automatic balance calculation\n- Local data persistence using JSON file\n- User management (registration, authentication, and deletion)\n- Transactions linked to specific users\n- API documentation with Swagger\n- Email sending functionality\n\n## Technologies Used\n\n- Go (Golang)\n- Gin Gonic (web framework)\n- Encoding/JSON for data persistence\n- Modular architecture\n- Swagger for API documentation\n- SMTP for email sending\n\n## Project Structure\n\nThe project follows a modular structure, organized as follows:\n\n\n```\nfinance-api/\n├── cmd/\n│   └── server/\n│       └── main.go\n├── internal/\n│   ├── handler/\n│   │   ├── finance.go\n│   │   └── user.go\n│   ├── model/\n│   │   ├── dateOnly.go\n│   │   ├── transaction.go\n│   │   └── user.go\n│   ├── service/\n│   │   ├── finance.go\n│   │   ├── finance_test.go\n│   │   ├── user.go\n│   │   └── user_test.go\n│   └── storage/\n│       ├── commonStorage.go\n│       ├── financesStorage.go\n│       └── usersStorage.go\n├── go.mod\n├── go.sum\n├── .gitignore\n├── README.md\n└── README.pt-BR.md\n```\n## How to Run\n\n1. Clone the repository:\n\n```bash\n  git clone https://github.com/mth-ribeiro-dev/finance-api.git\n```\n\n2. Navigate to the project directory:\n\n```bash\n  cd finance-api\n```\n\n3. Install dependencies:\n\n```bash\n  go get -v ./...\n```\n\n4. Run the application:\n\n```bash\n   go run cmd/server/main.go\n```\n\n5. Access the Swagger documentation:\n\n   Open your browser and go to `http://localhost:8081/swagger/index.html`\n\n## Configuration\n\nCreate a `config.yaml` file in the project root with the following structure:\n\n```yaml\nsmtp:\n  host: your_smtp_host\n  port: your_smtp_port\n  username: your_smtp_username\n  password: your_smtp_password\n```\n\n## API Endpoints\n\nFor a detailed and interactive documentation of all API endpoints, please refer to the Swagger UI available at `http://localhost:8081/swagger/index.html` when the application is running.\n\n### Users\n- `POST /api/v1/user/register`: Registers a new user\n- `POST /api/v1/user/login`: Authenticates a user\n- `DELETE /api/v1/user/:id`: Deactivates a user\n\n### Financial Transactions\n- `POST /api/v1/finance/transaction`: Adds a new transaction\n- `GET /api/v1/finance/transactions/:userId`: Returns all transactions for a user\n- `GET /api/v1/finance/balance/:userId`: Returns a user's current balance\n- `PUT /api/v1/finance/:id`: Update an existing transaction\n- `DELETE /api/v1/finance/:id`: Delete a transaction\n\n### Email\n- `POST /api/v1/send-email`: Send an email\n\n## Testing\n\nThe project includes comprehensive unit tests for the service layer. To run the tests:\n```bash\n   go test ./...\n```\n\n## Documentation\n\nThis project uses Swagger for API documentation. The documentation includes detailed information about all endpoints, request/response models, and allows for interactive API testing.\n\nTo view the Swagger documentation:\n1. Start the application\n2. Open your web browser\n3. Navigate to `http://localhost:8081/swagger/index.html`\n\nThe code also includes comprehensive comments, enhancing readability and maintainability.\n\n## Best Practices Applied\n\n- Modular code organization\n- Use of `go.mod` for dependency management\n- Implementation of unit tests\n- Use of interfaces for decoupling (e.g., storage)\n- Robust input validation\n\n## License\n\nThis project is licensed under the [Creative Commons BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/) license for educational and non-commercial purposes.\n\n## Author\n\nDeveloped by Matheus Ribeiro\n- Email: matheus.junio159@gmail.com\n- GitHub: [https://github.com/mth-ribeiro-dev](https://github.com/mth-ribeiro-dev)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmth-ribeiro-dev%2Ffinance-api-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmth-ribeiro-dev%2Ffinance-api-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmth-ribeiro-dev%2Ffinance-api-go/lists"}