# SaaS Setup

Use SaaS setup to turn the app from a single workspace support desk into a sellable multi-workspace platform. Configure billing, limits, onboarding, demo data, website content, and readiness checks before presenting the product to buyers.

## Core SaaS Concepts

- Platform admins manage global billing plans, gateways, website content, addon packages, marketplace readiness, and demo reset.
- Workspace owners manage their own support desk, users, AI settings, contacts, deals, tickets, widget, channels, and reports.
- Plans control workspace limits and feature access.
- Usage counters track billable or limited actions.
- Public demo data should be reset-safe and use `@ovion.tech` emails.

## Recommended Setup Order

1. Install the app and complete server readiness checks.
2. Create or confirm the first platform admin.
3. Create the first workspace.
4. Configure public website branding.
5. Create billing plans and limits.
6. Configure payment gateways in test mode for demo.
7. Configure AI provider and knowledge sources.
8. Configure public widget and help center.
9. Configure email inbox and channels.
10. Configure Envato verification if targeting CodeCanyon authors.
11. Generate or reset demo workspace data.
12. Open `/chat/marketplace/readiness` and resolve warnings.

## Workspace Limits

Plan limits should cover:

- Users.
- Agents.
- Widgets.
- API tokens.
- Channels.
- Knowledge sources.
- Storage.
- AI messages.
- Connector events where applicable.

When a limit is reached, the app should block only the new action and show upgrade messaging. Existing data should remain available.

## Demo Workspace

For marketplace previews:

- Keep demo gateways in test mode.
- Assign every public demo workspace to a paid sample plan.
- Seed contacts, deals, tickets, AI QA logs, connector events, invoices, and reports.
- Keep generated demo people emails on `@ovion.tech`.
- Use demo reset only on known demo workspaces.
- Confirm the guided tour opens and resumes correctly.

## Onboarding Checklist

The onboarding checklist should guide admins through:

- Mail setup.
- Queue worker.
- Scheduler.
- Storage link.
- AI provider.
- Payment gateway.
- Widget setup.
- First knowledge source.
- First connector.
- Public demo check.

## Platform Owner QA

Before launch:

- Pricing page reads active plans.
- Contact page creates lead/contact data.
- Workspace billing state is visible.
- Usage counters update after AI and connector events.
- Addon ZIPs are listed with docs and screenshots.
- Audit logs record key admin actions.
- Export/backup tools are available.
- Public demo health is green or explains any intentionally disabled provider.
