# drremain/cyber-ecosystem architecture

> Architecture diagram of the GitHub repository drremain/cyber-ecosystem, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/drremain/cyber-ecosystem
- Repository: https://github.com/drremain/cyber-ecosystem

## Overview

Cyber Ecosystem is a contract-first full-stack skeleton: protobuf contracts define service APIs, a Go system service implements identity and administration capabilities, and a TanStack Start admin console exposes them. The primary workflow runs from an administrator through routed console features and generated RPC clients to the Go transport, domain use cases, persistence, and infrastructure. The README documents this layering and the generated contract consumers; sampled source excerpts are limited, so unverified implementation-level links are omitted.

Main entry points: [`app/services/system/internal/module`](https://github.com/drremain/cyber-ecosystem/tree/main/app/services/system/internal/module) (Domain modules), [`app/clients/admin/src/routes`](https://github.com/drremain/cyber-ecosystem/tree/main/app/clients/admin/src/routes) (Admin routes), [`app/clients/admin/src/features`](https://github.com/drremain/cyber-ecosystem/tree/main/app/clients/admin/src/features) (Admin features), [`app/services/system/internal/platform`](https://github.com/drremain/cyber-ecosystem/tree/main/app/services/system/internal/platform) (Platform facade)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_contracts["Contracts and clients"]
  node_proto["Protobuf contracts"]
  node_connectgen["Connect bindings"]
  node_openapigen["OpenAPI client"]
end

subgraph group_console["Admin console"]
  node_adminroutes["Admin routes"]
  node_adminfeatures["Admin features"]
  node_adminmodules["Admin modules"]
  node_connectclient["Connect client"]
  node_consolebase["Console foundations"]
  node_sharedts["Shared TypeScript libraries"]
end

subgraph group_service["System service"]
  node_transport["RPC transports"]
  node_domainmodules["Domain modules"]
  node_authz["Authorization engine"]
  node_filehandling["File services"]
end

subgraph group_platform["Persistence and capabilities"]
  node_platformfacade["Platform facade"]
  node_entstore[("Ent persistence")]
  node_capabilities["Infrastructure capabilities"]
end

node_admin(("Administrator"))
node_externalinfra[("Backing infrastructure")]

node_proto -->|"defines bindings"| node_connectgen
node_proto -->|"defines API"| node_openapigen
node_admin -.->|"uses console"| node_adminroutes
node_adminroutes -.->|"routes to"| node_adminfeatures
node_adminfeatures -.->|"presents"| node_adminmodules
node_adminmodules -.->|"requests data"| node_connectclient
node_connectclient -.->|"uses bindings"| node_connectgen
node_adminroutes -.->|"uses foundations"| node_consolebase
node_connectgen -.->|"calls services"| node_transport
node_transport -->|"dispatches RPCs"| node_domainmodules
node_domainmodules -.->|"delegates checks"| node_authz
node_domainmodules -.->|"handles files"| node_filehandling
node_domainmodules -->|"uses ports"| node_platformfacade
node_platformfacade -->|"accesses data"| node_entstore
node_platformfacade -->|"uses capabilities"| node_capabilities
node_capabilities -.->|"connects backends"| node_externalinfra
node_adminfeatures -.->|"uses shared tools"| node_sharedts

click node_proto "https://github.com/drremain/cyber-ecosystem/tree/main/proto"
click node_connectgen "https://github.com/drremain/cyber-ecosystem/tree/main/gen/connect-ts"
click node_openapigen "https://github.com/drremain/cyber-ecosystem/tree/main/gen/openapi-ts"
click node_adminroutes "https://github.com/drremain/cyber-ecosystem/tree/main/app/clients/admin/src/routes"
click node_adminfeatures "https://github.com/drremain/cyber-ecosystem/tree/main/app/clients/admin/src/features"
click node_adminmodules "https://github.com/drremain/cyber-ecosystem/tree/main/app/clients/admin/src/features/modules"
click node_connectclient "https://github.com/drremain/cyber-ecosystem/tree/main/app/clients/admin/src/services/connect"
click node_consolebase "https://github.com/drremain/cyber-ecosystem/tree/main/app/clients/admin/src/domains"
click node_transport "https://github.com/drremain/cyber-ecosystem/tree/main/app/services/system/internal/server"
click node_domainmodules "https://github.com/drremain/cyber-ecosystem/tree/main/app/services/system/internal/module"
click node_authz "https://github.com/drremain/cyber-ecosystem/tree/main/app/services/system/internal/module/authz"
click node_filehandling "https://github.com/drremain/cyber-ecosystem/tree/main/app/services/system/internal/module/fileproxy"
click node_platformfacade "https://github.com/drremain/cyber-ecosystem/tree/main/app/services/system/internal/platform"
click node_entstore "https://github.com/drremain/cyber-ecosystem/tree/main/app/services/system/internal/ent"
click node_capabilities "https://github.com/drremain/cyber-ecosystem/tree/main/shared-go/capability"
click node_sharedts "https://github.com/drremain/cyber-ecosystem/tree/main/shared-ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_proto,node_connectgen,node_openapigen toneBlue
class node_adminroutes,node_adminfeatures,node_adminmodules,node_connectclient,node_consolebase,node_sharedts,node_externalinfra toneAmber
class node_transport,node_domainmodules,node_authz,node_filehandling toneMint
class node_platformfacade,node_entstore,node_capabilities toneRose
class node_admin toneIndigo
```

## Components

### Contracts and clients

- [Protobuf contracts](https://github.com/drremain/cyber-ecosystem/tree/main/proto): `proto`
- [Connect bindings](https://github.com/drremain/cyber-ecosystem/tree/main/gen/connect-ts): `gen/connect-ts`
- [OpenAPI client](https://github.com/drremain/cyber-ecosystem/tree/main/gen/openapi-ts): `gen/openapi-ts`

### Admin console

- [Admin routes](https://github.com/drremain/cyber-ecosystem/tree/main/app/clients/admin/src/routes): `app/clients/admin/src/routes`
- [Admin features](https://github.com/drremain/cyber-ecosystem/tree/main/app/clients/admin/src/features): `app/clients/admin/src/features`
- [Admin modules](https://github.com/drremain/cyber-ecosystem/tree/main/app/clients/admin/src/features/modules): `app/clients/admin/src/features/modules`
- [Connect client](https://github.com/drremain/cyber-ecosystem/tree/main/app/clients/admin/src/services/connect): `app/clients/admin/src/services/connect`
- [Console foundations](https://github.com/drremain/cyber-ecosystem/tree/main/app/clients/admin/src/domains): `app/clients/admin/src/domains`
- [Shared TypeScript libraries](https://github.com/drremain/cyber-ecosystem/tree/main/shared-ts): `shared-ts`

### System service

- [RPC transports](https://github.com/drremain/cyber-ecosystem/tree/main/app/services/system/internal/server): `app/services/system/internal/server`
- [Domain modules](https://github.com/drremain/cyber-ecosystem/tree/main/app/services/system/internal/module): `app/services/system/internal/module`
- [Authorization engine](https://github.com/drremain/cyber-ecosystem/tree/main/app/services/system/internal/module/authz): `app/services/system/internal/module/authz`
- [File services](https://github.com/drremain/cyber-ecosystem/tree/main/app/services/system/internal/module/fileproxy): `app/services/system/internal/module/fileproxy`

### Persistence and capabilities

- [Platform facade](https://github.com/drremain/cyber-ecosystem/tree/main/app/services/system/internal/platform): `app/services/system/internal/platform`
- [Ent persistence](https://github.com/drremain/cyber-ecosystem/tree/main/app/services/system/internal/ent): `app/services/system/internal/ent`
- [Infrastructure capabilities](https://github.com/drremain/cyber-ecosystem/tree/main/shared-go/capability): `shared-go/capability`

### Other components

- **Administrator**
- **Backing infrastructure**

## Connections

- Protobuf contracts → Connect bindings: defines bindings
- Protobuf contracts → OpenAPI client: defines API
- Administrator → Admin routes: uses console
- Admin routes → Admin features: routes to
- Admin features → Admin modules: presents
- Admin modules → Connect client: requests data
- Connect client → Connect bindings: uses bindings
- Admin routes → Console foundations: uses foundations
- Connect bindings → RPC transports: calls services
- RPC transports → Domain modules: dispatches RPCs
- Domain modules → Authorization engine: delegates checks
- Domain modules → File services: handles files
- Domain modules → Platform facade: uses ports
- Platform facade → Ent persistence: accesses data
- Platform facade → Infrastructure capabilities: uses capabilities
- Infrastructure capabilities → Backing infrastructure: connects backends
- Admin features → Shared TypeScript libraries: uses shared tools
