How obviant/exercise-3 works
Main components
• Monorepo (root container) that houses all apps and packages.
• Apps:
• Web App (apps/web): A Next.js application with its own routing (pages, app structure, TRPC client hooks).
• API Server (apps/api-server): A Node.js/TypeScript server with routing (express-like router files, TRPC endpoints).
• Packages:
• Database Package (packages/database): Contains Drizzle ORM configuration, SQL migrations, and schema definitions.
• Shared configurations (packages/eslint-config and packages/tsconfig): Provide linting rules and TypeScript configurations that are used throughout.
• (Optionally) Docker and Build Tools:
• docker-compose.yaml indicates that containerization or local deployment orchestration is supported.
• Turborepo’s configuration (turbo.json, pnpm-workspace.yaml, and pnpm-lock.yaml) that manage task running and caching within the monorepo.
Relationships and interactions
• The web application likely interacts with the API server, possibly via TRPC endpoints, as both the apps/api-server and apps/web have TRPC-related code.
• The API server interacts with the database package for data persistence, using Drizzle ORM configurations and migrations.
• Shared configuration packages (eslint and tsconfig) act as foundational dependencies for both apps.
• The overall Turborepo setup binds these components together by enabling consistent builds, caching (including remote caching with Vercel as per the README), and development workflows.
• The docker-compose file may be used to orchestrate these components during containerized development or deployment.
Important architectural patterns and design principles
• Separation of Concerns: Clearly dividing the frontend (web app), backend/API (api-server), and database layer.
• Shared Library and Config Approach: Reusing configuration and tooling across different parts of the monorepo.
• TRPC Integration: Providing strong typing and remote procedure calls between client (web) and server (api-server).
• Monorepo Structure: Encouraging reusability and centralized management of packages/apps.
• Containerization Support: Through Docker for local development and/or deployment.
Relevant technologies and frameworks to highlight
• Next.js for the web app.
• Node.js with TypeScript for the API server.
• Drizzle ORM for database interactions.
• TRPC for type-safe API calls.
• Turborepo for task and build management.
• ESLint and Prettier for code quality.
• Docker (via docker-compose) for environment orchestration.