Pages
Admin Panel [TODO]
Documentation for the Admin Panel built with Angular and Nest.js, featuring user management via AdminUsersListComponent and AdminPanelComponent, and CSV export functionality.
Features
- Manage users via the Admin Panel.
- Display a list of users with search and filter options.
- Export users to a CSV file.
Frontend (Angular)
Key Components
- AdminPanelComponent
- Serves as the main container for the admin functionalities.
- Provides navigation and integrates multiple subcomponents.
- AdminUsersListComponent
- Displays a list of users.
- Includes searching, filtering, and pagination.
- Handles user-specific actions like editing and deletion.
Setup
- Use
<app-admin-panel></app-admin-panel>to display the admin panel interface.
Backend (Nest.js)
Key Endpoints
-
GET /admin/users
- Fetches the list of users.
- Supports query parameters for pagination and filtering.
-
GET /admin/users/export
- Generates and downloads a CSV file with user data.
Setup
- Ensure the
AdminControllerandAdminServiceare registered in theAdminModule. - Configure necessary DTOs and validation pipes.
How to Export Users to CSV
- Navigate to the Admin Panel using
<app-admin-panel>. - Within the AdminUsersListComponent, click the Export to CSV button.
- The app generates a CSV file and triggers a download.
Additional Notes
- Ensure CORS is configured in the Nest.js application if the Angular app is hosted on a different domain.
- Add proper authentication and authorization to secure user data.
- Use guards to restrict access to admin-specific routes.