Phase 8: Frontend Development - KICKOFF π¨
Started: October 26, 2025
Estimated Time: 120 hours (3 weeks)
Status: IN PROGRESS π
π― Frontend Development Planβ
Overviewβ
Build a beautiful, intuitive UI for managing recipient groups and rules in the frontend PWA app.
Target App: apps/frontend-pwa
Tech Stack: React + TypeScript + Tailwind + React Query
Pages to Build: 2 main pages + supporting components
π Sprint Breakdownβ
Sprint 1: API Integration Layer (Week 1 - 40h)β
Goal: Connect to backend APIs with error handling and state management
Day 1-2: API Client Setup (16h)β
- Create
RecipientGroupsAPIservice - Create
RecipientRulesAPIservice - Set up React Query hooks
- Error handling utilities
- Loading state management
- Success/error toast notifications
Day 3-4: Core Hooks (16h)β
-
useRecipientGroups()- List & CRUD -
useGroupMembers()- Member management -
useRecipientRules()- List & CRUD -
usePreviewRecipients()- Preview functionality - Query invalidation strategies
- Optimistic updates
Day 5: Testing & Documentation (8h)β
- API integration tests
- Hook usage examples
- Error scenario handling
- Documentation
Sprint 2: Core Components (Week 2 - 40h)β
Goal: Build reusable components for groups and rules
Day 1-2: Group Components (16h)β
-
RecipientGroupCard- Display group info -
GroupMemberCard- Display member info -
AddMemberForm- Add member modal -
GroupFormFields- Reusable form fields - Empty states
- Loading skeletons
Day 3-4: Rule Components (16h)β
-
RecipientRuleCard- Display rule info -
RuleFormFields- Reusable form fields -
TargetingTypeSelector- Radio/dropdown for targeting -
PreviewRecipientsModal- Show who will receive - Priority indicators
- Status badges
Day 5: Shared Components (8h)β
-
MemberTypeIcon- Icon for email/phone/user -
ChannelBadge- Badge for email/sms/whatsapp -
ValidationFeedback- Error/success messages -
SearchFilter- Filter groups/rules -
SortControls- Sort options
Sprint 3: Main Pages (Week 3 - 40h)β
Goal: Complete pages for managing groups and rules
Day 1-2: Groups Management Page (16h)β
-
/settings/recipient-groupsroute - List all groups with filters
- Create new group modal
- Edit group modal
- Delete group confirmation
- Member management section
- Add member modal
- Remove member confirmation
- Search and sort functionality
Day 3-4: Rules Management Page (16h)β
-
/settings/recipient-rulesroute - List all rules with filters
- Create new rule modal
- Edit rule modal
- Delete rule confirmation
- Deactivate/activate toggle
- Preview recipients button
- Priority reordering (drag & drop optional)
Day 5: Polish & Integration (8h)β
- i18n (English + Spanish)
- Responsive design (mobile/tablet)
- Loading states
- Error states
- Empty states
- Success notifications
- Integration with settings menu
π¨ Design Systemβ
Color Schemeβ
// Tailwind classes to use
groups: "bg-blue-50 border-blue-200 text-blue-900"
rules: "bg-purple-50 border-purple-200 text-purple-900"
members: "bg-green-50 border-green-200 text-green-900"
preview: "bg-orange-50 border-orange-200 text-orange-900"
Component Patternsβ
- Cards for entities (groups, rules, members)
- Modals for create/edit forms
- Toasts for notifications
- Tables for lists
- Badges for status/types
π File Structureβ
apps/frontend-pwa/src/
βββ api/
β βββ recipient-groups.api.ts (NEW)
β βββ recipient-rules.api.ts (NEW)
βββ hooks/
β βββ useRecipientGroups.ts (NEW)
β βββ useGroupMembers.ts (NEW)
β βββ useRecipientRules.ts (NEW)
β βββ usePreviewRecipients.ts (NEW)
βββ components/
β βββ recipient-groups/
β β βββ RecipientGroupCard.tsx (NEW)
β β βββ GroupMemberCard.tsx (NEW)
β β βββ AddMemberForm.tsx (NEW)
β β βββ GroupFormFields.tsx (NEW)
β βββ recipient-rules/
β βββ RecipientRuleCard.tsx (NEW)
β βββ RuleFormFields.tsx (NEW)
β βββ TargetingTypeSelector.tsx(NEW)
β βββ PreviewRecipientsModal.tsx(NEW)
βββ pages/
β βββ RecipientGroupsPage.tsx (NEW)
β βββ RecipientRulesPage.tsx (NEW)
βββ i18n/
βββ locales/en.json (UPDATE)
βββ locales/es.json (UPDATE)
Estimated: ~30 new files, 2 updates
π Immediate Next Steps (First 4 Hours)β
Step 1: API Integration Layer (2h)β
- Create
RecipientGroupsAPIservice - Create
RecipientRulesAPIservice - Add error handling
- Add TypeScript types
Step 2: React Query Hooks (2h)β
- Create
useRecipientGroups()hook - Create
useGroupMembers()hook - Test with backend API
- Handle loading/error states
β¨ Success Criteriaβ
Week 1β
- β API client fully functional
- β React Query integrated
- β Can fetch groups/rules from backend
- β Can create/update/delete groups
- β Error handling working
Week 2β
- β All core components built
- β Components are reusable
- β Styled with Tailwind
- β Responsive design
Week 3β
- β Both pages complete
- β Full CRUD functionality
- β i18n (EN + ES)
- β Tested on mobile/tablet
- β Integrated in settings
π― Key Features to Buildβ
-
Recipient Groups Management
- List all groups for business
- Create custom groups
- Edit group details
- Delete groups
- Add members (users, emails, phones)
- Remove members
- View member details
-
Recipient Rules Management
- List all rules for business
- Create targeting rules
- Select targeting type (role/group/ad-hoc)
- Set priority
- Preview recipients
- Activate/deactivate rules
- Edit rules
- Delete rules
-
Preview Functionality
- See who will receive communications
- Filter by communication type
- Filter by channel
- Show source (rule/group/role)
- Display contact info
π Technical Requirementsβ
API Integrationβ
- β Use Axios (already in project)
- β Use React Query for state
- β Handle errors gracefully
- β Show loading states
- β Optimistic updates
Formsβ
- β Use react-hook-form (check if installed)
- β Validate on client side
- β Match backend validation rules
- β Show helpful error messages
UI/UXβ
- β Use existing Tailwind theme
- β Match existing app design
- β Responsive (mobile-first)
- β Accessible (ARIA labels)
- β Loading skeletons
- β Empty states
π Let's Build!β
Ready to create the first API service and hook! π
Starting with: RecipientGroupsAPI service
Next: Create API integration layer (2h)