This document describes the new industry focus management feature that allows admins to dynamically manage industry focuses used in speaker profiles and forms.
The industry focus management system allows administrators to:
- Add new industry focuses
- Edit existing industry focuses
- Toggle the active/inactive status of industry focuses
- Delete industry focuses
- View all industry focuses in a table format
No hardcoded industry focuses or areas of expertise are used - all values are managed dynamically through the admin interface, ensuring data consistency and allowing for easy updates without code changes.
- File:
server/src/models/industryFocus.model.ts - Collection:
industryfocuses - Fields:
name(required, unique): The name of the industry focusdescription(optional): A description of the industry focusisActive(boolean): Whether the industry focus is active and visible in dropdownscreatedAt(Date): When the industry focus was createdupdatedAt(Date): When the industry focus was last updated
GET /api/industry-focus- Get all active industry focuses (for dropdowns)
GET /api/industry-focus/admin- Get all industry focuses (including inactive)POST /api/industry-focus- Create a new industry focusPUT /api/industry-focus/:id- Update an existing industry focusDELETE /api/industry-focus/:id- Delete an industry focusPATCH /api/industry-focus/:id/toggle- Toggle the active status
- File:
server/src/controllers/industryFocus.controller.ts - Contains all CRUD operations for industry focuses
- File:
server/src/routes/industryFocus.route.ts - Defines all API endpoints with proper authentication middleware
- File:
client/src/AdminDashboard/AdminIndustryFocusPage.tsx - Route:
/admin-industry-focus - Features:
- Table view of all industry focuses
- Add new industry focus dialog
- Edit existing industry focus dialog
- Toggle active/inactive status with switch
- Delete confirmation dialog
- Success/error alerts
- File:
client/src/util/industryFocusApi.ts - Provides functions to fetch industry focuses from the backend
The following components now use dynamic industry focuses instead of hardcoded arrays:
client/src/Authentication/SpeakerSubmitInfo.tsxclient/src/AdminDashboard/AdminAddSpeakerPage.tsx
- Added "Industry Focuses" button to the admin sidebar
- File:
client/src/components/admin_sidebar/AdminSidebar.tsx
Run the seed script to populate the database with initial industry focuses:
# From the server directory
npx ts-node src/scripts/seedIndustryFocuses.tsThe backend routes are automatically included in the main router configuration:
- File:
server/src/routes/routers.ts
The frontend routes are automatically included in the main App component:
- File:
client/src/App.tsx
- Navigate to the admin dashboard
- Click on "Industry Focuses" in the sidebar
- Use the interface to:
- Add new industry focuses with the "Add New Industry Focus" button
- Edit existing focuses by clicking the edit icon
- Toggle active/inactive status with the switch
- Delete focuses by clicking the delete icon
Industry focuses are automatically loaded in:
- Speaker profile submission forms
- Admin speaker creation forms
- Any other forms that use industry focus dropdowns
- Only active industry focuses appear in user-facing dropdowns
- Admins can see and manage both active and inactive focuses
- Toggle status without deleting the focus
- Industry focus names must be unique (case-insensitive)
- Required fields are validated on both frontend and backend
- Proper error handling and user feedback
- If the API fails to load industry focuses, forms show an error message and disable submission
- No hardcoded fallback values are used - all industry focuses must be managed through the admin interface
- Ensures data consistency and prevents outdated hardcoded values from being used
- All admin operations require authentication and admin privileges
- Public endpoint only returns active industry focuses
- Input validation and sanitization on both frontend and backend
Potential improvements for the future:
- Bulk import/export of industry focuses
- Industry focus categories or tags
- Usage analytics (how often each focus is selected)
- Integration with speaker search and filtering