Features & BFF API
Pages, routes and backend calls
Portal is a backend-for-frontend. React pages call local API routes; those routes normalize input, require the signed session and invoke Mivama Core. Frappe details and service credentials never enter browser bundles.
Customer areas
| Area | Purpose | Core records |
|---|---|---|
| Dashboard | Summary, onboarding and active services | Customer, Subscription, Hosting Service |
| Hosting | WordPress access, migration, Studio and lifecycle | Hosting Service, Hosting Migration |
| Subscriptions | Plans, checkout, plan change and customer portal | Stripe Subscription, Subscription Plan |
| Billing | Invoice list and PDF metadata | Sales Invoice, Stripe Invoice |
| Tickets | Helpdesk conversations and attachments | HD Ticket, Communication |
| Requests | Structured service requests | Mivama Service Request |
| Projects | Projects, tasks and comments | Project, Task, Comment |
| Profile | Company, language, theme and mail preferences | User, Contact, Customer |
| Legal | Published documents and acceptances | Legal Document, Legal Acceptance |
BFF pattern
Each route returns a Portal-shaped response instead of a raw Frappe envelope. Frappe remains responsible for object authorization and transactions.
Notifications
Invoices, migration review/cutover/failure/completion, hosting lifecycle and security-relevant events create Portal notifications. Scheduled cleanup removes old records. Optional mail can honor preferences; essential transactional messages remain deliverable.
Error handling
The UI should show an actionable customer message and keep technical detail for support. BFF helpers unwrap Frappe message envelopes. Authentication failures clear stale sessions. HTTP 417, 401 or state conflict responses must never be converted into success.
Adding a feature
- Define ownership and the source-of-truth DocType in Core.
- Add a narrow Core method with customer authorization.
- Add a Portal BFF route; do not call privileged methods from the browser.
- Implement translated UI.
- Add notifications/mail if the change matters to the customer.
- Document schedulers, secrets or external webhooks.