Backend Design

The backend is designed to handle functionalities like API management, user authentication, and analytics, while bridging communication with the blockchain.

Controllers:

  • agent.controller.ts: Handles requests related to creating, modifying, and deleting agents

  • session.controller.ts: Manages session initialization, participation, and results

  • analytics.controller.ts: Provides insights into agent and session performance

Services:

  • agent.service.ts: Core logic for managing agents

  • session.service.ts: Implements session handling, reward calculations, and blockchain interactions

  • analytics.service.ts: Processes and generates statistical reports for users

Middleware:

  • Authentication: Verifies user tokens for secure access

  • Logging: Tracks API usage and errors for debugging

Web3 Module:

  • clients.ts: Configures the blockchain client (e.g., connecting to Ethereum or Base)

  • transactions/agent.ts: Handles blockchain interactions for agent creation

  • transactions/session.ts: Manages session-specific blockchain operations

Last updated