Skip to content
 
 

Repository files navigation

mvpMedico (Waira)

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.

Stack

  • Next.js (App Router) + TypeScript + Tailwind
  • Supabase (Auth, Postgres, RLS)
  • Playwright (E2E)
  • Hosting objetivo: Vercel + Supabase Cloud

Setup local

1. Dependencias

npm install
cp .env.example .env.local

2. Supabase local (Docker requerido)

npx supabase start
npx supabase db reset

Copiá API URL y anon key / service_role de la salida de supabase start a .env.local.

3. App

npm run dev

Abrí http://localhost:3000.

4. Primer médico

  1. /signup → crea profiles, clínica, resource, landing draft y membresía paused
  2. 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>';
  1. /onboarding → publicar landing
  2. /calendar → crear turnos (anti-solape en DB)
  3. /l/<slug> → reserva pública
  4. /settings/google → OAuth + sync FreeBusy (requiere vars Google)

Scripts

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

E2E

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:e2e

Checklist mínimo (base.md §9):

  • Crear turno
  • Rechazar solape
  • Cancelar turno
  • Reservar desde landing

Google Calendar

  1. Google Cloud Console → OAuth client (web)
  2. Redirect: http://localhost:3000/api/google/callback (o tu dominio)
  3. Scopes: calendar.readonly (FreeBusy)
  4. Completar GOOGLE_* en .env.local / Vercel

Deploy (Vercel + Supabase Cloud)

  1. Crear proyecto en Supabase
  2. npx supabase link --project-ref <ref>
  3. npx supabase db push
  4. Importar el repo en Vercel
  5. 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
  1. Auth → Redirect URLs: https://tu-dominio.vercel.app/auth/callback
  2. Deploy

Estructura

/
├── base.md
├── README.md
├── e2e/
├── supabase/migrations/
└── src/
    ├── app/          # rutas públicas + panel
    ├── components/
    └── lib/          # supabase, appointments, google

Convenciones

  • Docs en español; código/commits en inglés
  • Ramas feature/, fix/, chore/ + PRs chicos

About

un mvp para agendar consultas medicas

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages