API Overview
Architecture of the Express and Hono backends in create-light-stack.
Introduction
create-light-stack generates a robust, type-safe API located at apps/api. You can choose between:
- Express – The battle-tested standard for Node.js.
- Hono – A lightweight, ultrafast alternative (great for edge compatibility).
Regardless of your choice, the internal architecture remains consistent, making it easy to switch or scale.
Directory Structure
The API follows a strict Controller-Service-Route pattern to keep logic organized.
apps/api/src/
├── controllers/ # Request handlers (CRUD logic)
├── middleware/ # Error handling & Logging
├── routes/ # URL definitions
├── utils/ # Helper classes (AppError)
└── index.ts # Entry point & Server setup