Loading...
Loading...
Understand Steedos Server (builder6/server) architecture. NestJS 11 + Moleculer 0.14 hybrid backend with Express middleware, Socket.IO real-time, Redis sessions/caching, and ObjectQL data access. Covers module organization, bootstrap sequence, middleware stack, guards, dependency injection, and builder6 package ecosystem (@builder6/core, moleculer, tables, files, rooms, pages, oidc, etc.).
npx skill4agent add steedos/steedos-platform server-architecturebuilder6/server@nestjs/websockets@steedos/objectqlconnect-redisioredis@builder6/core/api/v6builder6/server/
├── package.json # @steedos/server v3.0.x
├── default.steedos.settings.yml # Default configuration template
├── steedos-config.yml # Project-level config (optional)
├── plugins/ # Dynamic plugin directory
└── src/
├── main.ts # Entry point → calls bootstrap()
├── bootstrap.ts # App creation, middleware, Swagger, static files
├── app.module.ts # Root NestJS module (25+ imports)
├── app.controller.ts # Health checks, public settings
├── app.gateway.ts # WebSocket gateway (Socket.IO)
├── app.moleculer.ts # Moleculer service definition + events
├── config/
│ ├── index.ts # Config export (getConfigs, getMoleculerConfigs)
│ ├── steedos.config.ts # YAML config loader with env interpolation
│ └── moleculler.config.ts # Moleculer broker settings
├── api/
│ ├── api.module.ts # API module
│ └── data/
│ ├── data.controller.ts # CRUD at /api/v6/data/:objectName
│ └── data.service.ts # ObjectQL data access
├── objects/
│ ├── objects.module.ts # Objects module
│ ├── objects.controller.ts # GET /api/v6/objects/:objectApiName
│ ├── objects.service.ts # ObjectQL schema access + function runner
│ └── functions.controller.ts # GET|POST /api/v6/functions/:obj/:func
└── workflow/
├── workflow.module.ts # Workflow module
├── file.controller.ts # File upload endpoint
├── file.service.ts # File processing
└── file.moleculer.ts # Moleculer file serviceAppModule| Module | Package | Purpose |
|---|---|---|
| | Environment/config loading |
| | Structured logging |
| | Cron/task scheduling |
| | Moleculer broker integration |
| | Authentication guards + strategies |
| | MongoDB connection management |
| | Core Steedos metadata + ObjectQL |
| | Data table management |
| | File upload/download |
| | Email services |
| | Micro page management |
| | Real-time collaboration rooms |
| | Microservice management |
| | SharePoint integration |
| | OpenID Connect client |
| | Office document editing |
| | Documentation services |
| | AI features |
| | Dynamic plugin loading |
| | Inter-service communication |
| (local) | REST data API |
| (local) | Object metadata + functions API |
| (local) | File upload workflow |
main.ts → bootstrap()
1. NestFactory.create<NestExpressApplication>(AppModule)
2. Connect Redis cluster microservice transport
3. Set up Logger (pino), GlobalFilters (AllExceptionsFilter)
4. Set up HybridAdapter for WebSocket
5. Enable CORS (all origins, credentials: true)
6. Create Redis session store
7. Apply Express middleware stack (see below)
8. Configure Swagger at /api/v6
9. Set up cloud proxy if STEEDOS_CLOUD_URL is set
10. Start all microservices
11. Mount static router (@steedos/router)
12. Serve @steedos/webapp SPA (frontend routes → index.html)
13. Listen on B6_PORT (default: 5100)connect-redissteedos-session:cookie-parserexpress.json()express.urlencoded()compression()http-proxy-middlewareSTEEDOS_CLOUD_URL/api/cloud@steedos/router@steedos/webappBUILDER6_PUBLIC_SETTINGS| Guard | Package | Usage |
|---|---|---|
| | Applied to all data/objects/functions controllers |
| | Available for admin-only endpoints |
X-Space-IdX-Auth-Token@steedos/objectqlimport { getObject } from "@steedos/objectql";
const obj = getObject("orders");
await obj.find(query, userSession);
await obj.findOne(id, userSession);
await obj.insert(doc, userSession);
await obj.update(id, data, userSession);
await obj.delete(id, userSession);
await obj.runFunction(functionApiName, params, userSession);userSession| Edition | Condition | Services |
|---|---|---|
| Community (ce) | Default | |
| Enterprise (ee) | | + |
| Cloud | | Same as Enterprise |
# Build
nest build
# Development with hot reload
nest start --watch
# Debug mode
nest start --debug --watch
# Production
node dist/main
# Lint
eslint "{src,apps,libs,test}/**/*.ts" --fix
# Format
prettier --write "src/**/*.ts"
# Moleculer REPL (debugging)
moleculer connect --config ./steedos.config.js