Project Structure
Monorepo Layout
Section titled “Monorepo Layout”PinTeach is a Turborepo + Bun workspaces monorepo with 3 packages + 3 apps:
pinteach/├── apps/│ ├── api/ # Backend: Cloudflare Worker (Hono)│ ├── app/ # React SPA (port 3737)│ └── platform/ # This documentation site (Astro + Starlight)├── packages/│ ├── shared/ # Zod schemas + TypeScript types│ ├── db/ # Drizzle ORM + migrations│ └── email-templates/ # React Email (15 templates)├── connections-manifest.ts # las 5 costuras, servidas en /_meta/connections.json├── turbo.json└── biome.json # Linting + formattingBackend (apps/api/)
Section titled “Backend (apps/api/)”apps/api/src/├── worker/ # El backend: Cloudflare Worker (Hono 4)│ ├── index.ts # fetch / scheduled / queue│ ├── app.ts # CORS, headers, auditoría, envelope de error, rutas│ ├── middleware/ # db (D1), auth, rate-limit, audit-context│ ├── lib/ # session-cookie│ └── routes/ # auth, public, student, teacher, webhooks, gen,│ # admin, classroom├── services/ # 79 servicios de lógica de negocio│ ├── auth/ # google-oauth, magic-link, session, teacher-auth│ ├── billing/ # credit-ledger, enrollment, stripe│ ├── google/ # calendar, drive, meet, rest-client│ ├── integrations/ # gen (webhook, enrichment, offerings), hub-website│ ├── notifications/ # envío de email│ ├── policy/ # contract, legal-document, policy-engine│ ├── privacy/ # export GDPR, borrado│ ├── reviews/ # review, review-request, review-settings│ ├── scheduling/ # session, slot-engine, availability, waitlist…│ ├── sequences/ # secuencias y lecciones│ ├── audit/ # audit-service│ └── teacher/ # dashboard, insights, payments…├── jobs/ # 11 runners de cron + consumidores de cola│ ├── index.ts # reparto por expresión de cron y hora UTC│ ├── runners/ # la lógica de cada job│ └── consumers.ts # CF Queues: calendar-sync puntual y meet-link└── lib/ # errors, env, provider-healthEl stack Node/Fastify (index.ts, app.ts, plugins/, routes/, los
jobs/*-worker.ts de BullMQ) se retiró el 7-sep-2026 al borrarse el servicio de
Cloud Run.
Public pages (/t, /t/$slug)
Section titled “Public pages (/t, /t/$slug)”The public teacher directory and profiles are SPA routes in apps/app (routes/public/). For SEO, the pinteach-app Worker (apps/app/src/worker/index.ts, run_worker_first on /t and /t/*) fetches the profile from the API and injects title, description, canonical, Open Graph and JSON-LD into the HTML. The former Astro site (apps/web) was retired on 1-oct-2026; pinteach.com is served by the pinteach-web Worker (repo enlolab/pinteach-web).
Frontend (apps/app/)
Section titled “Frontend (apps/app/)”apps/app/src/├── main.tsx├── router.tsx # 30 routes with lazy loading├── routes/│ ├── __root.tsx│ ├── auth/ # student-login, verify│ ├── public/ # booking, profile, services│ ├── student/ # student portal pages│ └── teacher/ # 14 teacher pages├── components/│ ├── ui/ # 25 reusable components│ ├── calendar/ # week-grid, event-detail, agenda│ ├── kanban/ # board, column, card (dnd-kit)│ ├── materials/ # Drive-style file browser (13 files)│ ├── reviews/ # review cards, forms, import│ ├── widgets/ # booking/storefront/reviews configs│ ├── storefront/ # public service cards, booking│ ├── services/ # service-wizard (3D picker)│ ├── command-palette/ # Cmd+K + shortcut help│ └── layout/ # teacher-sidebar├── hooks/│ ├── mutations/ # 11 optimistic mutation hooks│ └── ... # use-auth, use-theme, etc.└── lib/ ├── api.ts # Fetch wrapper ├── i18n.ts # react-i18next setup └── shortcuts/ # ShortcutRegistry singletonDatabase (packages/db/)
Section titled “Database (packages/db/)”packages/db/src/├── schema/ # 55 schema files (one per table)├── migrations/ # 56 SQL migrations (0000-0055)├── lib/│ └── soft-delete.ts # notDeleted() helper├── seed.ts # Development seed data└── index.ts # DB connection + re-exportsShared (packages/shared/)
Section titled “Shared (packages/shared/)”packages/shared/src/├── schemas/ # 33 Zod schema files├── types/ # TypeScript type definitions└── constants/ # Shared constants