Skip to content

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

ServiceREST PortgRPC PortDomain
Auth30205020Core
Domain30305030Core
Context30405040Core
Essential30505050Core
Identity30805080Core
Financial30605060Business
Career31405140Business
Special30905090Business
Touch31005100Business
Content31105110Business
Logistic31205120Business
Conjoint31305130Business
General30705070Business
Thing31505150Business

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 stubs

Scope Naming Convention

Required scopes follow the pattern {action}:{service}:{collection}:

read:identity:users       → ReadIdentityUsers
write:financial:accounts  → WriteFinancialAccounts
manage:auth:apts          → ManageAuthApts

The 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    # financial

Example response:

json
{
  "status": "ok",
  "info": {
    "mongodb": { "status": "up" },
    "redis": { "status": "up" },
    "kafka": { "status": "up" }
  }
}