How mikelitom/personal_dacpa works
Project Type and Purpose
• This is a full-stack web application built with Next.js (App Router).
• It offers a student dashboard for managing tuition payments, reporting, uniforms marketplace, and user/profile management.
• It exposes serverless API routes (under src/app/api) for CRUD operations on students (alumnos), parents (padre-familia), payment records (pago-colegiatura), reports (reportes), and integration points (MercadoPago, PDF generation).
File Structure Analysis
• Frontend:
• src/app: Next.js pages, layouts, global styling (globals.css), font config (fonts.ts), and middleware.
• src/app/components & src/app/components/ui: Reusable UI primitives and shared components (buttons, dialogs, form inputs).
• src/app/dashboard & src/app/login: Feature folders containing page entrypoints (page.tsx), layouts, hooks, and subcomponent trees.
• Backend/API:
• src/app/api/...: Route handlers for various resources, each with a /route.ts implementing GET/POST/PUT logic.
• src/app/lib: Client/server wrappers for Supabase, authentication helpers, type definitions, and utility functions.
• src/app/services: Business-logic services for database operations and report generation.
• Configuration & Tooling:
• Next.js config (next.config.ts), ESLint, Jest/Vitest, Tailwind, Storybook setups, TypeScript settings.
Key Architectural Patterns
• App Router (File-based routing): Routes and API endpoints derived from folder structure.
• Separation of Concerns:
• UI components <-> feature pages <-> API routes <-> services <-> data layer.
• Shared context (src/contexts/DashboardContext.tsx) for cross‐cutting state.
• Serverless Functions: Each API folder’s route.ts is a Lambda‐style endpoint.
• External Integrations:
• Supabase as primary database + auth provider.
• MercadoPago for payment creation and webhooks.
• PDF generation endpoint for invoice/report creation.