How jaypopat/eduverse-turbo works
Main Components
• Web Application (apps/web): This is the frontend component built with React/TypeScript (note the many .tsx components and Vite configuration). It likely handles user interaction, routing, and displays both “contract” and “metaverse” sections.
• Backend Service (apps/backend): This Node.js/TypeScript service (using Bun) implements APIs, handles authentication, and manages features like metaverse logic and uploads to IPFS. It contains modules, routes, and utilities.
• Smart Contract Component (apps/contract): Written in Rust (Cargo files and lib.rs) this part encapsulates on-chain contracts, likely for managing course management or similar business logic.
• Shared Packages:
• packages/contract-instance: Provides artifacts and scripts to interact with the smart contract.
• packages/eslint-config: Contains shared ESLint configuration.
• packages/typescript-config: Provides common TypeScript settings for the apps.
• Turborepo Configuration (turbo.json): Oversees task running and build caching among the apps and packages.
• Supporting Configuration (e.g., .gitignore, bun.lockb, package.json files): These items are present across apps and packages to standardize project structure and tooling.
Relationships and Interactions
• The Web Application should be depicted as the primary client that interacts with:
• The Backend Service via REST/WebSocket API calls for data and authentication.
• The Smart Contract indirectly through the contract-instance package (or possibly directly via browser-based blockchain interactions).
• The Backend Service interacts with both:
• Frontend clients (handling requests, sessions, and real-time features via specific routes such as metaverse-ws).
• External services (e.g., IPFS integration for uploads).
• The Smart Contract component is represented as an isolated module (possibly off-chain) that the backend (and/or frontend via shared packages) interacts with using defined artifacts and APIs.
• Shared packages are utilities/config libraries used across both the web and backend apps to ensure consistency in code quality and contract interactions.
Architectural Patterns
• Monorepo Design via Turborepo: Emphasize that the system uses a turborepo structure that coordinates builds, caching, and development across diverse apps and packages.
• Separation of Concerns: Clearly delineate the frontend, backend, and blockchain (contract) components. This includes modularizing configuration (ESLint/TypeScript) and shared logic (contract-instance package).
• API/Service Layer: Show directional flows between frontend (user interface) and backend (API services), as well as communication between backend and the smart contract.