feat: add React client application for FireForm#402
Open
Calebnzm wants to merge 2 commits intofireform-core:mainfrom
Open
feat: add React client application for FireForm#402Calebnzm wants to merge 2 commits intofireform-core:mainfrom
Calebnzm wants to merge 2 commits intofireform-core:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: Add React Client Application
Summary
This PR introduces the complete React + TypeScript frontend for FireForm. The client connects to the existing FastAPI backend and provides a full UI for creating and managing report schemas, attaching PDF templates, configuring per-field metadata, and running canonization — all without modifying the underlying PDF files.
Motivation
The backend introduced a report-centric schema system with a rich data model, but had no user-facing interface. This PR closes that gap by delivering a client that makes the schema management workflow accessible through a modern, interactive web application.
Stack
@fontsource-variable/geist)VITE_API_URLenv var (falls back tohttp://127.0.0.1:8000)Workflow
Key Advantages
<div>s are positioned pixel-perfectly over PDF AcroForm widgets using coordinate space conversion (PDF bottom-left → CSS top-left)<datalist>surfaces all existing canonical names across the schema, making cross-template unification fast and consistentAppNavigationContextmanages panel + wizard state, enabling deep-link-like navigation (browse → create → workspace → configure) without a router libraryChanges
src/lib/api.ts (new)
src/context/app-navigation-context.tsx (new)
dashboard|schemas|templates|settings|help|search) and a nested WizardView discriminated union (browse| create |workspace|configure).navigatePanel,goHome,quickCreate,goBrowse,goCreate,goWorkspace,goConfigure.headerTitlefrom the current view/panel combination.src/pages/dashboard.tsx (new)
Promise.all([listSchemas(), listTemplates()])with a silent empty-state fallback on error.src/pages/schemas-panel.tsx (new)
Four views driven by WizardView:
src/components/pdf-field-configurator.tsx (new)
Widgetannotations and converts PDF coordinates to CSS-space positions (left = x1 × scale,top = (pageHeight − y2) × scale). Lays invisible<div>hotspots over each field. Overlay positions recalculate reactively on zoom changes.◀ pageNum / total ▶) and zoom controls (−/+, 50 %–300 % range in 25 % steps).<datalist>autocomplete from existing schema canonical names), data type (string|int| date |enum), description, word limit (string only), allowed values (enum only, comma-separated), required checkbox.PUT /schemas/{id}/fields/{fieldId}and propagates the updated field to the parent overlay and workspace without remounting.src/pages/templates-panel.tsx (new)
src/components/— App ShellDashboardShell— Main layout wrapper (sidebar + content area).AppSidebar— Navigation sidebar usingnav-main,nav-documents,nav-secondary,nav-user.SiteHeader— Top bar displaying the dynamicheaderTitle.components/ui/— shadcn/ui primitives: Button, Tabs, Popover, Badge, etc.src/App.tsx / src/main.tsx
next-themesThemeProvider.AppNavigationContext.Config files
tsconfig*.json, eslint.config.js, components.json, index.html — standard Vite + shadcn project scaffolding.Running Locally
Set
VITE_API_URLto point at your backend if it's not onhttp://127.0.0.1:8000.Related Issues
Closes: #111