r/typescript • u/theodordiaconu • Sep 02 '25
How do you separate concerns/domains in large apps?
I am aware this is not TS related but this is one of the saner more mature subs. Feels like an interesting discussion. If it gets removed I’ll try elsewhere.
- Do you keep your entities in one place or spread across domains? My case: one place near migrations. Persistence layer is one thing, interfaces are still designed in each domain and the db references them.
- Do you treat api as a separate higher level infrastructure concern or is it a sibling of other modules such as “projects” (imagining a PM SaaS) My case: siblings. As the api routes to domain actions.
- If you separate concerns how do separate domains talk to each other, do you tightly coupled them (provided they are used only in this app) or you try to have a public interface which lets you talk to your domain?
I am not referring here to DDD design when talking about domains just the word feels right instead of module/bundle.
4) When using an http api like REST do you use true REST or treat it more rpc style where a single find might return related data needed for clients.
