How tomy-basabe/sistemamedico works
This is a role-based medical-practice management application. Users sign in, are routed according to their role, and work in separate secretary, physician, admin, or superadmin areas. The physician workflow includes managing appointments and availability, then opening a patient’s clinical history; administration includes user, specialty, reporting, and audit areas. Supabase provides authentication and application data access. The README is only the stock Next.js template, so product capabilities are inferred from the repository tree and source index; several route-to-route links are therefore left unasserted.
Main entry points: client.js Browser client · useAuth.js User profile hook · medico/page.js Physician dashboard · turnos/page.js Appointment management
Components 22
Access and identity
- Sign in
src/app/login/page.js - Session and role gate
src/lib/supabase/middleware.js - User profile hook
src/hooks/useAuth.js
Clinical workflow
- Physician dashboard
src/app/medico/page.js - Appointment management
src/app/medico/turnos/page.js - Physician availability
src/app/medico/disponibilidad/page.js - Patient directory
src/app/medico/pacientes/page.js - Patient clinical record
src/app/medico/pacientes/[id]/page.js - Consultation
src/app/medico/consulta/[turnoId]/page.js
Practice operations
- Secretary operations
src/app/secretaria - Reports
src/app/admin/reportes/page.js - Audit review
src/app/admin/auditoria/page.js - User administration
src/app/admin/usuarios/page.js - Catalog actions
src/app/actions/especialidades.js - Mutual catalog actions
src/app/actions/mutuales.js - Superadmin area
src/app/superadmin/page.js
Data platform
- Browser client
src/lib/supabase/client.js - Server client
src/lib/supabase/server.js - Supabase
- UI icons
src/components/ui/Icons.js - Role navigation
src/components/ui/Sidebar.js
Other components
- Practice staff
Connections 32
- Practice staff → Sign in: signs in
src/app/login/page.js - Sign in → Browser client: authenticates with
src/app/login/page.js - Practice staff → Session and role gate: requests pages
- Session and role gate → Supabase: checks session
src/lib/supabase/middleware.js - Browser client → Supabase: connects to
src/lib/supabase/client.js - User profile hook → Browser client: loads user profile
src/hooks/useAuth.js - Physician dashboard → User profile hook: reads identity
src/app/medico/page.js - Physician dashboard → Browser client: loads appointments
src/app/medico/page.js - Appointment management → User profile hook: reads identity
src/app/medico/turnos/page.js - Appointment management → Browser client: manages appointments
src/app/medico/turnos/page.js - Physician availability → User profile hook: reads identity
src/app/medico/disponibilidad/page.js - Physician availability → Browser client: manages availability
src/app/medico/disponibilidad/page.js - Patient directory → User profile hook: reads identity
src/app/medico/pacientes/page.js - Patient directory → Browser client: loads patients
src/app/medico/pacientes/page.js - Patient clinical record → User profile hook: reads identity
src/app/medico/pacientes/[id]/page.js - Patient clinical record → Browser client: manages clinical data
src/app/medico/pacientes/[id]/page.js - Consultation → User profile hook: reads identity
src/app/medico/consulta/[turnoId]/page.js - Consultation → Browser client: loads consultation
src/app/medico/consulta/[turnoId]/page.js - Reports → Browser client: queries reports
src/app/admin/reportes/page.js - Audit review → Browser client: loads audit data
src/app/admin/auditoria/page.js - User administration → Browser client: loads user data
src/app/admin/usuarios/page.js - User administration → Browser client: uses user actions
src/app/admin/usuarios/page.js - Catalog actions → Browser client: updates specialties
- Mutual catalog actions → Browser client: updates mutuals
- Superadmin area → Browser client: uses user actions
src/app/superadmin/page.js - Secretary operations → Browser client: uses data services
- Physician dashboard → Appointment management: opens appointments
- Appointment management → Patient clinical record: opens patient record
- Physician dashboard → UI icons: renders
src/app/medico/page.js - Practice staff → Role navigation: navigates
- Role navigation → User profile hook: reads profile
src/components/ui/Sidebar.js - Session and role gate → Supabase: reads profile
src/lib/supabase/middleware.js