Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 3 additions & 20 deletions docs/WEBAPP_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,21 +176,11 @@ The backend API will be available at `http://localhost:3000`.

## Feature Toggle System

The web interface supports two types of feature toggles:

### Global Developer Toggles

- System-wide toggles that affect all servers
- Global, system-wide toggles that affect all servers
- Only visible to developers (users in `DEVELOPER_USER_IDS`)
- Managed in Vercel Flags when `FLAGS` is configured
- Read-only in Lucky; update global values in Vercel
- API endpoints: `/api/toggles/global`

### Per-Server Toggles

- Server-specific feature toggles
- Visible/editable by server administrators
- API endpoints: `/api/guilds/:id/features`
- API endpoints: `/api/toggles/global`, `/api/features` (authenticated read-only listing)

## API Endpoints

Expand All @@ -211,17 +201,10 @@ The web interface supports two types of feature toggles:

### Feature Toggles

**Global (Developer Only):**

- `GET /api/toggles/global` - List all global toggles
- `GET /api/toggles/global/:name` - Get specific global toggle
- `POST /api/toggles/global/:name` - Rejected; global toggles are Vercel-managed

**Per-Server:**

- `GET /api/features` - List all available features
- `GET /api/guilds/:id/features` - Get guild-specific toggles
- `POST /api/guilds/:id/features/:name` - Update per-server toggle
- `GET /api/features` - List all available features (authenticated, global, not per-server — there is no per-guild feature-toggle API)

## Building for Production

Expand Down
1 change: 0 additions & 1 deletion packages/backend/src/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ const guildGuardConfigs: GuildGuardConfig[] = [
module: 'settings',
mode: 'manage',
},
{ path: '/api/guilds/:id/features', module: 'automation' },
{ path: '/api/guilds/:guildId/levels', module: 'settings' },
{ path: '/api/guilds/:guildId/starboard', module: 'settings' },
{ path: '/api/guilds/:guildId/recommendations', module: 'settings' },
Expand Down
11 changes: 0 additions & 11 deletions packages/backend/tests/unit/routes/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,6 @@ describe('setupRoutes', () => {
requireAuth,
'settings:manage',
)
expect(app.use).toHaveBeenCalledWith(
'/api/guilds/:id/features',
requireAuth,
'automation:view',
)
expect(app.use).toHaveBeenCalledWith(
'/api/guilds/:guildId/role-groups',
requireAuth,
Expand Down Expand Up @@ -284,15 +279,9 @@ describe('setupRoutes', () => {
'settings:manage',
])

const featuresGuardIndex = useCalls.findIndex(
(call) => call[0] === '/api/guilds/:id/features',
)
const rbacGuardCallOrder =
app.use.mock.invocationCallOrder[rbacGuardIndex]
const featuresGuardCallOrder =
app.use.mock.invocationCallOrder[featuresGuardIndex]
const firstRouteSetupOrder = setupAuthRoutes.mock.invocationCallOrder[0]
expect(rbacGuardCallOrder).toBeLessThan(firstRouteSetupOrder)
expect(featuresGuardCallOrder).toBeLessThan(firstRouteSetupOrder)
})
})
Loading