Skip to content

Commit

Permalink
doc: folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
hhow09 committed Jan 23, 2025
1 parent 9970ec2 commit bf5e2b0
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,29 @@ npm run test
- [x] [Socket.io](https://socket.io/) is used for WebSocket communication.
- [x] [MongoDB](https://www.mongodb.com/) is used for storing chat history.
- [Array $slice](https://www.mongodb.com/docs/manual/reference/operator/update/slice/) is used to keep only the latest history.
- `Index` is created on `clientId` for history command querying by `clientId`.
- [x] [Jest](https://jestjs.io/) is used for unit testing.
- [x] [Github Workflows](../.github/workflows/ci.yaml) is used for continuous integration.

## Folder Structure
```
src
├── app.spec.ts # integration test
├── app.ts # main entry
├── chat-server.ts # websocket server
├── command-service.ts # handle business logic
├── entities
│   └── command-result.entity.ts # entity shared across components
├── math # math calculation logic, pure functions
│   ├── evaluate.spec.ts
│   ├── evaluate.ts
│   └── types.ts
└── repositories # data access layer
├── chat-repo.spec.ts
├── chat-repo.ts
└── index.ts
```

## Math Calculation
### Evalutaion Algorithm
1. Parse the expression string by splitting by `+` and `-`, resulting a list of sub-expressions (`ExpressionMD`).
Expand Down

0 comments on commit bf5e2b0

Please sign in to comment.