kushkapadia / kushkapadia/servitect
Admin Panel for Managing Data
- Dominant language
- JavaScript
- Stars
- 46
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
**Objective**: Build a simple admin interface for managing models. Use the generated models, routes, and controllers from #8 for faster development.
#### Description:
We need to create an admin panel for managing the entities defined in the configuration object (e.g., users, items, bills). This admin panel will be built using EJS templates (or similar tools) and basic HTML forms for Create, Read, Update, and Delete (CRUD) operations.
We have Django Admin which provide such UI in python, Swagger(OpenAPI) provides UI for APIs. A combination of both that can be used by naive user for managing the inventory or viewing data.
**Tasks**:
1. **Admin Routes Setup**:
- Create Express routes for serving the admin panel. Use the models and controllers generated in **Issue 1** for handling the backend logic.
- Admin routes should map to respective CRUD operations (e.g., `/admin/users`, `/admin/items`, etc.).
2. **Admin Views**:
- **Layout View**:
- Create a reusable layout in `views/layout.ejs` that contains a header with navigation links (e.g., Users, Items, Bills).
- **List View**:
- Generate a list view for each model (e.g., `views/admin/users.ejs`, `views/admin/items.ejs`).
- Display the records in an HTML table with options to edit or delete each item.
- **Create/Edit Views**:
- Create forms for creating and editing records (e.g., `views/admin/createUser.ejs`, `views/admin/editUser.ejs`).
- Include input validation and error handling.
3. **Method Overrides**:
- Implement method overrides to support PUT and DELETE operations using HTML forms (since forms only support POST and GET by default).
4. **Basic Authentication for Admin Access**:
- Use JWT-based authentication to secure the admin panel. Only users with admin roles should be able to access the panel.
- Ensure a login page for admin access and restrict routes accordingly.
5. **File Structure**:
- `views/admin/`: Contains all admin-related views.
- `public/`: For static assets like stylesheets and scripts.
- `controllers/`: Leverage the controllers generated in **Issue 1** for CRUD operations.
**Deliverables**:
- A basic admin panel with:
- List views for Users, Items, and Bills.
- Create and Edit forms for each entity.
- Basic JWT-based authentication for admin access.
- Reusable EJS layout and partial views for efficient development.
**Note**: Ensure that the structure and components generated in #8 are leveraged to make the admin panel more robust and consistent.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.