Concepts, value, and typical clone scenarios — less code.
Concepts, value, and typical clone scenarios — less code.
Підготовка контенту платформи Ring
Підготовка контенту платформи Ring
Підготовка контенту платформи Ring
Filter with Founder / Developer in the docs sidebar. Legacy copy claimed 12 endpoints, fabricated GET /api/admin/users list/search, GET /api/admin/analytics, IP whitelisting, and admin-only rate limits — none verified in this tree. Below matches app/api/admin/**/route.ts as of v1.6.4.
Admin routes power the Admin console (/admin/*): user roles, entity moderation, verification desk, store order status, platform branding/AI settings, ProcessConductor pipelines, Web3 desk tools, and Email AI-CRM. All browser calls use Auth.js session cookies on the same origin — see API reference.
| Guard | Roles | Typical routes |
|---|---|---|
isPlatformAdmin() | admin, superadmin | Users, orders, moderation, verification queue |
isSuperadmin() / requireSuperadminApi() | superadmin only | Platform settings, processes, Web3 desk, branding save |
| Service-layer checks | Admin in domain service | Entity moderation queue, verification actions |
requireEmailAdmin() | Platform admin + email CRM | /api/admin/email/* |
SSOT: features/auth/user-role.ts — lowercase roles (visitor … superadmin).
These HTTP handlers back buttons in the admin UI — you rarely call them manually unless automating ops.
Role-aware three-pane nav, Security hub tabs, Email CRM shell — UI SSOT for these APIs.
View one user, change role, manual verification badge, delete account (not self), Payments tab (membership + wallet top-up ledger).
Security hub (fraud / verification / events), entity moderation queue, KYC procedures.
Filter with Founder / Developer in the docs sidebar. Legacy copy claimed 12 endpoints, fabricated GET /api/admin/users list/search, GET /api/admin/analytics, IP whitelisting, and admin-only rate limits — none verified in this tree. Below matches app/api/admin/**/route.ts as of v1.6.4.
Admin routes power the Admin console (/admin/*): user roles, entity moderation, verification desk, store order status, platform branding/AI settings, ProcessConductor pipelines, Web3 desk tools, and Email AI-CRM. All browser calls use Auth.js session cookies on the same origin — see API reference.
| Guard | Roles | Typical routes |
|---|---|---|
isPlatformAdmin() | admin, superadmin | Users, orders, moderation, verification queue |
isSuperadmin() / requireSuperadminApi() | superadmin only | Platform settings, processes, Web3 desk, branding save |
| Service-layer checks | Admin in domain service | Entity moderation queue, verification actions |
requireEmailAdmin() | Platform admin + email CRM | /api/admin/email/* |
SSOT: features/auth/user-role.ts — lowercase roles (visitor … superadmin).
These HTTP handlers back buttons in the admin UI — you rarely call them manually unless automating ops.
Role-aware three-pane nav, Security hub tabs, Email CRM shell — UI SSOT for these APIs.
View one user, change role, manual verification badge, delete account (not self), Payments tab (membership + wallet top-up ledger).
Security hub (fraud / verification / events), entity moderation queue, KYC procedures.
Filter with Founder / Developer in the docs sidebar. Legacy copy claimed 12 endpoints, fabricated GET /api/admin/users list/search, GET /api/admin/analytics, IP whitelisting, and admin-only rate limits — none verified in this tree. Below matches app/api/admin/**/route.ts as of v1.6.4.
Admin routes power the Admin console (/admin/*): user roles, entity moderation, verification desk, store order status, platform branding/AI settings, ProcessConductor pipelines, Web3 desk tools, and Email AI-CRM. All browser calls use Auth.js session cookies on the same origin — see API reference.
| Guard | Roles | Typical routes |
|---|---|---|
isPlatformAdmin() | admin, superadmin | Users, orders, moderation, verification queue |
isSuperadmin() / requireSuperadminApi() | superadmin only | Platform settings, processes, Web3 desk, branding save |
| Service-layer checks | Admin in domain service | Entity moderation queue, verification actions |
requireEmailAdmin() | Platform admin + email CRM | /api/admin/email/* |
SSOT: features/auth/user-role.ts — lowercase roles (visitor … superadmin).
These HTTP handlers back buttons in the admin UI — you rarely call them manually unless automating ops.
Role-aware three-pane nav, Security hub tabs, Email CRM shell — UI SSOT for these APIs.
View one user, change role, manual verification badge, delete account (not self), Payments tab (membership + wallet top-up ledger).
Security hub (fraud / verification / events), entity moderation queue, KYC procedures.
Advance order status: new → paid → processing → shipped → completed / canceled.
GET /api/admin/users/{id}/payments (membership_upgrade + wallet_topup from payment_transactions).PUT /api/admin/users/{id}/role or legacy POST /api/admin/set-user-role./admin/security?tab=verification (legacy /admin/verification redirects here) → POST /api/admin/verification/procedures/{n}/{action} (approve, reject, request-info, under-review).POST /api/admin/entity-moderation/block with entityId + reason.POST /api/admin/whitelabel/save (redirects to admin settings).POST /api/admin/web3/settings with { "ringPerUsd": "..." }; persisted in platform_settings web3 namespace.Superadmin-only changes (AI keys, branding JSON, manual pipeline runs, RING oracle rate) affect every user — restrict superadmin role count on production clones.
/api/admin/users/[id] |
| Platform admin |
| Cannot delete self |
| PUT | /api/admin/users/[id]/role | Platform admin | Body: { "role": "member" } |
| PUT | /api/admin/users/[id]/verification | Admin manual verification | Body: { "isVerified": true, ... } |
| POST | /api/admin/set-user-role | Platform admin | Legacy: { "uid", "role" }; blocks admin self-demotion |
Not implemented: GET /api/admin/users list/search — use Admin UI server loaders or DatabaseService in custom tooling.
Payments tab UI: features/auth/components/admin-user-detail-sheet.tsx (opened from admin-user-manager.tsx Eye button) fetches /api/admin/users/${user.id}/payments?limit=50.
| Method | Path | Notes |
|---|---|---|
| GET | /api/admin/entity-moderation | { items: EntityModerationQueueItem[] } |
| POST | /api/admin/entity-moderation/block | { entityId, reason } |
| GET | /api/admin/verification/queue | { success, queue } |
| POST | /api/admin/verification/procedures/[procedureNumber]/[action] | approve | reject | request-info | under-review |
| Method | Path | Body |
|---|---|---|
| POST | /api/admin/orders/[id]/status | { "status": "processing" } — enum: new, paid, processing, shipped, completed, canceled |
| Method | Path | Notes |
|---|---|---|
| GET | /api/admin/platform-settings?namespace=ai|branding | Read namespace |
| PUT | /api/admin/platform-settings | JSON body: { namespace, data, secrets? } |
| POST | /api/admin/whitelabel/save | Form POST → branding colors → redirect |
| POST | /api/admin/save | Legacy branding save (JSON redirect) |
Persistence (verified): features/admin/platform-settings/platform-settings-service.ts reads and writes the platform_settings collection through db() from @/lib/database — not a private pg.Pool. Namespaces ai and branding use readDoc / updateDoc / createDoc with in-process namespace cache (platform-settings-cache.ts).
| Env | Effect |
|---|---|
PLATFORM_SETTINGS_DISABLE_DB=true | Reads return defaults / null; writes throw — use for CI or env-only clones |
importPlatformSettingsFromEnv() seeds ai and branding from env + ring-config.json on first boot when DB rows are missing.
| Method | Path | Notes |
|---|---|---|
| GET | /api/admin/processes | Lists pipelines |
| POST | /api/admin/processes/[id]/run | Manual pipeline trigger |
| GET | /api/admin/processes/[id]/history | Run history |
Cron equivalents use /api/cron/* + CRON_SECRET — see ProcessConductor docs in Monitoring.
| Method | Path | Notes |
|---|---|---|
| GET | /api/admin/web3/settings | Oracle rate, desk config, audit log, gas reserve |
| POST | /api/admin/web3/settings | { "ringPerUsd": "..." } |
| GET | /api/admin/web3/gas-reserve | Solana fee-payer balance |
Oracle persistence: features/wallet/services/ring-token-oracle.ts stores ringPerUsd and audit rows in platform_settings doc id web3 via the same db() API. When PLATFORM_SETTINGS_DISABLE_DB=true, reads fall back to RING_ORACLE_DEFAULT_RATE (or 100) and writes are blocked.
Full route table: Email AI-CRM API — threads, drafts, tasks, contacts, GET /api/admin/email/analytics?range=7d.
| Method | Path | Purpose |
|---|---|---|
| POST | /api/admin/migrate-users | One-off user migration helper — not for routine ops |
/api/admin)| Method | Path | Auth |
|---|---|---|
| GET | /api/analytics/platform-stats | Platform admin |
| GET | /api/analytics/web-vitals?scope=platform | Platform admin |
| GET | /api/analytics/errors | Platform admin |
UI: /admin/analytics → getPlatformAnalytics() (features/analytics/services/get-platform-analytics.ts).
Sign in with an admin or superadmin account.
Re-fetch user or open Admin → Users; role is lowercase in users.data.role.
Member-facing desk quotes; admin rate via Web3 desk above.
Advance order status: new → paid → processing → shipped → completed / canceled.
GET /api/admin/users/{id}/payments (membership_upgrade + wallet_topup from payment_transactions).PUT /api/admin/users/{id}/role or legacy POST /api/admin/set-user-role./admin/security?tab=verification (legacy /admin/verification redirects here) → POST /api/admin/verification/procedures/{n}/{action} (approve, reject, request-info, under-review).POST /api/admin/entity-moderation/block with entityId + reason.POST /api/admin/whitelabel/save (redirects to admin settings).POST /api/admin/web3/settings with { "ringPerUsd": "..." }; persisted in platform_settings web3 namespace.Superadmin-only changes (AI keys, branding JSON, manual pipeline runs, RING oracle rate) affect every user — restrict superadmin role count on production clones.
/api/admin/users/[id] |
| Platform admin |
| Cannot delete self |
| PUT | /api/admin/users/[id]/role | Platform admin | Body: { "role": "member" } |
| PUT | /api/admin/users/[id]/verification | Admin manual verification | Body: { "isVerified": true, ... } |
| POST | /api/admin/set-user-role | Platform admin | Legacy: { "uid", "role" }; blocks admin self-demotion |
Not implemented: GET /api/admin/users list/search — use Admin UI server loaders or DatabaseService in custom tooling.
Payments tab UI: features/auth/components/admin-user-detail-sheet.tsx (opened from admin-user-manager.tsx Eye button) fetches /api/admin/users/${user.id}/payments?limit=50.
| Method | Path | Notes |
|---|---|---|
| GET | /api/admin/entity-moderation | { items: EntityModerationQueueItem[] } |
| POST | /api/admin/entity-moderation/block | { entityId, reason } |
| GET | /api/admin/verification/queue | { success, queue } |
| POST | /api/admin/verification/procedures/[procedureNumber]/[action] | approve | reject | request-info | under-review |
| Method | Path | Body |
|---|---|---|
| POST | /api/admin/orders/[id]/status | { "status": "processing" } — enum: new, paid, processing, shipped, completed, canceled |
| Method | Path | Notes |
|---|---|---|
| GET | /api/admin/platform-settings?namespace=ai|branding | Read namespace |
| PUT | /api/admin/platform-settings | JSON body: { namespace, data, secrets? } |
| POST | /api/admin/whitelabel/save | Form POST → branding colors → redirect |
| POST | /api/admin/save | Legacy branding save (JSON redirect) |
Persistence (verified): features/admin/platform-settings/platform-settings-service.ts reads and writes the platform_settings collection through db() from @/lib/database — not a private pg.Pool. Namespaces ai and branding use readDoc / updateDoc / createDoc with in-process namespace cache (platform-settings-cache.ts).
| Env | Effect |
|---|---|
PLATFORM_SETTINGS_DISABLE_DB=true | Reads return defaults / null; writes throw — use for CI or env-only clones |
importPlatformSettingsFromEnv() seeds ai and branding from env + ring-config.json on first boot when DB rows are missing.
| Method | Path | Notes |
|---|---|---|
| GET | /api/admin/processes | Lists pipelines |
| POST | /api/admin/processes/[id]/run | Manual pipeline trigger |
| GET | /api/admin/processes/[id]/history | Run history |
Cron equivalents use /api/cron/* + CRON_SECRET — see ProcessConductor docs in Monitoring.
| Method | Path | Notes |
|---|---|---|
| GET | /api/admin/web3/settings | Oracle rate, desk config, audit log, gas reserve |
| POST | /api/admin/web3/settings | { "ringPerUsd": "..." } |
| GET | /api/admin/web3/gas-reserve | Solana fee-payer balance |
Oracle persistence: features/wallet/services/ring-token-oracle.ts stores ringPerUsd and audit rows in platform_settings doc id web3 via the same db() API. When PLATFORM_SETTINGS_DISABLE_DB=true, reads fall back to RING_ORACLE_DEFAULT_RATE (or 100) and writes are blocked.
Full route table: Email AI-CRM API — threads, drafts, tasks, contacts, GET /api/admin/email/analytics?range=7d.
| Method | Path | Purpose |
|---|---|---|
| POST | /api/admin/migrate-users | One-off user migration helper — not for routine ops |
/api/admin)| Method | Path | Auth |
|---|---|---|
| GET | /api/analytics/platform-stats | Platform admin |
| GET | /api/analytics/web-vitals?scope=platform | Platform admin |
| GET | /api/analytics/errors | Platform admin |
UI: /admin/analytics → getPlatformAnalytics() (features/analytics/services/get-platform-analytics.ts).
Sign in with an admin or superadmin account.
Re-fetch user or open Admin → Users; role is lowercase in users.data.role.
Member-facing desk quotes; admin rate via Web3 desk above.
Advance order status: new → paid → processing → shipped → completed / canceled.
GET /api/admin/users/{id}/payments (membership_upgrade + wallet_topup from payment_transactions).PUT /api/admin/users/{id}/role or legacy POST /api/admin/set-user-role./admin/security?tab=verification (legacy /admin/verification redirects here) → POST /api/admin/verification/procedures/{n}/{action} (approve, reject, request-info, under-review).POST /api/admin/entity-moderation/block with entityId + reason.POST /api/admin/whitelabel/save (redirects to admin settings).POST /api/admin/web3/settings with { "ringPerUsd": "..." }; persisted in platform_settings web3 namespace.Superadmin-only changes (AI keys, branding JSON, manual pipeline runs, RING oracle rate) affect every user — restrict superadmin role count on production clones.
/api/admin/users/[id] |
| Platform admin |
| Cannot delete self |
| PUT | /api/admin/users/[id]/role | Platform admin | Body: { "role": "member" } |
| PUT | /api/admin/users/[id]/verification | Admin manual verification | Body: { "isVerified": true, ... } |
| POST | /api/admin/set-user-role | Platform admin | Legacy: { "uid", "role" }; blocks admin self-demotion |
Not implemented: GET /api/admin/users list/search — use Admin UI server loaders or DatabaseService in custom tooling.
Payments tab UI: features/auth/components/admin-user-detail-sheet.tsx (opened from admin-user-manager.tsx Eye button) fetches /api/admin/users/${user.id}/payments?limit=50.
| Method | Path | Notes |
|---|---|---|
| GET | /api/admin/entity-moderation | { items: EntityModerationQueueItem[] } |
| POST | /api/admin/entity-moderation/block | { entityId, reason } |
| GET | /api/admin/verification/queue | { success, queue } |
| POST | /api/admin/verification/procedures/[procedureNumber]/[action] | approve | reject | request-info | under-review |
| Method | Path | Body |
|---|---|---|
| POST | /api/admin/orders/[id]/status | { "status": "processing" } — enum: new, paid, processing, shipped, completed, canceled |
| Method | Path | Notes |
|---|---|---|
| GET | /api/admin/platform-settings?namespace=ai|branding | Read namespace |
| PUT | /api/admin/platform-settings | JSON body: { namespace, data, secrets? } |
| POST | /api/admin/whitelabel/save | Form POST → branding colors → redirect |
| POST | /api/admin/save | Legacy branding save (JSON redirect) |
Persistence (verified): features/admin/platform-settings/platform-settings-service.ts reads and writes the platform_settings collection through db() from @/lib/database — not a private pg.Pool. Namespaces ai and branding use readDoc / updateDoc / createDoc with in-process namespace cache (platform-settings-cache.ts).
| Env | Effect |
|---|---|
PLATFORM_SETTINGS_DISABLE_DB=true | Reads return defaults / null; writes throw — use for CI or env-only clones |
importPlatformSettingsFromEnv() seeds ai and branding from env + ring-config.json on first boot when DB rows are missing.
| Method | Path | Notes |
|---|---|---|
| GET | /api/admin/processes | Lists pipelines |
| POST | /api/admin/processes/[id]/run | Manual pipeline trigger |
| GET | /api/admin/processes/[id]/history | Run history |
Cron equivalents use /api/cron/* + CRON_SECRET — see ProcessConductor docs in Monitoring.
| Method | Path | Notes |
|---|---|---|
| GET | /api/admin/web3/settings | Oracle rate, desk config, audit log, gas reserve |
| POST | /api/admin/web3/settings | { "ringPerUsd": "..." } |
| GET | /api/admin/web3/gas-reserve | Solana fee-payer balance |
Oracle persistence: features/wallet/services/ring-token-oracle.ts stores ringPerUsd and audit rows in platform_settings doc id web3 via the same db() API. When PLATFORM_SETTINGS_DISABLE_DB=true, reads fall back to RING_ORACLE_DEFAULT_RATE (or 100) and writes are blocked.
Full route table: Email AI-CRM API — threads, drafts, tasks, contacts, GET /api/admin/email/analytics?range=7d.
| Method | Path | Purpose |
|---|---|---|
| POST | /api/admin/migrate-users | One-off user migration helper — not for routine ops |
/api/admin)| Method | Path | Auth |
|---|---|---|
| GET | /api/analytics/platform-stats | Platform admin |
| GET | /api/analytics/web-vitals?scope=platform | Platform admin |
| GET | /api/analytics/errors | Platform admin |
UI: /admin/analytics → getPlatformAnalytics() (features/analytics/services/get-platform-analytics.ts).
Sign in with an admin or superadmin account.
Re-fetch user or open Admin → Users; role is lowercase in users.data.role.
Member-facing desk quotes; admin rate via Web3 desk above.