docs: update documentation to reflect Discord role-based access control integration for forms
This commit is contained in:
@@ -184,7 +184,13 @@ Erika is a Next.js website for the content creator "Erika!". It has two main fea
|
||||
| `db/index.ts` | Drizzle ORM client initialization, exports `db` |
|
||||
| `db/schema.ts` | Barrel file re-exporting all schemas |
|
||||
| `db/schema/account.ts` | NextAuth account tables (`user`, `account`, `session`, `verificationToken`) in the `account` PostgreSQL schema. Users have a `discordId` field. |
|
||||
| `db/schema/form.ts` | Form system tables in the `form` PostgreSQL schema: `forms` (form metadata, webhook config), `questions` (question definitions with types: text/textarea/radio/checkbox), `submissions` (user submissions with edit history), `answers` (individual answers) |
|
||||
| `db/schema/form.ts` | Form system tables in the `form` PostgreSQL schema: `forms` (form metadata, webhook config, Discord role access control), `questions` (question definitions with types: text/textarea/radio/checkbox), `submissions` (user submissions with edit history), `answers` (individual answers) |
|
||||
|
||||
### `app/actions/` — Server Actions
|
||||
|
||||
| File | Purpose |
|
||||
|---|---|
|
||||
| `app/actions/discord.ts` | Fetches Discord server roles natively via API for admin configuration and user access control |
|
||||
|
||||
### `app/` — Routes
|
||||
|
||||
@@ -203,7 +209,7 @@ Erika is a Next.js website for the content creator "Erika!". It has two main fea
|
||||
| `app/form/page.tsx` | Lists all **open** forms for users to fill out |
|
||||
| `app/form/layout.tsx` | Form section layout with header, login state, and theme toggle. Shows a login dialog if the user is not authenticated. |
|
||||
| `app/form/client.tsx` | Client-side form components (user avatar dropdown, sign out, etc.) |
|
||||
| `app/form/[id]/page.tsx` | Individual form submission page where users answer questions |
|
||||
| `app/form/[id]/page.tsx` | Individual form submission page where users answer questions. Enforces Discord role access control (redirects to not-found if unauthorized). |
|
||||
| `app/form/[id]/layout.tsx` | Layout for individual form pages |
|
||||
|
||||
#### `/admin` — Admin Panel (admin-only)
|
||||
@@ -223,7 +229,7 @@ Erika is a Next.js website for the content creator "Erika!". It has two main fea
|
||||
| `app/admin/form/[id]/page.tsx` | Admin form editor page |
|
||||
| `app/admin/form/[id]/client.tsx` | Client-side admin form editor components (question builder, drag-and-drop, settings) |
|
||||
| `app/admin/form/[id]/result/` | Admin view of form submission results |
|
||||
| `app/admin/form/[id]/extra/` | Additional admin form settings |
|
||||
| `app/admin/form/[id]/extra/` | Additional admin form settings (Discord webhook templates, Role-based Access Control via Shadcn DropdownMenu) |
|
||||
|
||||
#### `/admin/backend` — Backend Settings
|
||||
|
||||
|
||||
Reference in New Issue
Block a user