root
├── core - core application logic. Things in here have no knowledge of stores nor interaction ingress/egress
│ ├── entities.ts -- domain entities shared throughout the core logic
│ └── someFn.ts -- some (probably pure) function that does some business logic.
├── store
│ ├── SqlStore.ts -- given a DB connection, issues queries and returns plain 'old objects. You could also go nuts and define these as interfaces alongside concrete instances to allow for mocked instances in tests or pre-prod envs.
│ └── ObjectStore.ts -- given object store client, issues requests to CRUD files, returns plain 'old objects
├── app.ts - this is all the stuff that your app can do. Wires together `core` and `store`, gets used
└── cmd - all interaction ingress/egress. It's how your app gets used.
├── cli
│ └── index.ts -- do all the CLI flag parsing in here, calls functions on App
├── http
└── index.ts -- do all the HTTP req/res flag parsing in here, calls functions on App
root
may be the actual src/
root of the project. Your project may also contain multiple of these that encapsulate different application "domains" in a single project. In that case, you may move cmd
up a level and wire together multiple app
s.