io.github.apolocine/mosta-net
1 MCP server, 13 databases, zero config. Multi-protocol transport with Auth + RBAC.
Ask AI about io.github.apolocine/mosta-net
Powered by Claude ยท Grounded in docs
I know everything about io.github.apolocine/mosta-net. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
@mostajs/net โ Octonet
One schema, 11 transports, 13 databases, multi-tenant auth โ out of the box. Schema-driven multi-protocol API server for the @mostajs ecosystem. Built with TypeScript on Fastify, designed for polyglot consumption (14 native NetClients).
Author : Dr Hamid MADANI <drmdh@msn.com> Homepage : octonet.amia.fr ยท mcp.amia.fr
Table of Contents
- What is Octonet
- Try in 2 clicks (T1 sandbox)
- 3-tier onboarding model
- 11 transports
- 13 databases
- Multi-tenant authentication
- Generic scope registry
- Multi-project support
- Quick start (self-host)
- Configuration (.env)
- API endpoints reference
- Architecture
- Boot sequence
- 14 polyglot NetClients
- Production deploy (amia.fr)
- License
What is Octonet
Octonet (@mostajs/net) is a Node.js multi-transport server that exposes a single @mostajs/orm schema as 11 different network protocols simultaneously : REST, GraphQL, WebSocket, SSE, JSON-RPC, MCP, gRPC, tRPC, OData, NATS, Arrow Flight.
The same User entity is reachable as :
curl https://octonet.amia.fr/api/v1/User # REST
curl https://octonet.amia.fr/graphql -d '{"query":...}' # GraphQL
wscat -c wss://octonet.amia.fr/ws # WebSocket
curl -N https://octonet.amia.fr/mcp # MCP (Claude Desktop)
# โฆ 7 more
Backed by @mostajs/orm (13 SGBD dialects). Backed by @mostajs/rbac + @mostajs/auth + @mostajs/api-keys for multi-tenant identity. Backed by @mostajs/mproject for multi-project routing.
Octonet is the second cerebral lobe of the @mostajs trilogy :
- #1 โ
@mostajs/orm: data persistence (13 databases) - #2 โ Octonet : multi-protocol transport (11 wire protocols)
- #3 โ NetClients polyglottes : 14 native client libraries (Java, .NET, Python, Go, Swift, Kotlin, Dart, Rust, PHP, Ruby, Elixir, Lua, Delphi, Unity)
Try in 2 clicks (T1 sandbox)
The fastest way to test Octonet from any of the 14 runtimes :
- Open https://octonet.amia.fr/try
- Pick an alias (e.g.
alice-42) - Get an apikey scoped to your sandbox
curl -X POST https://octonet.amia.fr/try \
-H "Content-Type: application/json" \
-d '{"alias":"alice-42"}'
# Response:
{
"status": "ok",
"data": {
"alias": "alice-42",
"projectSlug": "sandbox-alice-42",
"apiKey": "sk_test_โฆ(64 chars, shown ONCE)",
"permissions": { "projects":["sandbox-alice-42"], "operations":["read","write"], "transports":["rest","mcp"] },
"expiresAt": "2026-05-02T18:38:19.920Z",
"quota": { "reqPerDay": 500 },
"exampleCurl": "curl https://octonet.amia.fr/api/v1/sandbox-alice-42/User -H \"X-API-Key: sk_test_โฆ\"",
"mcpUrl": "https://octonet.amia.fr/mcp"
}
}
Your sandbox is :
- A private SQLite file (isolated from other aliases)
- Pre-seeded with
User,Product,Orderentities - Read+write CRUD via REST and MCP
- 500 requests/day quota
- TTL 7 days (auto-deleted if idle)
- Free, no email required, anti-abuse rate-limited (10 sandboxes/h/IP)
Use the apikey in any of the 14 NetClients :
# Java / .NET / Python / Go / etc.
export MOSTAJS_NET_URL=https://octonet.amia.fr
export MOSTAJS_NET_API_KEY=sk_test_โฆ
3-tier onboarding model
| Tier | Cible | Auth | Quota | Use case |
|---|---|---|---|---|
T1 โ Sandbox publique /try | "I want to test in 10 minutes" | alias seul (pas d'email) | 500 req/jour, TTL 7j | dรฉmo NetClients, intรฉgration tests |
| T2 โ Compte enregistrรฉ octocloud.amia.fr | "j'utilise vraiment, gratuit" | email + mot de passe | 10 000 req/jour | apps personnelles, side-projects |
T3 โ Self-host npx @mostajs/net init | "tes donnรฉes chez toi" | admin local | aucune | enterprise, on-premise, AGPL |
11 transports
Auto-generated from your registered schemas. Toggle each via env var (default : all enabled).
| # | Transport | Endpoint | Use case | Notes |
|---|---|---|---|---|
| 1 | REST | /api/v1/{Entity} ยท /api/v1/{project}/{Entity} | universel | 15 routes par entitรฉ (CRUD + count + search + aggregate + bulk + relations) |
| 2 | GraphQL | /graphql (POST) | front-end riches | schรฉma + GraphiQL IDE auto-gรฉnรฉrรฉs via mercurius |
| 3 | WebSocket | wss://โฆ/ws | temps rรฉel | events entity.created/updated/deleted/upserted broadcast |
| 4 | SSE | /events (GET stream) | mobile / browser-friendly | server-sent events |
| 5 | JSON-RPC | /rpc (POST) | EVM-adjacent, classic | JSON-RPC 2.0 + method discovery |
| 6 | MCP | /mcp (POST/GET SSE) | agents IA (Claude, ChatGPT) | 15 tools/entitรฉ auto-gรฉnรฉrรฉs (listed on mcp.so) |
| 7 | gRPC | :50051 | inter-services low-latency | .proto auto-gรฉnรฉrรฉ, 6 RPCs/entitรฉ |
| 8 | tRPC | /trpc/{Entity}.{op} | TypeScript fullstack | type generation cรดtรฉ client |
| 9 | OData | /odata/{Collection} (+ $metadata) | SAP/Microsoft Dynamics | OData v4 ($filter, $select, $orderby) |
| 10 | NATS | mostajs.{Entity}.{op} | pub/sub edge | request-reply messaging |
| 11 | Arrow Flight | /arrow/* | analytics columnaire | streaming zero-copy |
Le mรชme schรฉma, 11 portes d'entrรฉe diffรฉrentes, 0 codegen.
13 databases
Persistence dialects fournis par @mostajs/orm :
| Catรฉgorie | Bases | Dialect ID |
|---|---|---|
| SQL mainstream | PostgreSQL, MySQL, MariaDB, SQLite | postgres, mysql, mariadb, sqlite |
| SQL enterprise | Oracle, SQL Server, DB2, SAP HANA, HSQLDB, Sybase | oracle, mssql, db2, hana, hsqldb, sybase |
| NewSQL / Cloud | CockroachDB, Google Cloud Spanner | cockroachdb, spanner |
| NoSQL | MongoDB | mongodb |
Switch dialect = changer 1 ligne d'env :
DB_DIALECT=postgres โ DB_DIALECT=mongodb
SGBD_URI=postgresql://โฆ โ SGBD_URI=mongodb://โฆ
Multi-tenant authentication
Octonet utilise un middleware d'authentification basรฉ sur API keys avec scopes (orientรฉ machine-to-machine) + RBAC pour la gestion humaine. L'orchestrateur agnostique vit dans @mostajs/auth/lib/check-request.ts.
Flux d'auth d'une requรชte
HTTP Request
โ
โผ
authGuard (Fastify adapter)
โ
โผ
checkRequest (@mostajs/auth โ framework-agnostic)
โ
โโ extract X-API-Key from header / Bearer token / ?apikey=
โโ resolveApiKey (@mostajs/api-keys) โ DB lookup + bcrypt verify
โโ isScopeAuthorized (@mostajs/api-keys) โ check scope.values
โ for each (scope, value) pair :
โ checks: [{scope:'projects', value:slug},
โ {scope:'operations', value:'read'|'write'|'admin'},
โ {scope:'transports', value:'rest'|'mcp'|...}]
โโ touchApiKey โ fire-and-forget : lastUsedAt, usageCount, lastIp
โ
โผ
ormHandler (entitรฉ CRUD) โโ sanitizer (strip password/hash/tokens)
โ
โผ
HTTP Response
Scope-based permissions (generic, extensible)
Une apikey a la shape :
{
permissions: {
scopes: {
projects: ['my-project','demo'] | '*', // declared by @mostajs/mproject
operations: ['read','write','admin'] | '*', // declared by @mostajs/orm
transports: ['rest','graphql','mcp'] | '*', // declared by @mostajs/net
// anything: any module can register a new scope
},
rateLimit: 500,
}
}
@mostajs/api-keys ne connaรฎt PAS les noms projects/operations/transports โ c'est volontaire. Chaque module enregistre ses scopes au boot via registerScope(dialect, {name, label, โฆ}). Le check est gรฉnรฉrique : isScopeAuthorized(perms, scope, value).
HTTP status mapping
| Cas | HTTP code | Body |
|---|---|---|
| Pas d'apikey | 401 | {error: {code:'UNAUTHORIZED', message:'API key requiredโฆ'}} |
| Apikey invalide / rรฉvoquรฉe | 401 | {error: {code:'UNAUTHORIZED', message:'Invalid or revoked API key'}} |
| Apikey valide hors scope | 403 | {error: {code:'FORBIDDEN', message:'API key not authorized for X="Y"'}} |
| Apikey OK | 200/201 | {status:'ok', data: โฆ} (sanitized โ no password/hash) |
MCP fallback (compat mcp.so)
L'endpoint /mcp autorise un fallback automatique sur l'apikey labelรฉe public-default quand aucune clรฉ n'est prรฉsentรฉe โ prรฉserve la compat avec mcp.so / Claude Desktop. La clรฉ publique est read-only sur le projet default uniquement โ รฉcritures bloquรฉes.
Sanitizer
Les champs password, hash, verifyToken, resetToken, apiKeyHash, secret, privateKey sont automatiquement strippรฉs de toutes les rรฉponses JSON par un middleware global. Aucun risque de leak ร travers /api/v1/User?limit=1.
Generic scope registry
Le catalogue des scopes vit en base de donnรฉes du projet accueillant (pas de fichier JSON, pas de constantes hardcodรฉes) :
-- Auto-crรฉรฉes au boot via @mostajs/api-keys
CREATE TABLE api_key_scopes (
id, name, label, description, icon, cardinality,
valuesSource ('static' | 'dynamic'), dynamicSourceRef
);
CREATE TABLE api_key_scope_values (
id, scopeName, value, label, sortOrder, metadata
);
Chaque module enregistre ses scopes au boot :
import { registerScope } from '@mostajs/api-keys/server'
// Dans mosta-net/src/server.ts (boot)
await registerScope(dialect, {
name: 'transports', label: 'Network transports',
cardinality: 'low', valuesSource: 'static',
staticValues: [
{value:'rest', sortOrder:1},
{value:'graphql', sortOrder:2},
// โฆ 9 more
],
})
await registerScope(dialect, {
name: 'projects', label: 'Projects',
cardinality: 'high', valuesSource: 'dynamic',
dynamicSourceRef: 'Project.slug', // queried at runtime
})
L'admin UI charge le catalogue dynamique via GET /api/api-keys/scopes et rend une matrice (composant React ApiKeyScopeMatrix dans @mostajs/api-keys/components/).
Multi-project support
Via @mostajs/mproject โ N bases de donnรฉes isolรฉes sur le mรชme serveur.
Routes path-prefix
# Default project (DB_DIALECT + SGBD_URI au boot)
curl http://localhost:4488/api/v1/User
# Project nommรฉ 'analytics'
curl http://localhost:4488/api/v1/analytics/events
# Ou via header (รฉquivalent)
curl http://localhost:4488/api/v1/events -H "X-Project: analytics"
Ajouter un projet ร l'exรฉcution
curl -X POST http://localhost:4488/api/projects \
-H "X-API-Key: <admin-key>" \
-d '{
"name": "analytics",
"dialect": "mongodb",
"uri": "mongodb://localhost:27017/analytics",
"schemas": [{"name":"Event", "fields":{"type":"string","ts":"date"}}]
}'
Persistรฉ dans projects-tree.json (chemin : MOSTA_PROJECTS env var).
Quick start (self-host)
Install
npm install @mostajs/net @mostajs/orm @mostajs/mproject \
@mostajs/rbac @mostajs/auth @mostajs/api-keys \
@mostajs/config better-sqlite3
Run with SQLite (zero infra)
DB_DIALECT=sqlite \
SGBD_URI=./data/octonet.db \
DB_SCHEMA_STRATEGY=update \
OCTONET_ADMIN_EMAIL=admin@example.com \
OCTONET_ADMIN_PASSWORD=ChangeMe123! \
npx mostajs-net serve
Console output :
Loaded 3 schemas from schemas.json
[DAL:SQLite] INIT_SCHEMA strategy=update {"entities":["User","Product","Order"]}
โ Apikey scopes registered (projects, operations, transports)
โ RBAC ready โ admin=admin@example.com trial=โฆ public=โฆ
โ public demo apikey emitted ONCE โ sk_live_xxxxxxxxโฆ (save it!)
โ Sanitizer middleware on rest, graphql, ws, sse, trpc, mcp, odata, jsonrpc
โ ApiKey middleware on rest, graphql, ws, sse, trpc, mcp, odata, jsonrpc
โ Protected ormHandler ready (sanitizer + apikey global wrapper)
โ T1 sandbox endpoint /try ready (rate-limited 10/h/IP, TTL 7d)
@mostajs/net v2.6.x
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Dialect: sqlite (./data/octonet.db)
Entities: User, Product, Order (3)
Port: 4488
Strategy: update
Transports: rest, graphql, ws, sse, trpc, mcp, odata, jsonrpc (8)
Ready. 3 entities ร 8 transports = 24 endpoints
Test
# Sans apikey โ 401
curl http://localhost:4488/api/v1/User
# {"error":{"code":"UNAUTHORIZED","message":"API key requiredโฆ"}}
# Avec apikey publique (depuis les logs โ)
curl http://localhost:4488/api/v1/User -H "X-API-Key: sk_live_โฆ"
# {"status":"ok","data":[{"id":"โฆ","email":"admin@example.com",โฆ}]} โ password absent
Configuration (.env)
Database (mandatory)
DB_DIALECT=postgres # any of 13 dialects
SGBD_URI=postgresql://user:pass@localhost:5432/db
DB_SCHEMA_STRATEGY=update # 'update' (recommandรฉ prod) | 'create' (drop+recreate, dev only)
DB_SHOW_SQL=false
Server
MOSTA_NET_PORT=4488
MOSTA_PROJECTS=./projects-tree.json # path to multi-project config
SCHEMAS_PATH=./schemas # directory scanning fallback
Transports (toggle each)
MOSTA_NET_REST_ENABLED=true
MOSTA_NET_GRAPHQL_ENABLED=true
MOSTA_NET_WS_ENABLED=true
MOSTA_NET_SSE_ENABLED=true
MOSTA_NET_JSONRPC_ENABLED=true
MOSTA_NET_MCP_ENABLED=true
MOSTA_NET_TRPC_ENABLED=true
MOSTA_NET_ODATA_ENABLED=true
MOSTA_NET_GRPC_ENABLED=false
MOSTA_NET_NATS_ENABLED=false
MOSTA_NET_ARROW_ENABLED=false
MOSTA_NET_CORS_ORIGIN=*
MOSTA_RATE_LIMIT_CLIENT=1000
RBAC bootstrap (lus via @mostajs/config โ supports profile cascade MOSTA_ENV=DEV)
OCTONET_ADMIN_EMAIL=admin@example.com # 1er boot only ; ignored after
OCTONET_ADMIN_PASSWORD=secret-12345
OCTONET_ADMIN_FIRSTNAME=Admin # optional
OCTONET_ADMIN_LASTNAME=Octonet # optional
OCTONET_BOOTSTRAP_VERBOSE=false # detailed bootstrap logs
OCTONET_OPEN_MODE=false # dev only โ passe sans apikey
T1 sandbox (optional)
OCTONET_TRIAL_DATA_DIR=./data/trials # SQLite files per alias
Cloud middleware (optional, futur โ partage DB mรฉta avec Octocloud)
OCTONET_META_URI=postgresql://user:pass@localhost:5432/octonet_meta # shared meta DB
PORTAL_DB_URI=postgresql://user:pass@localhost:5432/octonet_cloud # legacy octocloud DB
API endpoints reference
Public
| Endpoint | Mรฉthode | Auth | Description |
|---|---|---|---|
/health | GET | open | server status + transports + entities |
/try | GET | open | T1 sandbox provisioning HTML form |
/try | POST | open (rate-limit 10/h/IP) | crรฉe sandbox + retourne apikey one-shot |
/api/v1/health | GET | open | health under api-versioned path |
Project / entity CRUD (requires apikey)
| Endpoint | Mรฉthode | Op | Description |
|---|---|---|---|
/api/v1/{Entity} | GET | findAll | list entities of default project |
/api/v1/{Entity}/:id | GET | findById | get one |
/api/v1/{Entity}/count | GET | count | count |
/api/v1/{Entity}/one | GET | findOne | first match |
/api/v1/{Entity}/search | GET | search | text search |
/api/v1/{Entity} | POST | create | insert |
/api/v1/{Entity}/:id | PUT | update | replace |
/api/v1/{Entity}/:id | DELETE | delete | remove |
/api/v1/{Entity}/:id/addToSet | POST | addToSet | add to array |
/api/v1/{Entity}/:id/pull | POST | pull | remove from array |
/api/v1/{Entity}/:id/increment | POST | increment | numeric add |
/api/v1/{Entity}/upsert | POST | upsert | insert or update |
/api/v1/{Entity}/aggregate | POST | aggregate | pipeline |
/api/v1/{Entity}/updateMany | POST | updateMany | bulk update |
/api/v1/{Entity}/deleteMany | POST | deleteMany | bulk delete |
/api/v1/{project}/{Entity}/โฆ | * | * | same routes scoped to a project |
Schema management (requires admin apikey)
| Endpoint | Mรฉthode | Description |
|---|---|---|
/api/upload-schemas-json | POST | push schemas at runtime (triggers reload) |
/api/apply-schema | POST | apply schema diff |
/api/compare-schema | POST | dry-run schema diff |
/api/schemas-config | GET | current registered schemas |
Auth & API keys (requires admin)
| Endpoint | Mรฉthode | Description |
|---|---|---|
/api/api-keys | GET / POST | list / issue keys |
/api/api-keys/:id | PUT / DELETE | update / revoke |
/api/api-keys/scopes | GET | list registered scopes + values (for admin matrix UI) |
/api/api-keys/scopes | POST | register a new scope (admin) |
/api/api-keys/scopes/:name/values | PUT / DELETE | manage scope values |
Transports natifs
| Endpoint | Description |
|---|---|
/graphql | GraphQL endpoint + GraphiQL IDE |
/ws | WebSocket connection (entity events) |
/events | SSE stream |
/rpc | JSON-RPC 2.0 |
/mcp | Model Context Protocol (Claude/Smithery/etc.) |
/trpc/{Entity}.{op} | tRPC procedure |
/odata/{Collection} ยท /odata/$metadata | OData v4 |
Multi-project management
| Endpoint | Mรฉthode | Description |
|---|---|---|
/api/projects | GET | list projects |
/api/projects | POST | add project |
/api/projects/:name | PUT / DELETE | edit / remove |
Observability
| Endpoint | Description |
|---|---|
/api/performance | live metrics (req/s, p50, p99) |
/api/config-tree | configuration tree (interactive) |
/api/live-log | streaming log feed |
Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Fastify (port 4488) โ
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Transports (11) โ โ Direct Fastify routes โ
โ - REST โ โ - /try โ
โ - GraphQL (mercurius) โ โ - /api/projects/* โ
โ - WS โ โ - /api/api-keys/* โ
โ - SSE โ โ - /health, /metrics โ
โ - JSON-RPC โ โโโโโโโโโโโโโโโโโโโโโโโโโโ
โ - MCP (SDK Anthropic) โ
โ - gRPC โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ - tRPC โ โ Auth pipeline โ
โ - OData โ โ โโโโโโโโโโโโโโโโ โ
โ - NATS โ โ โ extractAuth โ โ HTTP request โ
โ - Arrow โโโโโโโโโโโโโโโโค โ Context โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโ โ โโโโโโโโฌโโโโโโโโ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโ โ
โ โ checkRequest โ โ scope-checks โ
โ โ (mosta-auth) โ โ
โ โโโโโโโโฌโโโโโโโโ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโ โ
โ โ checkApiKey โ โ resolve+verify โ
โ โ (api-keys) โ โ
โ โโโโโโโโฌโโโโโโโโ โ
โโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Sanitizer middleware โ
โ strips password/hash/ โ
โ tokens before response โ
โโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ormHandler โ
โ โ ProjectManager.resolveโ
โ โ EntityService.execute โ
โโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโ
โ @mostajs/orm dialect โ
โ (13 SGBD) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโ
Modules de l'รฉcosystรจme consommรฉs
| Module | Rรดle dans Octonet |
|---|---|
@mostajs/orm | persistance (13 dialects) |
@mostajs/mproject | gestion multi-projet (default + sandbox + abonnรฉs) |
@mostajs/rbac | identitรฉ (User, Role, Permission, Account) + AccountSchema + OCTONET_RBAC_SEED |
@mostajs/auth | checkRequest orchestrateur framework-agnostic, hashPassword |
@mostajs/api-keys | apikey CRUD + scopes (Scope/ScopeValue schemas) + checkApiKey + ApiKeyScopeMatrix admin UI |
@mostajs/config | env var helper avec cascade MOSTA_ENV |
@mostajs/cloud-middleware | quota / abonnement (optionnel โ actif si Octocloud connectรฉ) |
@mostajs/replicator | CQRS multi-replica (optionnel) |
@mostajs/project-life | persistence schemas Project (optionnel โ si stockage SGBD vs JSON) |
Boot sequence
- Load
.envvia@mostajs/config(profile cascadeMOSTA_ENV) - Connect main dialect (
SGBD_URI) - Load schemas (priority :
getAllSchemas()registry โschemas.jsonโSCHEMAS_PATHdirectory scan) dialect.initSchema(schemas)with strategyupdate/create- Bootstrap RBAC (
octonet-rbac-bootstrap.ts) :- register UserSchema/RoleSchema/PermissionSchema/PermissionCategorySchema/AccountSchema/ApiKeySchema
seedRBAC(OCTONET_RBAC_SEED)โ 6 categories, 25 permissions, 4 roles (admin/subscriber/trial/public)createAdmin()fromOCTONET_ADMIN_EMAIL/PASSWORD- create Account
trial-playground(type='trial') - create User
public-demo(role=public) - create Account
public-system(type='system') - generate ApiKey
public-defaultscoped todefaultproject (read-only, REST + MCP) โ emitted ONCE in clear
- Register canonical scopes :
projects(dynamic,Project.slug),operations(static : read/write/admin),transports(static : 11 values) - Push default project to
projects-tree.json(ownerId=admin, visibility=public) - Load additional projects from
projects-tree.json - Wrap ormHandler with
composeMiddleware([sanitizer, apikey], ormHandler)โprotectedOrmHandler - Start each enabled transport :
transport.use(loggingMiddleware)transport.use(sanitizerMiddleware)transport.use(apiKeyMiddleware)transport.setHandler(ormHandler)transport.start(config)
- Register Fastify routes :
registerDynamicRestRoutes(app, protectedOrmHandler, pm)โ/api/v1/...registerProjectRoutes(app, pm, protectedOrmHandler)โ/:project/*registerTryRoutes(app, {dialect, pm})โ/tryPOSTregisterTryPage(app)โ/tryGET (HTML)startTrialCleanupJob({dialect, pm})โ cron horaire TTL 7j
- Listen on port (
MOSTA_NET_PORT)
14 polyglot NetClients
Octonet est consommable depuis 14 runtimes natifs, avec la mรชme apikey, la mรชme URL :
| Runtime | Package | Registre |
|---|---|---|
| Node/TS | @mostajs/net/client (built-in) | npm |
| Java | com.mostajs:mostajs-net-client | Maven Central |
| Java + Spring Boot | com.mostajs:mostajs-net-client-spring-boot-starter | Maven Central |
| .NET | MostaJs.Net.Client | NuGet |
| Python | mostajs-net-client | PyPI |
| Go | github.com/apolocine/mosta-net-client-go | pkg.go.dev |
| Swift | mosta-net-client-swift | Swift Package Index |
| Kotlin | io.github.apolocine:mostajs-net-client-kt | Maven Central |
| Dart / Flutter | mostajs_net_client | pub.dev |
| Rust | mostajs-net-client | crates.io |
| PHP | mostajs/net-client | Packagist |
| Ruby | mostajs-net-client | RubyGems |
| Elixir | mostajs_net_client | Hex.pm |
| Lua | mostajs-net-client | LuaRocks |
| Delphi | MostaJsNetClient | GetIt |
| Unity (C#) | com.mostajs.net-client | OpenUPM |
Monorepo : github.com/apolocine/mosta-net-clients
Chaque NetClient suit le mรชme contrat d'API :
NetClient.create()
.url(...)
.apiKey(...)
.build()
.findAll(entity, filter, options)
.findById(entity, id)
.create(entity, data)
.update(entity, id, data)
.delete(entity, id)
.uploadSchemasJson(schemas)
.health()
Production deploy (amia.fr)
Le dรฉploiement de rรฉfรฉrence tourne sur octonet.amia.fr + mcp.amia.fr (alias compat) en backend PostgreSQL :
| URL | Rรดle |
|---|---|
https://octonet.amia.fr | Octonet server (REST, MCP, GraphQL, WS, SSE, tRPC, OData, JSON-RPC) |
https://mcp.amia.fr | alias DNS de compatibilitรฉ โ historique mcp.so |
https://octocloud.amia.fr | Octocloud โ portail SaaS Next.js (subscriptions, admin UI) |
Le kit de dรฉploiement complet est dans Entreprise/octonet-mcp/ :
apache/mcp.amia.fr.confโ vhost Apache2 (proxy SSE, WS upgrade, certs Let's Encrypt SAN)ecosystem.config.cjsโ config PM2deploy.sh/install.sh/update.shโ scripts d'orchestrationtests/smoke-all.shโ suite de smoke tests (DNS, TLS, /health, SSE MCP, REST, /try, NetClient Java)
CLI
npx mostajs-net serve # Start server
npx mostajs-net mcp # MCP-only mode
npx mostajs-net generate-apikey <label> # รmettre une apikey via CLI
npx mostajs-net hash-password <password> # Hash bcrypt
npx mostajs-net info # JSON config dump
npx octonet-mcp --dialect=X --uri=Y # Standalone MCP server (process sรฉparรฉ)
License
AGPL-3.0-or-later โ usage libre tant que le code dรฉrivรฉ reste open-source.
Licence commerciale disponible : drmdh@msn.com. Pricing par projet, pas par seat.
โ (c) 2026 Dr Hamid MADANI <drmdh@msn.com>
