{"id":22190998,"url":"https://github.com/yuhexiong/accounting-api-typescript","last_synced_at":"2026-04-17T00:32:09.788Z","repository":{"id":204240709,"uuid":"710368349","full_name":"yuhexiong/accounting-api-typescript","owner":"yuhexiong","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-08T03:29:42.000Z","size":253,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T20:43:14.144Z","etag":null,"topics":["api","backend","error-handling","express","mariadb","nodejs","restful-api","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/yuhexiong.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":"2023-10-26T14:56:07.000Z","updated_at":"2023-12-26T09:43:44.000Z","dependencies_parsed_at":"2023-11-25T14:27:27.984Z","dependency_job_id":"29623117-4a46-4e39-a7bd-adfc2fbb29b2","html_url":"https://github.com/yuhexiong/accounting-api-typescript","commit_stats":null,"previous_names":["yuhexiong/accounting-api-typescript"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yuhexiong/accounting-api-typescript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuhexiong%2Faccounting-api-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuhexiong%2Faccounting-api-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuhexiong%2Faccounting-api-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuhexiong%2Faccounting-api-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yuhexiong","download_url":"https://codeload.github.com/yuhexiong/accounting-api-typescript/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuhexiong%2Faccounting-api-typescript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31909956,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"ssl_error","status_checked_at":"2026-04-16T18:21:47.142Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["api","backend","error-handling","express","mariadb","nodejs","restful-api","typescript"],"created_at":"2024-12-02T12:13:50.835Z","updated_at":"2026-04-17T00:32:07.752Z","avatar_url":"https://github.com/yuhexiong.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Accounting Api\n\n### Frontend Web - [Accounting Web JavaScript](https://github.com/yuhexiong/accounting-web-vue3-javascript)\n\nAutomatically run CronJob to generate last month report on 1st of every month.  \nAutomatically generate swagger by comment in router.\n\n## Overview\n\n- Language: TypeScript\n- Web FrameWork: Express\n- DataBase: MariaDB v10.9\n\n## ENV\n\ncopy .env.example and rename as .env\n\n```bash\nDB_HOST=\nDB_PORT=\nDB_USER=\nDB_PASS=\nDB_NAME=\n\n# port \nPORT=\n\n# swagger\nSWAGGER_MOUNT_PATH=/api\n\n# insert basic data\nINSERT_CHINESE_DATA=false\nINSERT_ENGLISH_DATA=true\n```\n**(Only set true when you use new db plz)**  \n**If INSERT_CHINESE_DATA === true, insert 7 common types with Chinese.**  \n**If INSERT_ENGLISH_DATA === true, insert 7 common types with english. Then type.name = type.id**\n\n- FOOD/食物\n- SHOPPING/購物\n- ENTERTAINMENT/娛樂\n- EXERCISE/運動\n- TRANSPORTATION/交通費\n- UTILITY/水電費\n- OTHER/其他\n\n## Run\n\n### install dependencies\n\n```bash\n\nnpm install\n\n```\n\n### run migration file\n\n```bash\n\nnpm run migration:run\n\n```\n\n### run\n\n```bash\n\nnpm run start\n\n```\n\n## ER Diagram\n![image](https://github.com/yuhexiong/accounting-api-typescript/blob/main/image/accounting_schema_v2.png)\n\n\n## API\n\n### type\n\n- `POST /type`：新增一項類別\n- `GET /type`：取得所有類別\n- `GET /type/{id}`：取得一項類別\n- `PATCH /type/{id}/{name}`：更新一項類別名稱\n- `DELETE /type/{id}`：刪除一項類別, 將有使用的typeId改為OTHER, 預設OTHER不能刪除\n\n### consumption\n\n- `POST /consumption`：新增一筆消費\n- `GET /consumption/{id}`：取得一筆消費\n- `GET /consumption`：取得所有消費 可限定年月\n- `PUT /consumption/{id}`：更新一筆消費\n- `DELETE /consumption/{id}`：刪除一項消費\n\n### report\n\n- `POST /report/{year}/{month}`：產生指定年月報表\n- `GET /report/{year}/{month}`：取得指定年月報表","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuhexiong%2Faccounting-api-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyuhexiong%2Faccounting-api-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuhexiong%2Faccounting-api-typescript/lists"}