How felikarina/bambin works
Project Type and Purpose
• This is a full‐stack web application (“Bambin”) consisting of:
• A Vue.js SPA (frontend) served via Vercel’s CDN.
• A set of serverless API endpoints (the “api” folder) for business logic and data access.
• A relational database layer (PostgreSQL via Supabase and Drizzle ORM) for persistence.
• Supabase Storage for multimedia (photos).
• Purpose: Secure photo gallery, activity journal, messaging and account management for crèche staff and parents.
Architectural Overview
• Client Layer (Browser + SPA)
• Components: Vue views/components, router, state & utils (API client, Supabase auth)
• Served as static assets by Vercel.
• API Layer (Serverless Functions)
• Each file in /api (e.g., login.ts, pictures.ts) is a Vercel Serverless Function.
• They import the Drizzle ORM from backend/db to run SQL queries against PostgreSQL.
• Auth middleware (utils/auth.ts) verifies Supabase JWTs.
• Data Layer
• PostgreSQL (hosted by Supabase) for users, children, sections, activities, tags.
• Drizzle schema and migrations live in backend/db and backend/drizzle/meta.
• Supabase Storage buckets handle picture file uploads.
• CI/CD & Infrastructure
• GitHub Workflows trigger Vercel deployment on dev/main branches.
• Docker‐compose used for local integration testing with a test database.
• Vitest & Playwright for unit and end‐to‐end tests.
Relationships & Data Flows
• SPA → (HTTPS) → Serverless API
• All CRUD operations for users, children, sections, activities, pictures.
• API → (ORM) → PostgreSQL
• API → (Storage SDK) → Supabase Storage (for file upload/download)
• SPA ↔ (Auth SDK) ↔ Supabase Auth (JWT issuance & validation)
• GitHub Actions → Vercel Deployment → CDN / Serverless Updates
Architectural Patterns & Principles
• Single‐Page Application decoupled from Backend via REST‐style serverless endpoints.
• Database access is centralized behind Drizzle ORM for type safety and migrations.
• Serverless micro‐endpoints organized per resource (user, picture, activity).
• Use of managed services (Supabase) to offload infrastructure concerns.
• Clear separation of concerns: frontend, API logic, persistence, and devops.