├─lib —utils, bussiness logic agnostic components ├─main —entey, layout, router, global config ├─modules —domain folder │ ├─auth —auth domain │ │ ├─adts —adapters │ │ ├─apps —application │ │ ├─cpts —components │ │ └─models —business logic │ └─todo —todo domain │ ├─adts │ ├─apps │ ├─cpts │ └─models └─pages

One user case function one file

this will be good for test and statistics.

Split files by entity when nessary

For example, if there are many entities in a damain, you can split split files by entities:

apps: apps/todo/add.ts, apps/todo/del.ts, apps/order/create.ts. api: api/todo.ts, api/order.ts`

All folders follow the sam pattern.

Keep filenames brief

As domain layers is splited by entities, there is no nessary put entity name into filename,todo/add.ts is be better then add_todo.ts.

Cpts and Pages

Every domain shoud have a cpts folder to put compontents belong to that domain, and pages folders will consumer these components to form a page. Because one page can have relations with many domain, think about a dashboard page.