The HealtyHelp Admin Panel is a protected section of the application accessible only to users with theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/JuanSebasSV/healtyhelp/llms.txt
Use this file to discover all available pages before exploring further.
admin role. It provides full control over users, recipes, images, terms of service, and the NutriBot AI prompt.
Permission Levels
HealtyHelp uses three permission tiers, stored on theUser document.
| Level | Field values | Can access admin panel | Can delete admins | Can be deleted |
|---|---|---|---|---|
| User | role: "user" | ✗ | ✗ | Yes |
| Admin | role: "admin" | ✓ | ✗ | Yes (SuperAdmin only) |
| SuperAdmin | role: "admin" + isSuperAdmin: true | ✓ | ✓ | Never |
isSuperAdmin boolean flag is independent of role. A SuperAdmin always has role: "admin" and isSuperAdmin: true. The server rejects any attempt to delete or change the role of a SuperAdmin:
Creating the First SuperAdmin
The SuperAdmin account is bootstrapped with theinitSuperAdmin script. Run it once after setting up the environment:
Inviting New Admins
New admin accounts are created through a token-based invitation flow. Regular user sign-ups cannot receive theadmin role directly.
Step 1 — Send the invitation
- Verifies the email is not already registered.
- Creates an
AdminInvitationdocument with a SHA-256-hashed token and a 24-hour expiry. - Returns the invite URL (
FRONTEND_URL/admin/accept-invite/<raw_token>).
Step 2 — Accept the invitation
This endpoint is public — no authentication required:User document is created with role: "admin" and the invitation is marked used: true.
Managing pending invitations
| Method | Endpoint | Description |
|---|---|---|
GET | /api/admin/invitations | List all unused invitations |
DELETE | /api/admin/invitations/:id | Revoke an invitation |
Dashboard Component
TheDashboard React component (client/src/components/admin/Dashboard.jsx) is the root of the admin panel. On mount it fetches /api/admin/stats and /api/admin/users in parallel, then renders five navigation tabs:
| Tab | Component | Description |
|---|---|---|
| Usuarios | UserList | Manage, ban, and message users |
| Recetas | RecipeManagement | Create, import, export, and delete recipes |
| Términos | TermsManager | Publish new terms-of-service versions |
| Imágenes | ImagenesAprobacion | Approve or reject review images |
| Asistente IA | PanelIA | Edit the NutriBot system prompt |
/api/admin/imagenes-resenas?estado=pendiente every 60 seconds.
Stats Endpoint
imagenesPendientes is computed with an aggregation pipeline over the Recipe.resenas[].imagen.estado field.
Audit Logs
Every admin action (role change, ban, recipe creation, image approval, etc.) is automatically recorded in theAdminLog collection via the internal logAdminAction helper.
Admin Sub-pages
User Management
List users, change roles, ban/unban, and delete accounts.
Recipe Management
Create, update, bulk-import, and export recipes with full nutritional data.
Image Moderation
Approve or reject images uploaded by users in recipe reviews.
Terms & AI Config
Publish new terms-of-service versions and configure the NutriBot system prompt.