How rey1332/etna-iap works
ETNA is an enterprise data and intelligence platform with a unified PostgreSQL foundation and a domain application layer historically housed under src/app/erp. The principal workflow is a signed-in user’s request passing through a Next.js API route, session and workspace checks, and a server-side database transaction; consumers include ERP modules, analytics, workflows, and ontology search. The README documents the major capabilities and request path. Sampled source confirms selected auth and database-layer calls; links for unsampled subsystems rely on README statements.
Main entry points: api API routes · admin Platform admin · erp ERP modules · query.ts Ontology search
Components 22
Access and administration
- Platform admin
src/app/admin - Auth routes
src/app/api/auth/[action]/route.ts - Session identity
src/server/auth/request.ts - Authentication service
src/server/auth/service.ts - Workspace rules
src/app/erp/lib/erpRules.ts - Admin services
src/server/admin/service.ts
Data foundation
- API routes
src/app/api - Request database client
src/server/db/route-client.ts - Request executor
src/server/db/execute.ts - PostgreSQL executor
src/server/db/executor.ts - PostgreSQL
Domain applications
- ERP modules
src/app/erp - Document storage
src/server/documents/service.ts
Intelligence and automation
- Ontology search
src/lib/ontology/query.ts - Ontology registry
src/lib/ontology/registry.ts - Analytics catalog
src/lib/analytics/catalog.ts - Visual workflows
src/lib/workflow/runtime.ts - Workflow API
src/app/api/erp/workflows
Data integration
- Workspace sync
src/app/erp/lib/syncService.ts - Encrypted data transfer
scripts/db/transfer.mjs
Other components
- Signed-in user
- External enterprise systems
Connections 24
- Signed-in user → ERP modules: uses
- Signed-in user → Platform admin: manages
- ERP modules → API routes: requests
src/app/api/erp/workspace/route.ts - Platform admin → API routes: requests
- API routes → Session identity: resolves session
src/app/api/auth/[action]/route.ts - Session identity → Authentication service: resolves session
src/server/auth/request.ts - Auth routes → Authentication service: handles authentication
src/app/api/auth/[action]/route.ts - API routes → Request database client: opens data access
src/app/api/erp/workspace/route.ts - Request database client → Request executor: executes requests
src/server/db/route-client.ts - Request executor → PostgreSQL executor: runs transaction
src/server/db/execute.ts - PostgreSQL executor → PostgreSQL: queries
src/server/db/executor.ts - API routes → Workspace rules: checks roles
src/app/api/erp/workspace/route.ts - Platform admin → Admin services: administers platform
- ERP modules → PostgreSQL: reads and writes
- PostgreSQL → Ontology registry: stores mapped entities
- Ontology search → Ontology registry: uses registry
src/lib/ontology/query.ts - Ontology search → API routes: searches records
- Analytics catalog → PostgreSQL: analyzes data
- Visual workflows → Analytics catalog: uses catalog
src/lib/workflow/storage.ts - Workflow API → Visual workflows: runs workflows
src/app/api/erp/workflows/route.ts - Document storage → PostgreSQL: stores metadata
src/server/documents/service.ts - Workspace sync → PostgreSQL: synchronizes workspace data
- Encrypted data transfer → PostgreSQL: imports and exports
- External enterprise systems → API routes: planned connectors