> ## Documentation Index
> Fetch the complete documentation index at: https://system.muzemus.online/llms.txt
> Use this file to discover all available pages before exploring further.

# Domains & DNS

> DNS records and custom-domain setup for muzemus.online across Firebase, Render, and Mintlify

## Domain map

| Subdomain                  | Service                                               | Target                                    |
| -------------------------- | ----------------------------------------------------- | ----------------------------------------- |
| `muzemus.online`           | Firebase Hosting — landing site `muze-mus-landing`    | `muze-mus-landing.web.app`                |
| `app.muzemus.online`       | Firebase Hosting — production portal `muze-mus`       | `muze-mus.web.app`                        |
| `stage.muzemus.online`     | Firebase Hosting — staging portal `muze-mus-stage`    | `muze-mus-stage.web.app`                  |
| `api.muzemus.online`       | Render — production backend `muze-uniform-backend`    | `muze-uniform-backend.onrender.com`       |
| `stage-api.muzemus.online` | Render — staging backend `muze-uniform-backend-stage` | `muze-uniform-backend-stage.onrender.com` |
| `doc.muzemus.online`       | Mintlify — user guide                                 | `muze-mus.mintlify.site`                  |
| `system.muzemus.online`    | Mintlify — architecture docs                          | `muze-architecture.mintlify.site`         |

## DNS records

Add the following records at the domain provider (where `muzemus.online` was purchased). Exact record types depend on the provider; the values below are the standard forms.

| Type    | Name        | Value                                     | Notes                                                      |
| ------- | ----------- | ----------------------------------------- | ---------------------------------------------------------- |
| `A`     | `@`         | `151.101.1.195`                           | Apex → Firebase Hosting (any Firebase IP works; see below) |
| `A`     | `@`         | `151.101.65.195`                          | Apex → Firebase Hosting (second record)                    |
| `CNAME` | `www`       | `muze-mus-landing.web.app`                | Optional: www → landing                                    |
| `CNAME` | `app`       | `muze-mus.web.app`                        | Production portal                                          |
| `CNAME` | `stage`     | `muze-mus-stage.web.app`                  | Staging portal                                             |
| `CNAME` | `api`       | `muze-uniform-backend.onrender.com`       | Production API (requires Render paid plan)                 |
| `CNAME` | `stage-api` | `muze-uniform-backend-stage.onrender.com` | Staging API (requires Render paid plan)                    |
| `CNAME` | `doc`       | `muze-mus.mintlify.site`                  | User guide                                                 |
| `CNAME` | `system`    | `muze-architecture.mintlify.site`         | Architecture docs                                          |

> **Firebase apex IPs:** Firebase Hosting serves the apex domain via the two `A` records above. If the provider requires a single value, use `151.101.1.195` and add the second record if supported. Firebase will show the exact records to add when you connect the domain in the Firebase console — prefer those values over this table.

## Custom domain setup (one-time, per service)

### Firebase Hosting (landing, production, staging)

1. In the Firebase console, open **Hosting** and add the domain to the relevant site:
   * `muzemus.online` → site `muze-mus-landing`
   * `app.muzemus.online` → site `muze-mus`
   * `stage.muzemus.online` → site `muze-mus-stage`
2. Firebase shows the DNS records to add (the `A`/`CNAME` records above).
3. Add the records at the domain provider, then click **Verify** in Firebase.
4. Wait for propagation (minutes to a few hours), then Firebase provisions the TLS certificate automatically.

### Render (production and staging API)

1. Render's **free plan does not support custom domains**. Upgrade each backend service to **Starter** (or higher).
2. In the Render dashboard, open the service → **Settings** → **Custom Domains**.
3. Add `api.muzemus.online` (production service) and `stage-api.muzemus.online` (staging service).
4. Add the `CNAME` records above at the domain provider.
5. Render provisions the TLS certificate automatically.

### Mintlify (user guide and architecture docs)

1. In the Mintlify dashboard, open the site → **Settings** → **Custom domain**.
2. Add `doc.muzemus.online` (user guide) and `system.muzemus.online` (architecture).
3. Add the `CNAME` records above at the domain provider.
4. Mintlify verifies the record and provisions TLS.

## Fallback: staying on the free Render plan

If the backend services remain on the free plan, the API custom domains will not resolve. In that case, point the frontend at the `.onrender.com` URLs instead:

| Variable             | Production fallback                                  | Staging fallback                                           |
| -------------------- | ---------------------------------------------------- | ---------------------------------------------------------- |
| `VITE_API_BASE_URL`  | `https://muze-uniform-backend.onrender.com/api/v1`   | `https://muze-uniform-backend-stage.onrender.com/api/v1`   |
| `VITE_AUTH_BASE_URL` | `https://muze-uniform-backend.onrender.com/api/auth` | `https://muze-uniform-backend-stage.onrender.com/api/auth` |

Update `frontend/.env.production` / `frontend/.env.staging` accordingly and redeploy. The `BETTER_AUTH_URL` and `FRONTEND_ORIGIN` values on the Render services must match the frontend origin actually in use.

## Verification

After DNS propagates:

```bash theme={null}
dig +short muzemus.online
dig +short app.muzemus.online
dig +short stage.muzemus.online
dig +short api.muzemus.online
dig +short doc.muzemus.online
dig +short system.muzemus.online
```

Each should return the target from the domain map. Then confirm HTTPS:

```bash theme={null}
curl -I https://app.muzemus.online
curl -I https://api.muzemus.online/api/v1/health
```
