# Multi-demo architecture

This application is designed to host many demo applications under one Laravel core.

## URL model

Each demo lives under its own slug:

- `/bpjstk`
- `/jrp`
- `/bintangpelajar`
- future demos like `/survey-app`

## Current building blocks

- `config/demo-apps.php`
  Central registry for all demo applications.
- `app/Support/DemoAppRegistry.php`
  Reads and exposes registered demo definitions.
- `app/Http/Middleware/ResolveDemoApp.php`
  Validates the slug and loads the active demo configuration.
- `app/Http/Controllers/DemoAppController.php`
  Renders the landing page and demo pages.

## BPJSTK specific docs

- [`docs/bpjstk-api.md`](./bpjstk-api.md)
  Dokumentasi endpoint profil dan saldo JHT untuk integrasi eksternal.
- [`docs/bintangpelajar-chatbot-api.md`](./bintangpelajar-chatbot-api.md)
  Dokumentasi chatbot API untuk demo Bintang Pelajar.
- [`docs/api.md`](./api.md)
  Indeks cepat untuk semua dokumentasi API yang tersedia.

## Add a new demo

1. Add a new entry under `apps` in `config/demo-apps.php`.
2. Define the slug, name, tagline, description, theme, and feature list.
3. If the demo needs custom logic, add a dedicated controller or service under `app/DemoApps/<DemoName>/`.
4. If the demo needs a custom interface, create a Blade view under `resources/views/demo-apps/`.
5. Point the config entry to that view when the generic page is no longer enough.

## Recommended next evolution

- Move demo-specific business logic into `app/DemoApps/<DemoName>/`.
- Store demo registry in a database table once demo onboarding needs admin control.
- Add authentication or role checks per demo if some demos should be private.
- Add custom route groups per demo when a demo grows beyond one landing page.
