How lychuss/open-med-backend works
This is a medical-services backend with authentication, a protected doctor-search route, and Socket.IO rooms that relay WebRTC signaling. The intended HTTP flow is client → Express route → authentication and controller; however, the sampled controller is empty and does not call the doctor-query service, so that connection is not inferred. The README provides no further capability detail, and the schema was not sampled; the graph shows only relationships evidenced by the provided excerpts.
Main entry points: app.ts Express app · socket.ts Socket.IO handlers · users.routes.ts Doctor route · better-auth.ts Better Auth
Components 13
HTTP API
- Express app
src/app.ts - Doctor route
src/routers/users.routes.ts - Doctor controller
src/controllers/users.controller.ts
Identity
- Session guard
src/middlewares/authentication.middlewares.ts - Better Auth
lib/better-auth.ts
Realtime
- Socket.IO handlers
src/config/socket.ts - HTTP server entry
src/server.ts
Data access
- Doctor query
src/services/users.services.ts - Auth Prisma client
prisma/seed.ts - Query Prisma client
lib/prisma.ts
Other components
- Frontend client
- PostgreSQL
- Realtime client
Connections 14
- Frontend client → Express app: sends HTTP
src/app.ts - Express app → Better Auth: routes auth
src/app.ts - Express app → Doctor route: mounts route
src/app.ts - Doctor route → Session guard: checks session
src/routers/users.routes.ts - Doctor route → Doctor controller: dispatches request
src/routers/users.routes.ts - Session guard → Better Auth: gets session
src/middlewares/authentication.middlewares.ts - Better Auth → Auth Prisma client: configures adapter
lib/better-auth.ts - Auth Prisma client → PostgreSQL: reads and updates
prisma/seed.ts - Doctor query → Query Prisma client: queries doctors
src/services/users.services.ts - Query Prisma client → PostgreSQL: connects
lib/prisma.ts - HTTP server entry → Socket.IO handlers: listens on server
src/server.ts - Socket.IO handlers → Express app: serves HTTP app
src/config/socket.ts - Realtime client → Socket.IO handlers: joins and signals
src/config/socket.ts - Socket.IO handlers → Realtime client: relays room events
src/config/socket.ts