Forma AI: AI-Augmented Dynamic Form Engine
Forma AI tackles the challenge of managing massive, branching forms in large organizations like Insurance and Healthcare. Building these dynamically in React and managing the complex validation state in MongoDB is notoriously difficult, and adding AI to interpret unstructured user input makes it exponentially harder.
This project modernizes legacy data entry by creating a seamless, AI-augmented user experience.
Instead of filling out dozens of strict dropdowns, users can file complex insurance claims using natural language, such as typing a paragraph about an incident. The system's backend LLM parses this unstructured text and automatically pre-fills the structured React form fields.
Based on a complex JSON schema stored in MongoDB, the React UI dynamically reveals only the remaining, necessary questions, drastically reducing form friction.
This application utilizes a highly scalable architecture for managing unstructured data and complex business rules:
-
Frontend(React & React Hook Form): A Dynamic Form Renderer capable of generating complex, nested UIs dynamically entirely from a backend JSON schema. -
State Management (Redux / Zustand): Manages the complex, deeply nested state of the form as the user interacts with it. -
Backend & AI Pipeline (Node.js & LangChain): An LLM Extraction API uses an LLM (like GPT-4o or a local model) to parse unstructured user text and map it to the strict JSON schema required by the form. -
Database (MongoDB): A Schema Store stores the rules, validation logic, and branching paths for hundreds of different form types.
-
Advanced React Patterns: Heavy use of custom hooks, complex state management, and Dynamic UI generation.
-
Beyond CRUD: Utilizes AI pipelines for unstructured data parsing.
-
Scalable Node.js: Structures Express APIs using enterprise patterns rather than monolithic, tightly coupled routes.
-
Complex Data Modeling: Designs MongoDB schemas that handle deeply nested JSON trees, proving NoSQL mastery.
Setup
Wherever you cloned the repo — it should contain server.js, models/, routes/, and client/ directly.
- npm install
- Create a
.envfile (see.env.example) with real values — MongoDB connection string,JWT_SECRET,GOOGLE_API_KEY, Gmail SMTP credentials for OTP emails, etc. - If you're pointing at a local MongoDB instead of Atlas, make sure it's running (Compass, the Windows service, or
mongod— whichever you set up).
- npm run seed:demo
- Should print
Seeded form: claim-demo.
- npm run dev
- Watch for
MongoDB connectedandForma AI server listening on port 5000.
- cd client
- npm install
- npm run dev
- It'll print a local URL — normally http://localhost:5173.
- http://localhost:5173/login → sign up or log in (set
ALLOW_DEV_LOGIN=truein.envfor a one-click dev account, skipping OTP verification) - http://localhost:5173/ → the hub
- http://localhost:5173/forms → all forms, with submissions
- http://localhost:5173/forms/new → build a new form schema
- http://localhost:5173/forms/claim-demo → the seeded demo form, with the Magic Input box and weather/flood branching
- PORT=5000
- FRONTEND_ORIGIN=http://localhost:5173
- MONGODB_URI=mongodb://127.0.0.1:27017/forma-ai
- GOOGLE_API_KEY=your-gemini-api-key