Services
Wenex Platform consists of 14 domain microservices. All services are NestJS applications that expose a REST API and a gRPC server.
Architecture Summary
Service Index
| Service | REST Port | gRPC Port | Domain |
|---|---|---|---|
| Auth | 3020 | 5020 | Core |
| Domain | 3030 | 5030 | Core |
| Context | 3040 | 5040 | Core |
| Essential | 3050 | 5050 | Core |
| Identity | 3080 | 5080 | Core |
| Financial | 3060 | 5060 | Business |
| Career | 3140 | 5140 | Business |
| Special | 3090 | 5090 | Business |
| Touch | 3100 | 5100 | Business |
| Content | 3110 | 5110 | Business |
| Logistic | 3120 | 5120 | Business |
| Conjoint | 3130 | 5130 | Business |
| General | 3070 | 5070 | Business |
| Thing | 3150 | 5150 | Business |
Standard Service Internals
Every microservice follows the same internal structure:
apps/services/<name>/src/
├── main.ts # Starts REST listener + gRPC server
├── app.module.ts # Root module: DB connection, imported modules
├── app.service.ts # Health checks, initialization
├── modules/
│ └── <entity>/
│ ├── <entity>.module.ts
│ ├── <entity>.controller.ts # REST (also consumed by gateway via gRPC)
│ ├── <entity>.service.ts # Business logic + gRPC handler
│ ├── <entity>.repository.ts # Typegoose (MongoDB) queries
│ ├── <entity>.schema.ts # Mongoose schema definition
│ └── dto/
│ ├── create-<entity>.dto.ts
│ ├── update-<entity>.dto.ts
│ └── <entity>.serializer.ts
└── protobuf/ # Generated gRPC TypeScript stubsScope Naming Convention
Required scopes follow the pattern {action}:{service}:{collection}:
read:identity:users → ReadIdentityUsers
write:financial:accounts → WriteFinancialAccounts
manage:auth:apts → ManageAuthAptsThe manage: prefix grants all read, write, and destructive actions including destroy and bulk operations.
Health Checks
Every service exposes GET /status with checks for its dependencies:
bash
curl http://localhost:3020/status # auth
curl http://localhost:3080/status # identity
curl http://localhost:3060/status # financialExample response:
json
{
"status": "ok",
"info": {
"mongodb": { "status": "up" },
"redis": { "status": "up" },
"kafka": { "status": "up" }
}
}