You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> 💡 **Note:** While the repository name references `ts-node` (the original implementation), the project now uses [tsx](https://github.com/privatenumber/tsx) for faster, cleaner TypeScript execution without experimental flags.
classDef support fill:#fff3cc,stroke:#f0c040,stroke-width:2px,color:#555,font-family:monospace;
153
+
classDef infra fill:#ffcccc,stroke:#ff8f8f,stroke-width:2px,color:#555,font-family:monospace;
143
154
classDef test fill:#ccffcc,stroke:#53c45e,stroke-width:2px,color:#555,font-family:monospace;
144
155
145
156
class server,app,routes,controllers,services,database,models core
146
-
class Express,Sequelize,nodeCache deps
157
+
class docs support
158
+
class Express,Sequelize,nodeCache infra
147
159
class tests test
148
160
```
149
161
150
-
_Simplified, conceptual project structure and main application flow. Not all dependencies are shown._
162
+
**Arrow Semantics:** Arrows point from a dependency toward its consumer. Solid arrows (`-->`) denote strong (functional) dependencies: the consumer actively invokes behavior — calling methods, executing queries, or handling HTTP requests. Dotted arrows (`-.->`) denote soft (structural) dependencies: the consumer only references types or function signatures, without invoking runtime behavior. This distinction is grounded in UML's «use» dependency notation and classical coupling theory (Myers, 1978): strong arrows approximate control or stamp coupling, while soft arrows approximate data coupling, where only shared data structures cross the boundary.
163
+
164
+
**Composition Root Pattern:**[`server`](src/server.ts) acts as the composition root — all solid arrows originate from it, reflecting that it is the sole site where dependencies are instantiated, wired, and injected. It creates the Express application instance, initializes the database connection, and registers all routes. This pattern enables dependency injection, improves testability, and ensures that no other package bears responsibility for object creation or lifecycle management.
165
+
166
+
**Layered Architecture:** The codebase is organized into four conceptual layers: HTTP ([`routes`](src/routes/), [`controllers`](src/controllers/)), Business ([`services`](src/services/)), Data ([`database`](src/database/)), and Infrastructure (`Express`, `Sequelize`). The [`models`](src/models/) package is a cross-cutting type concern — it defines shared data structures consumed across all layers via soft (structural) dependencies, without containing logic or behavior of its own. Strong dependencies flow strictly downward through the layers, preserving the layer rule: no layer reaches upward to invoke behavior in a layer above it.
167
+
168
+
**Color Coding:** Core packages (blue) implement the application logic, supporting features (yellow) provide documentation and utilities, external dependencies (red) are third-party frameworks and ORMs, and tests (green) ensure code quality.
0 commit comments