# Controllers

Overview of the controller directory structure.

## Directory Structure

- `V2/` — Legacy flows (B2B, B2C, OnBoarding) with multi-language support
- `V3/` — Redesigned flows (B2C, OnBoarding) currently English-only
- `WebQuiz/` — Quiz result and recommendation flow

## Root Controllers

| File | Description |
|------|-------------|
| `ArticleController` | Displays article pages with lazy-loaded images and video embeds |
| `PaymentFailedController` | Handles failed payment recovery flows for Stripe and Razorpay |
| `RazorpayPaymentController` | Processes Razorpay subscription webhooks (subscriptions, payments, refunds) |
| `StripePaymentController` | Handles Stripe webhook events and payment callbacks for non-India checkouts |
| `SubModuleController` | Extends OnBoardingController to serve interactive sub-module content |
| `SubscribeController` | Manages email unsubscribe functionality and user opt-out |
| `WebController` | Serves static web pages (quiz landing, account page) |
| `WebhookController` | Processes SendGrid email event webhooks (delivery, bounce, click) |
| `WebQuiz/ResultController` | Displays quiz results, program recommendation, and payment processing |
