How diksha-raj/coldstoragesg works
ColdChainSG is a cold-chain shipment evidence and certification prototype, not a payment platform. Participants sign in with Ethereum, move shipments through signed two-sided custody checks, submit sensor logs for verification, resolve quality claims, and receive a printable certificate. The React app talks directly to four APIs; the APIs use shared Postgres and chain helpers, while custody actions and oracle/certificate services interact with on-chain registries. The README documents capabilities beyond the sampled excerpts; those relationships are cited to it, and unsampled implementation details are not assumed.
Main entry points: api.ts Service API client · index.ts Oracle API · chain.ts Wallet and chain client · main.tsx Routes and dashboards
Components 20
Participant application
- Routes and dashboards
frontend/src/main.tsx - Wallet sign-in
frontend/src/auth.tsx - Custody actions
frontend/src/components/HandoverActions.tsx - Claim review
frontend/src/pages/ClaimPage.tsx - Certificate views
frontend/src/components/CertificatePanel.tsx - Printable certificate
frontend/src/pages/CertificatePrint.tsx - Service API client
frontend/src/lib/api.ts - Wallet and chain client
frontend/src/lib/chain.ts
Service APIs
- Identity API
services/identity-service/src/index.ts - Custody API
services/custody-service/src/index.ts
Quality and certification
- Oracle API
services/oracle-service/src/index.ts - Sensor evidence checks
services/oracle-service/src/evidence.ts - Sensor log replay
services/oracle-service/src/replay.ts - Certificate API
services/certificate-service/src/index.ts - Certificate sync
services/certificate-service/src/sync.ts
Shared infrastructure
- Shared auth and chain
services/common/src/chain.ts - Postgres service schemas
- Blockchain registries
Other components
- Shipment participants
- MetaMask wallet
Connections 28
- Shipment participants → Routes and dashboards: uses
README.md - Routes and dashboards → Wallet sign-in: provides sign-in
frontend/src/main.tsx - Wallet sign-in → Wallet and chain client: connects wallet
frontend/src/auth.tsx - Wallet sign-in → Service API client: requests identity
frontend/src/auth.tsx - MetaMask wallet → Wallet and chain client: signs transactions
frontend/src/lib/chain.ts - Custody actions → Service API client: seals notes
frontend/src/components/HandoverActions.tsx - Custody actions → Wallet and chain client: submits checks
frontend/src/components/HandoverActions.tsx - Claim review → Service API client: loads claim data
frontend/src/pages/ClaimPage.tsx - Certificate views → Printable certificate: offers print view
- Printable certificate → Wallet and chain client: reads chain config
frontend/src/pages/CertificatePrint.tsx - Routes and dashboards → Service API client: calls services
frontend/src/lib/api.ts - Service API client → Identity API: routes identity requests
frontend/src/lib/api.ts - Service API client → Custody API: routes custody requests
frontend/src/lib/api.ts - Service API client → Oracle API: routes oracle requests
frontend/src/lib/api.ts - Service API client → Certificate API: routes certificate requests
frontend/src/lib/api.ts - Identity API → Shared auth and chain: uses shared auth
- Custody API → Blockchain registries: records handovers
README.md - Oracle API → Sensor evidence checks: uses evidence checks
services/oracle-service/src/index.ts - Oracle API → Sensor log replay: uses replay
services/oracle-service/src/index.ts - Sensor evidence checks → Sensor log replay: checks replay output
services/oracle-service/src/evidence.ts - Oracle API → Blockchain registries: commits sensor evidence
README.md - Certificate API → Certificate sync: runs sync loop
services/certificate-service/src/index.ts - Certificate sync → Blockchain registries: syncs certificates
README.md - Identity API → Postgres service schemas: stores identity data
README.md - Custody API → Postgres service schemas: stores custody data
README.md - Oracle API → Postgres service schemas: stores evidence data
README.md - Certificate API → Postgres service schemas: stores certificate data
README.md - Shared auth and chain → Blockchain registries: connects RPC
services/common/src/chain.ts