{"id":28336056,"url":"https://github.com/santura-dev/expense-tracker-api","last_synced_at":"2026-05-18T15:34:48.784Z","repository":{"id":278165724,"uuid":"934699666","full_name":"santura-dev/Expense-tracker-API","owner":"santura-dev","description":"A Flask-based RESTful API for personal expense tracking that allows users to manage and categorize their expenses while providing detailed summaries over different time periods. Features include user authentication, optional expense categorization, and comprehensive expense analytics with support for weekly, monthly, and quarterly summaries.","archived":false,"fork":false,"pushed_at":"2025-05-31T09:30:54.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-20T01:38:23.461Z","etag":null,"topics":["expense-manager","expense-tracker","flask","personal-budgetting","personal-finance","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/santura-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-02-18T09:10:01.000Z","updated_at":"2025-05-31T09:30:57.000Z","dependencies_parsed_at":"2025-02-18T11:22:36.497Z","dependency_job_id":"5ac6c80f-029c-497f-91d2-afe18c5809c2","html_url":"https://github.com/santura-dev/Expense-tracker-API","commit_stats":null,"previous_names":["ravenlb/expense-tracker-api","santura-dev/expense-tracker-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/santura-dev/Expense-tracker-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santura-dev%2FExpense-tracker-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santura-dev%2FExpense-tracker-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santura-dev%2FExpense-tracker-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santura-dev%2FExpense-tracker-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/santura-dev","download_url":"https://codeload.github.com/santura-dev/Expense-tracker-API/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santura-dev%2FExpense-tracker-API/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33182983,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["expense-manager","expense-tracker","flask","personal-budgetting","personal-finance","rest-api"],"created_at":"2025-05-26T22:25:33.126Z","updated_at":"2026-05-18T15:34:48.769Z","avatar_url":"https://github.com/santura-dev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Expense Tracker API\n\nA RESTful API built with Flask for tracking personal expenses. This API allows users to manage their expenses, categorize them, and view expense summaries over different time periods.\n\n## Features\n\n- User authentication with JWT tokens\n- Create, read, update, and delete expenses\n- Categorize expenses (optional)\n- View expense summaries (total, average, by category)\n- Filter expenses by time periods (week, month, three months)\n- Secure password hashing\n- Token-based logout system\n\n## Technologies Used\n\n- Python 3.x\n- Flask\n- Flask-Smorest (API documentation)\n- Flask-SQLAlchemy (Database ORM)\n- Flask-JWT-Extended (Authentication)\n- SQLite (Database)\n- Marshmallow (Schema validation)\n- Passlib (Password hashing)\n\n## Installation\n\n1. Clone the repository\n```bash\ngit clone https://github.com/yourusername/expense-tracker-api.git\ncd expense-tracker-api\n```\n\n2. Create a virtual environment and activate it\n```bash\npython -m venv venv\n```\n\n3. Install the dependencies\n```bash\npip install -r requirements.txt\n```\n4. Create a `.env` file in the root directory:\n```bash\nJWT_SECRET_KEY=your_secret_key\n```\n5. Initialize the database:\n```bash\npython create_db.py\n```\n\n6. Run the application\n```bash\npython flask run\n``` \n## API Endpoints\n\n### Authentication\n- `POST /register` - Register a new user\n- `POST /login` - Login and receive access token\n- `POST /logout` - Logout and invalidate token\n\n### Expenses\n- `GET /expense` - Get all expenses for logged-in user\n- `POST /expense` - Create a new expense\n- `GET /expense/\u003cid\u003e` - Get specific expense\n- `PUT /expense/\u003cid\u003e` - Update specific expense\n- `DELETE /expense/\u003cid\u003e` - Delete specific expense\n- `GET /expense/summary` - Get expense summary\n- `GET /expense/summary/\u003cperiod\u003e` - Get period-specific summary (week/month/three_months)\n\n### Categories\n- `GET /category` - Get all categories\n- `POST /category` - Create a new category\n- `GET /category/\u003cid\u003e` - Get specific category\n- `DELETE /category/\u003cid\u003e` - Delete specific category\n\n## API Usage Examples\n\n### 1. User Registration\n```bash\ncurl -X POST http://localhost:5000/register \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"username\": \"john_doe\",\n    \"password\": \"secure_password123\"\n  }'\n```\nResponse:\n```json\n{\n    \"message\": \"User created successfully.\"\n}\n```\n\n### 2. User Login\n```bash\ncurl -X POST http://localhost:5000/login \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"username\": \"john_doe\",\n    \"password\": \"secure_password123\"\n  }'\n```\nResponse:\n```json\n{\n    \"access_token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\"\n}\n```\n\n### 3. Creating an Expense\n```bash\ncurl -X POST http://localhost:5000/expense \\\n  -H \"Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"name\": \"Groceries\",\n    \"amount\": 50.99,\n    \"date\": \"18-02-2024\"\n  }'\n```\nResponse:\n```json\n{\n    \"id\": 1,\n    \"name\": \"Groceries\",\n    \"amount\": 50.99,\n    \"date\": \"18-02-2024\",\n    \"category\": null\n}\n```\n\n### 4. Creating a Category\n```bash\ncurl -X POST http://localhost:5000/category \\\n  -H \"Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"name\": \"Food\"\n  }'\n```\nResponse:\n```json\n{\n    \"id\": 1,\n    \"name\": \"Food\",\n    \"expenses\": []\n}\n```\n\n### 5. Getting Expense Summary\n```bash\ncurl -X GET http://localhost:5000/expense/summary \\\n  -H \"Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\"\n```\nResponse:\n```json\n{\n    \"total_amount\": 150.97,\n    \"count\": 3,\n    \"average\": 50.32,\n    \"categories\": {\n        \"Food\": 80.99,\n        \"Transportation\": 45.00,\n        \"Uncategorized\": 24.98\n    }\n}\n```\n\n### 6. Getting Period Summary\n```bash\ncurl -X GET http://localhost:5000/expense/summary/month \\\n  -H \"Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\"\n```\nResponse:\n```json\n{\n    \"total_amount\": 120.50,\n    \"count\": 2,\n    \"average\": 60.25,\n    \"categories\": {\n        \"Food\": 80.99,\n        \"Uncategorized\": 39.51\n    }\n}\n```\n\n## API Response Codes\n\n| Status Code | Description |\n|------------|-------------|\n| 200 | Success |\n| 201 | Resource created |\n| 400 | Bad request |\n| 401 | Unauthorized |\n| 404 | Resource not found |\n| 409 | Conflict (e.g., username already exists) |\n| 500 | Server error |\n\n\n## Authentication\n\nThe API uses JWT tokens for authentication. After logging in, include the access token in the Authorization header:\n\nAuthorization: Bearer \u003cyour-access-token\u003e\n\n## Development\n\nThe API documentation will be available at:\n- Swagger UI: `http://localhost:5000/swagger-ui`\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Commit your changes\n4. Push to the branch\n5. Create a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsantura-dev%2Fexpense-tracker-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsantura-dev%2Fexpense-tracker-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsantura-dev%2Fexpense-tracker-api/lists"}