Frontend UI Audit ReportΒΆ
Generated: 2025-12-05 Updated: 2025-12-11 Framework: FastHTML with Jinja2 + TailwindCSS Status: Core CRUD features complete, stub pages remain for future features
Executive SummaryΒΆ
The cbapp frontend uses FastHTML (Python-based server-side rendering) with Jinja2 templates. All core CRUD operations are now wired to real APIs. Only stub pages for future features remain unimplemented.
Key Finding: Phase 1 (Events + Dashboard) and Phase 2 (Audience CRUD) are complete. Phase 3 stub pages need requirements definition before implementation.
Technology StackΒΆ
| Component | Technology | Notes |
|---|---|---|
| Backend Server | FastAPI | Python async web framework |
| Frontend Server | FastHTML + Starlette | Runs separately, proxies API requests |
| Templating | Jinja2 | Server-side HTML rendering |
| UI Framework | Tailwind CSS 2.2.19 | CSS utility framework (CDN) |
| Icons | Font Awesome 6.0 | SVG/CSS icons (CDN) |
| Interactivity | HTMX 1.9.2 | Form submissions and dynamic updates |
| HTTP Client | httpx | Async Python HTTP for API calls |
Feature Status MatrixΒΆ
Fully Working (Real API Integration)ΒΆ
| Feature | Frontend Route | Backend API | Notes |
|---|---|---|---|
| Dashboard | /dashboard |
/api/persons, /api/events |
β Real counts and recent items |
| Audience List | /audience |
GET /api/persons |
β Filtering, pagination, search |
| Audience Detail | /audience/{id} |
GET /api/persons/{id} |
β View member details |
| Audience Create | /audience/new |
POST /api/persons |
β Form wired to API |
| Audience Edit | /audience/{id}/edit |
PUT /api/persons/{id} |
β Form wired to API |
| Audience Delete | /audience/{id}/delete |
DELETE /api/persons/{id} |
β Calls API |
| Events List | /events |
GET /api/events |
β Real events from API |
| Event Detail | /events/{id} |
GET /api/events/{id} |
β Real event data |
| Event Create | /events/new |
POST /api/events |
β Form wired to API |
| Event Edit | /events/{id}/edit |
PUT /api/events/{id} |
β Form wired to API |
| Event Delete | /events/{id}/delete |
DELETE /api/events/{id} |
β Calls API |
| User Management | /users/* |
/api/users/* |
β Full CRUD working |
| Segments | /segments |
/api/segments/* |
β Chat interface, execute segments |
| i360 Search | /i360 |
/api/i360/* |
β Voter lookup working |
| Settings/Tags | /settings |
/api/tags/*, /api/users |
β Tag hierarchy display |
| Semantic Search | /audiencev2 |
/api/persons/search/semantic |
β Advanced search with embeddings |
Stub Pages (No Backend, No Implementation) - Phase 3ΒΆ
| Feature | Frontend Route | GitHub Issue | Notes |
|---|---|---|---|
| Communications | /communications |
#25 | SMS/email/call logging - needs backend |
| Reports | /reports |
#26 | Needs requirements definition |
| Goals | /goals |
#27 | Needs requirements definition |
| Maps | /maps |
#28 | Geographic visualization - evaluate need |
| Imports | /imports |
#29 | May overlap with tenant manager |
| Tags (main page) | /tags |
- | Stub - tag management is in Settings |
Detailed FindingsΒΆ
β
COMPLETED: Dashboard (/dashboard)ΒΆ
Location: src/app/main.py lines 392-450
Status: β Implemented - Uses real API calls at lines 401-403
β
COMPLETED: Events Module (/events/*)ΒΆ
Location: src/app/main.py lines 870-1089
Status: β
All routes wired to API:
- List: line 887 - api_request("get", "/events", ...)
- Detail: line 984 - api_request("get", f"/events/{event_id}", ...)
- Create: line 951 - api_request("post", "/events", ...)
- Edit: line 1031 - api_request("put", f"/events/{event_id}", ...)
- Delete: line 1080 - api_request("delete", f"/events/{event_id}", ...)
β
COMPLETED: Audience CRUD (/audience/*)ΒΆ
Location: src/app/main.py lines 580-850
Status: β
All routes wired to API:
- Create: line 619 - api_request("post", "/persons/", ...)
- Edit: line 777 - api_request("put", f"/persons/{member_id}", ...)
- Delete: line 839 - api_request("delete", f"/persons/{member_id}", ...)
π² STUB: Communications (/communications)ΒΆ
Location: src/app/main.py lines 945-953, src/app/templates/communications/index.html
Current State: Template exists with filter dropdowns but no functionality.
Backend API: Does not exist - needs to be created.
Scope: This is a larger feature requiring: - Backend: Communication model, routes for SMS/email logs - Frontend: List view, detail view, compose interface - Integration: External SMS/email service
File StructureΒΆ
src/app/
βββ main.py # All route handlers
βββ static/
β βββ images/ # Logos and branding
β βββ css/styles.css
β βββ fusion/ # Data viewer assets
βββ templates/
βββ layout.html # Master template with nav
βββ login.html
βββ dashboard.html # β
Working
βββ audience/
β βββ index.html # β
Working
β βββ v2.html # β
Working (semantic search)
β βββ detail.html # β
Working
β βββ form.html # β
Working (create/edit)
βββ events/
β βββ index.html # β
Working
β βββ detail.html # β
Working
β βββ form.html # β
Working (create/edit)
βββ segments/
β βββ index.html # β
Working
βββ communications/
β βββ index.html # π² Stub (#25)
βββ i360/
β βββ search.html # β
Working
β βββ detail.html # β
Working
βββ settings/
β βββ index.html # β
Working
βββ users/
β βββ index.html # β
Working
β βββ detail.html # β
Working
β βββ form.html # β
Working
βββ [tags|maps|goals|reports|imports]/
βββ index.html # π² Stubs (#26-29)
Implementation StatusΒΆ
β Phase 1: Quick Wins - COMPLETEΒΆ
All Events and Dashboard routes now use real API calls.
β Phase 2: Audience CRUD - COMPLETEΒΆ
All Audience CRUD operations now use real API calls.
π² Phase 3: New Features (Requires backend work)ΒΆ
Open GitHub Issues: - #25 Communications - Design and implement full feature - #26 Reports - Define requirements, implement - #27 Goals - Define requirements, implement - #28 Maps - Evaluate need, implement if required - #29 Imports - May already exist in tenant manager
API Helper ReferenceΒΆ
The frontend has a well-implemented API helper at main.py lines 154-202:
async def api_request(method, endpoint, token=None, data=None, params=None):
"""Make authenticated API request to backend."""
# Returns parsed JSON or error dict
# Handles 401 SESSION_EXPIRED automatically
All routes should use this helper for consistency.
Notes for DiscussionΒΆ
- Event Registrations: The backend supports event registrations with check-in status. Should the UI show:
- Registration list on event detail page?
- Check-in interface for day-of operations?
-
Registration counts on event list?
-
Audience Tags: The create/edit forms have hardcoded tag lists. Should these:
- Fetch from
/api/tagsdynamically? - Support creating new tags inline?
-
Use tag hierarchy for organization?
-
Bulk Operations: The audience list has selection checkboxes. What bulk operations should be supported?
- Bulk tag assignment?
- Bulk delete?
-
Export selected?
-
Communications Priority: Is this an MVP feature or can it wait? Options:
- Full SMS/email integration
- Simple activity log only
- Defer entirely
Your Turn!ΒΆ
Please review this audit and add your thoughts below. After dinner, let's plan the implementation approach!