Logo

Sharing Excess

Food Rescue Platform
For Developers

Platform Overview & Architecture

This section captures scope and how the parts fit together. Code is the source of truth.

Product scope

  • Food rescue operations: partners, locations, rescues, transfers, users
  • Public and internal impact metrics/endpoints
  • Admin and partner workflows

High-level architecture

  • Monorepo with Bun workspaces and Turbo tasks
  • Apps/Services:
    • apps/client — React 18 + Vite + Chakra UI + Clerk
    • apps/server — Hono on Bun, Drizzle ORM, Clerk, Sentry
    • apps/docs — Next.js + Fumadocs
    • crons/backup — DB backup to S3 storage
    • crons/cleanup — S3 cleanup and maintenance
    • apps/storage — S3 file host proxy and admin interface
  • Shared packages:
    • packages/db — Drizzle schema, generator, connection utils
    • packages/types — Zod schemas and TypeScript enums/types

Data & integrations

  • Neon PostgreSQL via Drizzle ORM
  • S3 storage for files (paths in DB; base URL per env via STORAGE_BASE_URL)
  • Clerk for auth; permission stored in DB
  • Sentry for error monitoring; Apitally for API metrics

Environments

  • Local: Bun dev or docker-compose
  • Staging/Production: Railway services built from Dockerfiles

Source-of-truth pointers

  • DB schema: packages/db/src/db.schema.ts
  • Server routes: apps/server/src/routes/**
  • Shared types/schemas: packages/types/src/**