The EdgeTimer backend is a NestJS 11 application written in TypeScript. It exposes a REST API consumed by the EdgeTimer frontend and delegates all data persistence, authentication, and file storage to a Supabase project. The server listens on the port defined by theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/JulietaEM/EdgeTimer/llms.txt
Use this file to discover all available pages before exploring further.
PORT environment variable (defaulting to 3000) and is deployed via a Heroku-style Procfile.
Tech stack
| Layer | Technology |
|---|---|
| Framework | NestJS 11 (@nestjs/core, @nestjs/platform-express) |
| Language | TypeScript 5 |
| Database | Supabase (PostgreSQL) |
| Auth | Supabase Auth |
| File storage | Supabase Storage |
| Config | @nestjs/config with ConfigModule.forRoot({ isGlobal: true }) |
Application entry point
The application bootstraps insrc/main.ts. CORS is enabled for the production frontend origin and credentials are allowed so that the browser can send Authorization headers.
src/main.ts
Supabase clients
Two Supabase clients are exported fromsrc/supabase.ts and used throughout the application.
| Export | Key used | Purpose |
|---|---|---|
supabase | SUPABASE_KEY (anon) | User-scoped queries that respect RLS policies |
supabaseAdmin | SUPABASE_SERVICE_ROLE_KEY | Privileged queries that bypass RLS |
createSupabaseUserClient | SUPABASE_KEY + JWT | Per-request client that forwards the caller’s access token |
getSignedStorageUrl helper uses supabaseAdmin to generate 7-day signed URLs from any Supabase Storage path.
The application throws at startup if
SUPABASE_URL, SUPABASE_KEY, or SUPABASE_SERVICE_ROLE_KEY are missing. See Environment variables for the full list.Modules
The rootAppModule registers three feature modules alongside a global ConfigModule.
Auth
Handles client registration and login by delegating to Supabase Auth. Exposes two endpoints:
POST /auth/register-client for new client accounts and POST /auth/login for both clients and barbers.Citas
Manages barbershop appointments (citas). Provides endpoints to create, list, update, and cancel appointments stored in the Supabase
cita table.Catalogos
Serves read-only and admin catalog data: active barbers (
barbero), procedures (procedimiento), and profile photo uploads to Supabase Storage.Deployment
TheProcfile at the repository root defines the web dyno command used by Heroku (or compatible platforms):
Procfile
nest build to compile TypeScript to dist/, then starts the compiled output with node dist/main.js.