Frontend Web - Accounting Web JavaScript
Automatically run CronJob to generate last month report on 1st of every month.
Automatically generate swagger by comment in router.
- Language: TypeScript
- Web FrameWork: Express
- DataBase: MariaDB v10.9
copy .env.example and rename as .env
DB_HOST=
DB_PORT=
DB_USER=
DB_PASS=
DB_NAME=
# port
PORT=
# swagger
SWAGGER_MOUNT_PATH=/api
# insert basic data
INSERT_CHINESE_DATA=false
INSERT_ENGLISH_DATA=true
(Only set true when you use new db plz)
If INSERT_CHINESE_DATA === true, insert 7 common types with Chinese.
If INSERT_ENGLISH_DATA === true, insert 7 common types with english. Then type.name = type.id
- FOOD/食物
- SHOPPING/購物
- ENTERTAINMENT/娛樂
- EXERCISE/運動
- TRANSPORTATION/交通費
- UTILITY/水電費
- OTHER/其他
npm install
npm run migration:run
npm run start
POST /type
:新增一項類別GET /type
:取得所有類別GET /type/{id}
:取得一項類別PATCH /type/{id}/{name}
:更新一項類別名稱DELETE /type/{id}
:刪除一項類別, 將有使用的typeId改為OTHER, 預設OTHER不能刪除
POST /consumption
:新增一筆消費GET /consumption/{id}
:取得一筆消費GET /consumption
:取得所有消費 可限定年月PUT /consumption/{id}
:更新一筆消費DELETE /consumption/{id}
:刪除一項消費
POST /report/{year}/{month}
:產生指定年月報表GET /report/{year}/{month}
:取得指定年月報表