admin role and provides full CRUD (Create, Read, Update, Delete) operations.
Features
The admin panel includes the following capabilities:Product Management
Add, edit, and delete products from the catalog
Real-time Updates
Changes are immediately reflected via API integration
Product Listing
View all products with images, names, and prices
Modal Forms
User-friendly modal dialogs for adding and editing products
Admin Panel Interface
The admin panel is implemented in theAdmin component (/workspace/source/src/layout/Admin.jsx) and provides:
Navigation
- Logout button: Clears authentication and redirects to home
- Admin link: Quick navigation to admin panel
Product Display
Products are displayed in a grid layout with:- Product image
- Product name
- Product price
- Action buttons (Edit/Delete)
Action Buttons
Add Product Button
Add Product Button
Edit Button
Edit Button
Delete Button
Delete Button
Access Control
The admin panel is protected by:- Authentication check: User must be logged in
- Role verification: User must have
adminrole - Route protection: Implemented via
RutaProtegidacomponent
State Management
The admin panel uses theAdminContext to manage:
- Product list
- Loading states
- Modal visibility (add/edit)
- Selected product for editing
- CRUD operations
/workspace/source/src/context/AdminContext.jsx