Bedstack Lite is a distilled version of the full Bedstack architecture. It keeps the feature-sliced, modular structure but simplifies the layering for rapid prototyping.
Each feature is self-contained and designed for clarity, fast development, and maintainability - without the overhead of full enterprise layering.
-
Keep the structure familiar by following the same horizontal layout as Bedstack (one folder per domain feature).
-
Collapse vertical layers by combining controller, service, and repository logic in a single plugin file.
-
Prioritize speed-to-code by minimizing boilerplate and maximizing clarity.
-
Maintain modularity by keeping each domain isolated and portable.
Each domain entity (e.g. articles/, comments/, users/) looks like this:
entities/
├── plugin.ts # Unified entry point (controller + service + repo)
├── schema.ts # Drizzle ORM schema
├── model.ts # TypeBox DTOs (request/response shapes)
├── interfaces/ # TypeScript types and interfaces
│ └── article.interface.ts
├── mappers/ # Small helper mappers (if needed)
│ └── to-article.dto.ts
Note
Notice the usage of entities instead of entity - this is on purpose. We follow the NestJS convention of pluralizing the entity in the folder and filenames.
Controller, service, and repository - all in one file.
Defines routes, handles logic, and interacts with the database, powered by ElysiaJS.
Database tables and relations using Drizzle ORM.
DTOs defined with Elysia.t (a thin wrapper around TypeBox), with types inferred automatically.
Example:
export const CreateArticle = t.Object({
title: t.String(),
body: t.String(),
});
export type CreateArticle = typeof CreateArticle.static;Domain models and type definitions.
Example: Article, ArticleRow, etc.
Map between DB rows and DTOs (e.g. camelCase conversion, date formatting).
Note
Bedstack Lite has much fewer mappers than the full Bedstack - since there are fewer layers.
src/
├── articles/ # Domain entity
├── comments/ # Domain entity
├── users/ # Domain entity
├── profiles/ # Domain entity
├── tags/ # Domain entity
├── core/ # Core (app, db, env, core plugins)
├── shared/ # Shared constants, utils, types, plugins, etc.
├── index.ts # Main entry point, mounts plugins
drizzle/ # Migrations, reset, seed
-
Internal tools
-
MVPs and prototypes
-
Hackathons or proof-of-concept apps
-
Fast experimentation with full-stack logic
-
Large-scale systems with deep domain logic
-
Complex business rules requiring separation of concerns
-
Teams that need fine-grained testing or enterprise observability