How yap2203/tracechain works
TraceChain is a supply-chain traceability platform for company onboarding, ingredient and product provenance, evidence exchange, custody transfers, and order logistics. Users enter through a wallet-authenticated web application and role-specific workspaces; the API coordinates authorization, workflow services, blockchain reads, and SSI credentials. The README also documents paginated order views, product history, and multi-provider RPC resilience. Some subsystem wiring is unsampled, so uncertain links are omitted rather than inferred; dashed links mark unverified web-to-API integration.
Main entry points: app.ts HTTP API · App.tsx Web routes · auth.service.ts Session authorization · blockchain-gateway.service.ts Blockchain gateway
Components 21
Web application
- Web routes
apps/web/src/App.tsx - Wallet login
apps/web/src/features/auth/useWalletAuthentication.ts - Role workspaces
apps/web/src/features/workspaces/WorkspaceApp.tsx - Traceability views
apps/web/src/features/product-traceability/ProductTraceabilityPage.tsx - Orders workspace
apps/web/src/features/orders/OrdersPage.tsx
Supply-chain workflows
- Orders and logistics
apps/api/src/modules/orders/orders.service.ts - Evidence workflows
apps/api/src/modules/production-flow/production-flow.service.ts - Ingredient batches
apps/api/src/modules/ingredient-batches/ingredient-batch.service.ts - Custody transfers
apps/api/src/modules/custody-transfers/custody-transfer.service.ts - Document extraction
apps/api/src/modules/document-extraction/document-extraction.service.ts
Identity and evidence
- Session authorization
apps/api/src/modules/auth/auth.service.ts - Stakeholder directory
apps/api/src/modules/stakeholder-directory/stakeholder-directory.service.ts - DIDComm evidence exchange
apps/api/src/modules/didcomm/didcomm.service.ts - SSI credentials
packages/ssi/src/agent/tracechain-agent.ts
Blockchain access
- Blockchain gateway
apps/api/src/modules/blockchain/blockchain-gateway.service.ts - RPC provider routing
apps/api/src/modules/blockchain/rpc-provider.ts - TraceChain contracts
packages/contracts/ignition/modules/TraceChain.ts
API platform
- HTTP API
apps/api/src/app.ts
Other components
- Company user
- RPC providers
- Browser wallet
Connections 24
- Company user → Web routes: uses
apps/web/src/App.tsx - Web routes → Wallet login: routes login
apps/web/src/App.tsx - Web routes → Role workspaces: routes workspace
apps/web/src/App.tsx - Web routes → Traceability views: routes traceability
apps/web/src/App.tsx - Wallet login → Browser wallet: requests signature
- Wallet login → Session authorization: verifies session
apps/web/src/features/auth/useWalletAuthentication.ts - HTTP API → Session authorization: configures
apps/api/src/app.ts - Session authorization → Stakeholder directory: resolves stakeholder
apps/api/src/modules/auth/auth.service.ts - Session authorization → Blockchain gateway: checks authorization
apps/api/src/modules/auth/auth.service.ts - HTTP API → Blockchain gateway: constructs gateway
apps/api/src/app.ts - HTTP API → Orders and logistics: constructs service
apps/api/src/app.ts - Orders and logistics → Evidence workflows: uses evidence workflows
apps/api/src/modules/orders/orders.routes.ts - Orders workspace → HTTP API: requests order data
- Traceability views → HTTP API: requests trace data
- HTTP API → Ingredient batches: exposes batch workflows
apps/api/src/app.ts - HTTP API → Custody transfers: exposes transfer workflows
apps/api/src/app.ts - HTTP API → Document extraction: exposes extraction
apps/api/src/app.ts - Evidence workflows → SSI credentials: verifies credentials
apps/api/src/modules/production-flow/production-flow.service.ts - Ingredient batches → SSI credentials: issues credentials
apps/api/src/modules/ingredient-batches/ingredient-batch.service.ts - Evidence workflows → Ingredient batches: checks certification files
apps/api/src/modules/production-flow/production-flow.service.ts - HTTP API → DIDComm evidence exchange: configures DIDComm
apps/api/src/app.ts - Blockchain gateway → RPC provider routing: uses provider
apps/api/src/modules/blockchain/blockchain-gateway.service.ts - RPC provider routing → RPC providers: fails over reads
- Blockchain gateway → TraceChain contracts: reads contract state