> For the complete documentation index, see [llms.txt](https://docs.roomiekit.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roomiekit.io/open-source-starter/backend-modules.md).

# Backend modules

Roomie should boot as a rooms/auth/media starter without requiring the commercial product systems from the original app. Keep these modules disabled by default unless the matching migrations, functions, and provider credentials are intentionally configured.

## Core Starter

Core functionality should work for a fresh self-hoster:

* Supabase Auth, profiles, rooms, presence, and room membership data.
* Local room assets in `web/public` or a compatible `VITE_ASSET_BASE_URL`.
* Agora media token signing through `supabase/functions/agora-token`.
* Account cleanup through `supabase/functions/delete-account` if the public app exposes deletion.

Core Edge Functions:

```bash
npx supabase functions deploy agora-token
npx supabase functions deploy delete-account
```

Required core secrets:

* `AGORA_APP_ID`
* `AGORA_APP_CERTIFICATE`
* `SUPABASE_URL`
* `SUPABASE_ANON_KEY`
* `SUPABASE_SERVICE_ROLE_KEY`

## Optional Modules

Optional modules should never block base rooms, avatars, streaming, or video chat:

* Waitlist and invite rewards: gated by `VITE_ENABLE_WAITLIST` and `VITE_ENABLE_INVITES`.
* Economy, gifts, and daily rewards: gated by `VITE_ENABLE_ECONOMY`, `VITE_ENABLE_GIFTS`, and `VITE_ENABLE_DAILY_REWARDS`.
* Push notifications: gated by `VITE_ENABLE_PUSH`; deploy `send-notification` and `streak-reminder-cron` only with OneSignal secrets.
* Payments/subscriptions: gated by `VITE_ENABLE_PAYMENTS`; deploy `revenuecat-webhook` only with RevenueCat secrets and product IDs.
* Leaderboards and scheduled resets: deploy `close-weekly-leaderboards` only if the game/economy loop is part of your fork.

Optional Edge Functions:

```bash
npx supabase functions deploy send-notification
npx supabase functions deploy streak-reminder-cron
npx supabase functions deploy revenuecat-webhook
npx supabase functions deploy close-weekly-leaderboards
```

## Migration Policy

The starter keeps optional module tables in the database while feature flags keep those systems non-blocking in the app. If your fork does not need optional product systems, you can leave the tables unused or split migrations into core and optional bundles in your own deployment workflow.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.roomiekit.io/open-source-starter/backend-modules.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
