NewWork mode: your Claude Code or Codex on work calls, answering from your project's codeSkip to content
Middle0 views

Design a platform for organizing courses, including schedules, payments, and certificates.

Practice

Asked at

AI answer

Architecture

Separate services for the course catalog, scheduling, enrollment, payments, class delivery, and certificate issuance. An API gateway serves web and mobile clients; transactional data is stored in a relational database, while events and background tasks are handled by a queue. Course materials can be stored in object storage and delivered via a CDN.

Scheduling and enrollment

Entities: Course, Cohort, Session, Instructor, Enrollment, Capacity. During enrollment, atomically check that a seat is available and reserve it to avoid exceeding capacity when requests arrive concurrently. A reservation has an expiration time: confirmed payment activates the enrollment, while an expired reservation frees the seat. Account for time zones, rescheduled classes, and notifying participants of changes.

Payments and certificates

Create payments with an idempotency key; obtain the final status from a verified provider webhook, not just the browser response. Cancellations or refunds must update the enrollment according to defined rules and leave an audit trail. Issue a certificate only when course criteria are met—for example, attendance and successful assessment. Store a unique number, date, course, and verifiable link/QR code; rerunning issuance must not create duplicates.

Reliability and operations

Use an outbox or equivalent reliable publishing mechanism for payment, enrollment, and course-completion events; make handlers idempotent. Configure roles for students, instructors, and administrators; audit changes to grades and schedules; protect personal data; and back up data. Monitor enrollment-to-payment conversion, webhook errors, over-capacity groups, attendance, and delays in certificate issuance.