diff --git a/README.md b/README.md index e2a0015..1d4e1f8 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,49 @@ -# AI Chat template +# AI Chat -A Saucebase template: an AI chat SaaS. It installs `saucebase/ai-chat` with auth, billing and themes, -Free and Pro plans with monthly message and image limits, and a landing page. +A Saucebase template: an AI chat product with free and paid plans. The chat itself is the [AI Chat](https://github.com/saucebase-dev/ai-chat) module; this template adds the plans, the landing page and the look. It installs `saucebase/ai-chat` with auth, billing and themes. + +## What you get + +| Address | What it does | +|---|---| +| `/` | The landing page: the chat in action, features, pricing, and a way to start | +| `/dashboard` | Goes to the chat: after sign-in, the chat is the app | +| `/chat` | The chat. Its conversations, search and WebMCP are in the app sidebar, on every page | +| `/pricing` | The plans, from billing | + +| Plan | Price | Messages a month | Images a month | +|---|---|---|---| +| Free | €0 | 50 | 5 | +| Pro | €12 a month, or €120 a year | 2,000 | 100 | + +The landing page quotes these plans: change `database/seeders/DatabaseSeeder.php` and `stubs/resources/js/vue/components/landing/content.ts` together. + +## Install + +The template and AI Chat are private: the installer needs access to the Saucebase package registry. + +```bash +saucebase new my-chat --template=saucebase/chat +``` + +Then set an AI provider key in the admin (**Settings → AI chat**) or in `.env`. Until then, `AI_CHAT_TEST_MODE=true` answers with canned demos, so the app can be tried without a key. Run a queue worker for conversation titles. + +## Develop + +This app builds the template: +- Its code is in `modules/chat`. +- `ChatServiceProvider` sets `ai-chat.sessions` to `sidebar`, so the chats live in the app sidebar. +- The app files it replaces are in `modules/chat/stubs`: + - `routes/web.php`: the dashboard goes to the chat; + - `routes/navigation.php`: no starter-kit links; + - the landing page (`resources/js/vue/pages/Index.vue` and `components/landing/`); + - the header, footer, theme, logo and icons. ```bash -saucebase new my-app --template=saucebase/chat +php artisan test --compact modules/chat/tests # feature tests +npx playwright test modules/chat/tests/e2e --project="@chat*" # browser tests +php artisan saucebase:template-capture # after editing a replaced app file +php artisan saucebase:template-capture --check # the stubs match the app ``` -Set an AI provider key in the admin (AI chat settings) or in `.env`. +See [Templates](https://saucebase-dev.github.io/docs/fundamentals/templates).