{"id":26307417,"url":"https://github.com/kweeuhree/personal-budgeting-backend","last_synced_at":"2025-03-15T10:14:44.606Z","repository":{"id":263053637,"uuid":"888649532","full_name":"kweeuhree/personal-budgeting-backend","owner":"kweeuhree","description":"A GO backend for a personal budgeting app","archived":false,"fork":false,"pushed_at":"2025-02-06T16:33:15.000Z","size":32957,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-06T17:25:47.696Z","etag":null,"topics":["aiven","go","mysql","onrender-deploy"],"latest_commit_sha":null,"homepage":"https://personal-budgeting-backend.onrender.com/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kweeuhree.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-11-14T19:05:16.000Z","updated_at":"2025-02-06T16:33:19.000Z","dependencies_parsed_at":"2024-12-07T19:25:18.387Z","dependency_job_id":"52560b83-41a4-4479-b36e-6a5b9e32e42a","html_url":"https://github.com/kweeuhree/personal-budgeting-backend","commit_stats":null,"previous_names":["kweeuhree/personal-budgeting-backend"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kweeuhree%2Fpersonal-budgeting-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kweeuhree%2Fpersonal-budgeting-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kweeuhree%2Fpersonal-budgeting-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kweeuhree%2Fpersonal-budgeting-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kweeuhree","download_url":"https://codeload.github.com/kweeuhree/personal-budgeting-backend/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243713405,"owners_count":20335567,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["aiven","go","mysql","onrender-deploy"],"created_at":"2025-03-15T10:14:44.026Z","updated_at":"2025-03-15T10:14:44.598Z","avatar_url":"https://github.com/kweeuhree.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🏦 Personal Budgeting App\n\nThis repository contains a budget tracker that allows a user to create a budget and add categorized expenses.\n\n## 🪧 Overview\n\nThe Personal Budgeting App is a RESTful API service that processes budget and expense data, updating the budget accordingly.\nThe application is deployed on Render and may take up to 50 seconds to resume operation after periods of inactivity. It uses MySQL as its storage solution, hosted through the Aiven service.\n\n#### Third-Party Packages\n\n- The `scs/mysqlstore` package is used for session storage in MySQL.\n- The `scs/v2` package is used for session management and handling.\n- The `mysql` package is used interfacing with MySQL databases.\n- The `httprouter` package is used for fast and efficient routing.\n- The `alice` package is used for clear and readable middleware chaining.\n- The `uuid` package is used to generate unique ids.\n- The `nosurf` package is used for CSRF protection middleware.\n- The `crypto` package is used for password hashing and verification.\n\n## 🔍 Prerequisites\n\n- Go 1.22.5\n- Windows, macOS, or Linux operating system\n\n## ▶️ Usage\n\nThe application can be interacted with through the deployed [React application](https://personal-budgeting.onrender.com/).\n\n## 💡API Specification\n\nSee a [Redocly page](https://kweeuhree.github.io/personal-budgeting-backend/) for an interactive overview.\n\n### Endpoint: CSRF Token\n\n- Path: `/api/csrf-token`\n- Method: `GET`\n- Response: JSON containing a CSRF token.\n\nDescription:\n\nReturns a JSON object with a CSRF token generated by the server.\n\nExample Response:\n\n```json\n{\n  \"csrf_token\": \"7cpnevxmIFjaS0yr6msraJistWmqySe/6JPE2ELapCtRyJ+Eg/iZ75ErPoRecEADW5q6jYMzMZjx83RKz+tFIg==\"\n}\n```\n\n### Endpoint: User Signup\n\n- Path: `/api/users/signup`\n- Method: `POST`\n- Payload: JSON with user credentials.\n- Response: JSON containing user id, user email and a flash message.\n\nDescription:\n\nTakes in a JSON with user credentials and returns a JSON object with a uuid-generated userId, registered user email, and a flash message.\n\nExample Response:\n\n```json\n{\n  \"userId\": \"7fb1377b-b223-49d9-a31a-5a02701dd310\",\n  \"email\": \"hello@world.dev\",\n  \"flash\": \"Your signup was successful. Please log in.\"\n}\n```\n\n### Endpoint: User Login\n\n- Path: `/api/users/login`\n- Method: `POST`\n- Payload: JSON with user credentials.\n- Response: JSON containing user details and a flash message.\n\nDescription:\n\nTakes in a JSON with user credentials and returns a JSON object with the userId, user email, user name, user budget(if exists) and a flash message.\n\nExample Response:\n\n```json\n{\n  \"userId\": \"7fb1377b-b223-49d9-a31a-5a02701dd310\",\n  \"email\": \"hello@world.dev\",\n  \"displayName\": \"Go Dev\",\n  \"budget\": {\n       {\n        \"budgetId\": \"5fb1355b-l113-49d9-h57s-0a11301dh57s\",\n        \"checkingBalance\": \"1000\",\n        \"savingsBalance\": \"5000\",\n        \"budgetTotal\": \"6000\",\n        \"budgetRemaining\": \"6000\",\n        \"totalSpent\": \"2000\"\n       }\n  },\n  \"flash\": \"Login successful!\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkweeuhree%2Fpersonal-budgeting-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkweeuhree%2Fpersonal-budgeting-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkweeuhree%2Fpersonal-budgeting-backend/lists"}