This directory contains the server-side code for the application. The server uses tRPC for communication between client and server. The server-side code is typically responsible for handling database interactions, business logic, and other server-side tasks.
The routers folder contains the router structure, routers are collections of tRPC procedures, which can be either queries
(reads) or mutations
(writes).
Query example: trpc.interchainToken.getInterchainTokenByTokenId
---
title: getInterchainTokenByTokenId
---
sequenceDiagram
box Browser
participant Client
end
box Black Vercel
participant tRPC
participant MaestroPostgresClient
end
box Purple Neon
participant postgresDB
end
Client->>tRPC: getInterchainTokenByTokenId({ tokenId })
tRPC->>MaestroPostgresClient: getInterchainTokenByTokenId({ tokenId })
MaestroPostgresClient->>postgresDB: raw sql query
postgresDB-->>MaestroPostgresClient: sql query result
MaestroPostgresClient-->>tRPC: { tokenId: "0x123...", ... }
tRPC-->>Client: { tokenId: "0x123...", ... }
Mutation example: trpc.interchainToken.recordInterchainTokenDeployment
---
title: recordInterchainTokenDeployment
---
sequenceDiagram
box Browser
participant Client
end
box Black Vercel
participant tRPC
participant MaestroPostgresClient
end
box Purple Neon
participant postgresDB
end
Client->>tRPC: recordInterchainTokenDeployment({ ...input })
tRPC->>MaestroPostgresClient: recordInterchainTokenDeployment({ ...input })
MaestroPostgresClient->>postgresDB: raw sql query
postgresDB-->>MaestroPostgresClient: sql query result
MaestroPostgresClient-->>tRPC: Success!
tRPC-->>Client: Success!