nameencore-servicedescriptionPlan how to split an Encore.ts application into services and lay out its directory structure. Architecture and decomposition, not first-time CLI install (that's `encore-getting-started`).when_to_useUser is deciding monolith vs. microservices, weighing "one service or several", drawing service boundaries, planning a multi-service system (e.g. orders + payments + inventory + shipping), creating an `encore.service.ts`, naming directories/folders, designing systems-of-services hierarchies, or asking for an application architecture / project layout recommendation. Trigger phrases: "lay out the directories", "directory structure", "service boundaries", "one service or several", "monolith vs microservices", "where to put", "systems of services".
Encore Service Structure
Instructions
Creating a Service
Every Encore service needs an encore.service.ts file:
typescript
// encore.service.ts
import { Service } from "encore.dev/service";
export default new Service("my-service");
Minimal Service Structure
text
my-service/
├── encore.service.ts # Service definition (required)
├── api.ts # API endpoints
└── db.ts # Database (if needed)
Application Patterns