How minami22x3/planio works
Project Type and Purpose
• This is a full-stack Next.js application (“Plan.io”) combining a React/Next.js front end, a GraphQL API layer, and a PostgreSQL database (via Supabase + Drizzle ORM). It provides a To-Do list productivity tool with server-side rendering, client interactivity, migrations, and code-generated GraphQL schema.
High-Level System Components
a. Frontend Layer
• Next.js “app” directory (app/page.tsx, app/layout.tsx) for SSR/SSG and client hydration
• React UI components in components/ui
• Global styling (Tailwind via tailwind.config.ts + globals.scss)
• Apollo Client (app/_apollo-provider.tsx) for GraphQL
b. API Layer
• Next.js API Route: /api/graphql (server/graphql.ts + app/api/graphql/route.ts)
• Apollo Server built on Drizzle schema
• Instrumentation (instrumentation.ts) and Sentry (sentry.*.config.ts)
c. Persistence Layer
• Supabase local/PostgreSQL (docker-compose.yml, supabase/config.toml)
• Drizzle ORM for schema definition (db/schema) + Migrations (db/migrations)
• Codegen (codegen.ts, gql/schema.graphql → gql/types.ts + gql/operations)
d. DevOps & Tooling
• Docker Compose for Supabase stack
• Yarn scripts for dev, migrations, codegen
• ESLint/Husky/Prettier configuration
Relationships and Data Flows
• User’s Browser ⇄ Next.js Frontend (SSR pages + client GraphQL queries)
• Frontend → Apollo Client → GraphQL Endpoint (Next.js API)
• GraphQL Server → Drizzle ORM → Supabase/Postgres
• Dev tools (Yarn, Drizzle-kit, GraphQL-codegen) operate at build time
Architectural Patterns & Principles
• Monolithic full-stack: UI + API co-located in Next.js
• Layered architecture: Presentation → API → Data Access → Database
• Code-first schema: Drizzle definitions → SQL migrations + GraphQL schema
• Type safety end-to-end: TypeScript in frontend, backend, DB, GraphQL