The admin role is the superuser tier of CoffePrice. Admins have unrestricted read and write access across all data, can approve or reject buyer registrations, moderate platform content, and tune configuration settings that affect every user. Because the admin role carries significant privilege, there is no self-service registration path — admin accounts must be provisioned directly.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JaiderT/CoffeePrice/llms.txt
Use this file to discover all available pages before exploring further.
There is no public registration flow for admin accounts. An admin account must be created directly in the MongoDB database or promoted from an existing account by a current admin (via
PUT /api/usuario/:id/actualizar with "rol": "admin").Admin Dashboard
The admin dashboard at/admin/dashboard gives a real-time overview of platform activity, including:
- Total registered users broken down by role and estado
- Pending buyer approval requests
- Recent news articles and their publication status
- Platform configuration summary
- Pending review moderation queue
User Management
Admins have full CRUD control over every user account on the platform.- List all users
- Change user state
- Update user data
- Delete user
password, codigoRecuperacion, codigoVerificacion, etc.) are stripped from the response.Buyer Approval
Buyer approval is the most time-sensitive admin task. When a new comprador completes their profile, all active admins receive an email notification. The approval workflow is managed through the comprador API.Review pending buyers
estadoRevision, including those in enRevision. Each document is populated with the linked user’s nombre, apellido, email, and estado.Approve or reject via user state
Use
PUT /api/usuario/:id/estado (see User Management above) with estado: "activo" to approve or estado: "rechazado" to reject. This is the canonical approval path because it updates both the user record and the buyer’s estadoRevision atomically and triggers the decision email.News Management
CoffePrice surfaces coffee industry news to all users. Admins control the full lifecycle of news articles.| Endpoint | Method | Description |
|---|---|---|
/api/noticias | POST | Create a new news article manually |
/api/noticias/:id | PUT | Update an existing article |
/api/noticias/:id | DELETE | Remove an article from the platform |
/api/noticias/generar-automaticas | POST | Trigger the AI pipeline to generate news articles automatically |
/api/noticias/limpiar-danadas | POST | Remove or repair malformed/broken articles from the database |
Creating an Article Manually
AI-Generated News
Platform Configuration
Global platform settings (such as price update intervals, alert thresholds, feature flags, and notification preferences) are stored in a single configuration document.GET /api/configuracion and PUT /api/configuracion are restricted to the admin role. Non-admin users receive a 403 response.Review Moderation
Users can submit platform reviews. Admins moderate the queue before reviews become publicly visible.| Endpoint | Method | Description |
|---|---|---|
/api/resenas-plataforma/todas | GET | List all submitted reviews (including pending ones) |
/api/resenas-plataforma/:id/aprobar | PUT | Approve a review and make it publicly visible |
/api/resenas-plataforma/:id | DELETE | Remove a review permanently |
Approving a Review
200 response confirms the review has been approved. Approved reviews appear in the public-facing section of the platform landing page.
Admin Frontend Routes
| Route | Component | Description |
|---|---|---|
/admin/dashboard | DashboardAdmin | Platform activity overview |
/admin/perfil | PerfilAdmin | Admin’s own profile and account settings |
/configuracion | Configuracion | Platform configuration editor |
/historial | Historial | Full price history (accessible to admins and producers) |
/predicciones | Predicciones | Price prediction view |
/mapa | MapaCompradores | Regional buyer map (rendered in LayoutComprador) |
Permission Summary
| Action | Endpoint | Admin | Comprador | Productor |
|---|---|---|---|---|
| List all users | GET /api/usuario | ✅ | ❌ | ❌ |
| Change user estado | PUT /api/usuario/:id/estado | ✅ | ❌ | ❌ |
| List all buyers | GET /api/comprador | ✅ | ❌ | ❌ |
| Update any buyer | PUT /api/comprador/:id | ✅ | Owner only | ❌ |
| Create news | POST /api/noticias | ✅ | ❌ | ❌ |
| Platform config | PUT /api/configuracion | ✅ | ❌ | ❌ |
| Moderate reviews | PUT /api/resenas-plataforma/:id/aprobar | ✅ | ❌ | ❌ |
| View prices | GET /api/precios | ✅ | ✅ | ✅ |
| View predictions | GET /api/predicciones | ✅ (public) | ✅ (public) | ✅ (public) |