59 lines
1.8 KiB
Markdown
59 lines
1.8 KiB
Markdown
# 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)
|
|
|
|
CI/CD status: [](https://drone.yongyuancv.cn/heimoshuiyu/ais)
|
|
|
|
## 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.
|
|
|
|
|
|
|
|
|