Skip to content

Medyzen Backend — 7-Day Course

Version: 1.0 | Status: Written against medyzen-backend code on 2026-09-16 | Owner: Engineering

A day-by-day walk through the whole medyzen-backend codebase. Each day explains what the code does, why it is built that way, where it lives, and the traps that have bitten this team before. Read architecture.md first — it is the map; this course is the territory.

The code is the source of truth. Every file path in these lessons was opened when the lesson was written. If a path no longer exists, the code moved — search for the symbol name, then fix the lesson.


Size of what we cover

About 120k lines of non-test Go. Largest areas, so the time split makes sense:

AreaLinesDay
internal/hiring16.9k6
internal/hr12.3k6
internal/testlab11.3k7
internal/human11.2k2 (auth) + 6 (people)
internal/order11.1k3
internal/inventory8.4k4
internal/assets6.6k5
internal/finance5.9k5
internal/prescription5.7k4
internal/procurement5.2k5
internal/careers4.8k6
internal/pkg4.7k1–3
everything else~15kspread

Migrations: 639 files in internal/database/migrations.


Schedule

DayThemeCoversLesson
1FoundationsRepo tour, boot sequence in cmd/server/main.go, config, database + migrations, the module pattern, errors/response, running locallyday-1-foundations.md
2Request path & securityMiddleware chain, OTP login, JWT + refresh + blacklist, roles/permissions/RBAC, rate limits, audit, PII encryptionday-2-request-path-and-auth.md
3Patient commerceCart, order lifecycle, Razorpay payments + reconciler, realtime events, notifications (SMS, email, push)day-3-cart-orders-payments.md
4Prescriptions & stockPrescription upload, Gemini extraction, review, sweepers; inventory; hospital catalog; dashboardday-4-prescriptions-inventory.md
5Supply & moneyProcurement, assets (hospitals, warehouses, service areas), finance (revenue share, payouts), leadsday-5-procurement-assets-finance.md
6PeopleEmployees and roles in human, HR, delivery KYC, careers, hiring ATS + Google Calendarday-6-people-hr-hiring.md
7Shipping itTerraform on AWS, CI/CD, migration safety, testlab + preflight, observability, testing patterns, capstone: add an endpoint end to endday-7-operations-and-capstone.md

Issues found in the code while writing these lessons: findings.md.


How each lesson is laid out

  1. Goals — what you can do by end of day
  2. Reading order — files to open, in order, with what to look for
  3. Explanation — how the code works, with Mermaid diagrams for flows
  4. Traps — real bugs and gotchas from this codebase
  5. Exercises — hands-on tasks against a local stack (never prod)
  6. Self-check — questions with answers at the bottom

Suggested daily rhythm (about 3 hours)

BlockTime
Read the lesson's explanation45 min
Follow the reading order in the code75 min
Exercises45 min
Self-check, write down open questions15 min

Ground rules for exercises

  • Run against a local Postgres/Redis (docker-compose.yml), never the production database.
  • Local runs read .env through config.Load() — blank every real secret first.
  • Pushing to main deploys production. Exercises stay on a local branch.

Internal — written against the code, not the other way around.