Agenda centralizada para médicos: anti-solape, landing pública, asistente web de reserva e integración Google Calendar (busy → bloqueo).
Producto / negocio: ver base.md.
- Next.js (App Router) + TypeScript + Tailwind
- Supabase (Auth, Postgres, RLS)
- Playwright (E2E)
- Hosting objetivo: Vercel + Supabase Cloud
npm install
cp .env.example .env.localnpx supabase start
npx supabase db resetCopiá API URL y anon key / service_role de la salida de supabase start a .env.local.
npm run devAbrí http://localhost:3000.
/signup→ creaprofiles, clínica,resource, landing draft y membresíapaused- Activá membresía (SQL o Admin Waira):
update public.memberships set status = 'active', activated_at = now();
-- opcional admin:
update public.profiles set role = 'admin_waira' where id = '<user-id>';/onboarding→ publicar landing/calendar→ crear turnos (anti-solape en DB)/l/<slug>→ reserva pública/settings/google→ OAuth + sync FreeBusy (requiere vars Google)
| Script | Uso |
|---|---|
npm run dev |
App local |
npm run build |
Build producción |
npm run lint |
ESLint |
npm run test:e2e |
Playwright |
npm run db:start / db:reset |
Supabase local |
Smoke tests corren sin backend real (home + login UI).
Para agenda / landing autenticados:
E2E_DOCTOR_EMAIL=... E2E_DOCTOR_PASSWORD=... E2E_LANDING_SLUG=... npm run test:e2eChecklist mínimo (base.md §9):
- Crear turno
- Rechazar solape
- Cancelar turno
- Reservar desde landing
- Google Cloud Console → OAuth client (web)
- Redirect:
http://localhost:3000/api/google/callback(o tu dominio) - Scopes:
calendar.readonly(FreeBusy) - Completar
GOOGLE_*en.env.local/ Vercel
- Crear proyecto en Supabase
npx supabase link --project-ref <ref>npx supabase db push- Importar el repo en Vercel
- Variables de entorno (Production):
| Variable | Notas |
|---|---|
NEXT_PUBLIC_SUPABASE_URL |
Project URL |
NEXT_PUBLIC_SUPABASE_ANON_KEY |
anon public |
SUPABASE_SERVICE_ROLE_KEY |
solo server (sync Google) |
NEXT_PUBLIC_APP_URL |
https://tu-dominio.vercel.app |
NEXT_PUBLIC_MALLANET_DONATION_URL |
CTA donación |
GOOGLE_CLIENT_ID / SECRET / REDIRECT_URI |
OAuth |
- Auth → Redirect URLs:
https://tu-dominio.vercel.app/auth/callback - Deploy
/
├── base.md
├── README.md
├── e2e/
├── supabase/migrations/
└── src/
├── app/ # rutas públicas + panel
├── components/
└── lib/ # supabase, appointments, google
- Docs en español; código/commits en inglés
- Ramas
feature/,fix/,chore/+ PRs chicos