{"id":20245410,"url":"https://github.com/letsmakecakes/expense-tracker-api","last_synced_at":"2026-06-01T06:32:26.997Z","repository":{"id":259072397,"uuid":"875876134","full_name":"letsmakecakes/expense-tracker-api","owner":"letsmakecakes","description":"The Expense Tracker API is a RESTful service built with the Gin framework in Go","archived":false,"fork":false,"pushed_at":"2025-08-24T10:03:12.000Z","size":7879,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-24T15:45:50.246Z","etag":null,"topics":["api","go","jwt"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/letsmakecakes.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":"2024-10-21T02:43:59.000Z","updated_at":"2025-08-24T10:00:32.000Z","dependencies_parsed_at":"2024-10-28T16:21:39.873Z","dependency_job_id":"5c3302e9-381e-406a-8a34-b60a287e562d","html_url":"https://github.com/letsmakecakes/expense-tracker-api","commit_stats":null,"previous_names":["letsmakecakes/expense-tracker-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/letsmakecakes/expense-tracker-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsmakecakes%2Fexpense-tracker-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsmakecakes%2Fexpense-tracker-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsmakecakes%2Fexpense-tracker-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsmakecakes%2Fexpense-tracker-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/letsmakecakes","download_url":"https://codeload.github.com/letsmakecakes/expense-tracker-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsmakecakes%2Fexpense-tracker-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33763649,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["api","go","jwt"],"created_at":"2024-11-14T09:20:49.878Z","updated_at":"2026-06-01T06:32:26.974Z","avatar_url":"https://github.com/letsmakecakes.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Expense Tracker API\n\nThe **Expense Tracker API** is a RESTful service built with the Gin framework in Go. It provides endpoints to manage user credentials and track expenses, including features like JWT-based authentication, secure password hashing, and CRUD operations on expense records.\n\n## Features\n\n- **Authentication:**\n  - User Signup and Login with JWT-based token generation.\n- **Expense Management:**\n  - Add, update, delete, and retrieve expenses.\n  - Filter expenses by categories like Groceries, Electronics, etc.\n- **Security:**\n  - Passwords are hashed for secure storage.\n  - Token validation with middleware for protected routes.\n\n---\n\n## Table of Contents\n\n1. [Requirements](#requirements)\n2. [Setup](#setup)\n3. [API Endpoints](#api-endpoints)\n4. [Environment Variables](#environment-variables)\n5. [Run Locally](#run-locally)\n6. [Testing with cURL](#testing-with-curl)\n7. [License](#license)\n\n---\n\n## Requirements\n\n- **Go** (v1.20+ recommended)\n- **PostgreSQL/MySQL/SQLite** (as the database backend)\n- **cURL** (for testing API endpoints)\n- **Git** (for version control)\n\n---\n\n## Setup\n\n1. **Clone the repository:**\n   ```bash\n   git clone https://github.com/username/expense-tracker-api.git\n   cd expense-tracker-api\n   ```\n\n2. **Install dependencies:**\n   ```bash\n   go mod download\n   ```\n\n3. **Set up the database:**\n   - Create a database for the project.\n   - Update the connection string in the `config.yml` file or as an environment variable.\n\n4. **Run the server:**\n   ```bash\n   go run main.go\n   ```\n\n---\n\n## API Endpoints\n\n### **Auth Endpoints**\n| Method | Endpoint        | Description            | Auth Required |\n|--------|-----------------|------------------------|---------------|\n| POST   | `/signup`       | User Signup           | No            |\n| POST   | `/login`        | User Login (JWT Token)| No            |\n\n### **Expense Endpoints**\n| Method | Endpoint                | Description                 | Auth Required |\n|--------|-------------------------|-----------------------------|---------------|\n| POST   | `/expenseAPI/expense`   | Add a new expense           | Yes           |\n| GET    | `/expenseAPI/expense`   | Get all expenses            | Yes           |\n| GET    | `/expenseAPI/expense/:id` | Get expense by ID          | Yes           |\n| PUT    | `/expenseAPI/expense/:id` | Update expense by ID       | Yes           |\n| DELETE | `/expenseAPI/expense/:id` | Delete expense by ID       | Yes           |\n\n---\n\n## Environment Variables\n\n| Variable       | Description                       |\n|----------------|-----------------------------------|\n| `PORT`         | Server listening port (default: 8080) |\n| `DATABASE_URL` | Connection string for the database |\n| `JWT_SECRET`   | Secret key for signing JWT tokens |\n\n---\n\n## Run Locally\n\n1. **Start the server:**\n   ```bash\n   go run main.go\n   ```\n\n2. **Access the API:**\n   Visit `http://localhost:8080` to access the API.\n\n---\n\n## Testing with cURL\n\n### **1. Sign Up**\n```bash\ncurl -X POST http://localhost:8080/signup \\\n-H \"Content-Type: application/json\" \\\n-d '{\"username\": \"testuser\", \"password\": \"testpassword\"}'\n```\n\n### **2. Log In**\n```bash\ncurl -X POST http://localhost:8080/login \\\n-H \"Content-Type: application/json\" \\\n-d '{\"username\": \"testuser\", \"password\": \"testpassword\"}'\n```\n\n### **3. Add an Expense**\n```bash\ncurl -X POST http://localhost:8080/expenseAPI/expense \\\n-H \"Authorization: Bearer \u003cJWT_TOKEN\u003e\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\"category\": \"Groceries\", \"amount\": 50.75, \"description\": \"Lunch\", \"date\": \"2024-11-13\"}'\n```\n\n### **4. Get All Expenses**\n```bash\ncurl -X GET http://localhost:8080/expenseAPI/expense \\\n-H \"Authorization: Bearer \u003cJWT_TOKEN\u003e\"\n```\n\n---\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\nFeel free to contribute to this project or use it as a reference for your own projects! 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletsmakecakes%2Fexpense-tracker-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fletsmakecakes%2Fexpense-tracker-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletsmakecakes%2Fexpense-tracker-api/lists"}