- This folder structure is solid and covers most aspects of a well-organized Node.js, Express, TypeScript application.
-
config: Contains configuration files for the application.
-
constants: Holds constant values used throughout the application.
-
controllers: Contains the controller logic for handling requests and responses.
-
interfaces: Defines TypeScript interfaces used across the application.
-
middlewares: Houses custom middleware functions.
-
models: Defines data models and schemas.
-
repository: Contains data access logic.
-
routes: Defines the API routes and their corresponding controllers.
-
services: Implements core business logic.
-
utils: Stores utility functions and helper modules.
-
validators: Contains input validation logic.
-
app.ts: The main Express application setup file.
-
index.ts: The entry point of the application.