Skip to main content

Documentation 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.

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 the PORT environment variable (defaulting to 3000) and is deployed via a Heroku-style Procfile.

Tech stack

LayerTechnology
FrameworkNestJS 11 (@nestjs/core, @nestjs/platform-express)
LanguageTypeScript 5
DatabaseSupabase (PostgreSQL)
AuthSupabase Auth
File storageSupabase Storage
Config@nestjs/config with ConfigModule.forRoot({ isGlobal: true })

Application entry point

The application bootstraps in src/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
const app = await NestFactory.create(AppModule);
app.enableCors({
  origin: 'https://edge-timer-blue.vercel.app',
  methods: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'],
  credentials: true,
  allowedHeaders: ['Content-Type', 'Authorization'],
});
await app.listen(process.env.PORT ?? 3000, '0.0.0.0');

Supabase clients

Two Supabase clients are exported from src/supabase.ts and used throughout the application.
ExportKey usedPurpose
supabaseSUPABASE_KEY (anon)User-scoped queries that respect RLS policies
supabaseAdminSUPABASE_SERVICE_ROLE_KEYPrivileged queries that bypass RLS
createSupabaseUserClientSUPABASE_KEY + JWTPer-request client that forwards the caller’s access token
The 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 root AppModule 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

The Procfile at the repository root defines the web dyno command used by Heroku (or compatible platforms):
Procfile
web: npm run build && npm run start:prod
This runs nest build to compile TypeScript to dist/, then starts the compiled output with node dist/main.js.

Build docs developers (and LLMs) love