Git Product home page Git Product logo

accounting-api-typescript's Introduction

Accounting Api

Automatically run CronJob to generate last month report on 1st of every month.
Automatically generate swagger by comment in router.

Overview

  • Language: TypeScript
  • Web FrameWork: Express
  • DataBase: MariaDB v10.9

ENV

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/其他

Run

install dependencies

npm install

run migration file

npm run migration:run

run

npm run start

ER Diagram

image

API

type

  • POST /type:新增一項類別
  • GET /type:取得所有類別
  • GET /type/{id}:取得一項類別
  • PATCH /type/{id}/{name}:更新一項類別名稱
  • DELETE /type/{id}:刪除一項類別, 將有使用的typeId改為OTHER, 預設OTHER不能刪除

consumption

  • POST /consumption:新增一筆消費
  • GET /consumption/{id}:取得一筆消費
  • GET /consumption:取得所有消費 可限定年月
  • PUT /consumption/{id}:更新一筆消費
  • DELETE /consumption/{id}:刪除一項消費

report

  • POST /report/{year}/{month}:產生指定年月報表
  • GET /report/{year}/{month}:取得指定年月報表

accounting-api-typescript's People

Contributors

yuhexiong avatar

Stargazers

Pikao avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.