From d09a2783786a3409b2421a48eef6eb0d96e36e45 Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Tue, 13 Dec 2022 11:18:51 +0800 Subject: [PATCH] Add readme.md --- README.md | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..ea76610 --- /dev/null +++ b/README.md @@ -0,0 +1,58 @@ +# AIS Course Project + +This is the code base for *Accounting Information System* course project. + +## Database Structure + +See [ais/install.go at master - ais - MSW Gitea](https://yongyuancv.cn/git/heimoshuiyu/ais/src/branch/master/pkg/api/install.go) + +Server use envirment variable `POSTGRES` as connection string for `postgres`. Example: `postgres://username:password@serverhost:5432/?sslmode=disable` + +## Self-host guide + +The recommend way to self-host services is to use docker. + +To start a postgres server: + +```shell +docker run -it --name pgdb -e POSTGRES_PASSWORD=password postgres +``` + +To build and bundle the front-end pages: + +```shell +cd web +npm install +npm run build +``` + +To build the server program, run: + +```shell +go mod tidy +go build -v . +``` + +> The server build process should always run after the front-end bundle process, because it needs to embed the `index.html` and `ais.js` to the binanary file. + +For more detailed information, see the drone CI/CD file, and [CI/CD page](https://drone.yongyuancv.cn/heimoshuiyu/ais) + +![Build Status]() + +## Security Evluation + +### Cookies-Session Encrytp Solution + +Session information encrypted by server and stored on client side. See [GitHub - gorilla/sessions: Package gorilla/sessions provides cookie and filesystem sessions and infrastructure for custom session backends.](https://github.com/gorilla/sessions) + +### User Password Hash Protect + +Implement with golang's standard hash library bcrypt. see [bcrypt documents](https://golang.org/x/crypto/bcrypt). + +## Performance Evluation + +With CI/CD auto push to edge network, the server capacity can be scale both vertically and horizontally. All `API` request is stateless, and can be easily migrate to become cloud-native application. + + + +