Inspiration
The idea came from watching my dad deal with endless legal paperwork in his work. Drafting contracts, agreements, and invoices took up valuable time that could have been spent on more important tasks. I realized that if this process could be streamlined with AI, not only would it save him hours, but it could also help countless other professionals and freelancers who face the same challenge every day. My goal was to make legal paperwork feel less like a burden and more like a quick, guided process anyone can do.
What it does
The platform is an AI-powered legal document generator. Users pick the document type (e.g., Lease, NDA, Divorce Agreement, Invoice, Merger & Acquisition), answer a few guided questions in a step-based form, and the system instantly produces a polished draft. Users can then tweak it in an editor and export it as PDF, DOCX, or txt.
How I built it
I built Legal Document Generator with a Flask backend that uses Jinja2 templates and RESTful APIs to handle form inputs and AI requests. Document templates are stored in Python dictionaries, making the system flexible and easy to extend. The backend connects to Google Generative AI (Gemini 1.5 Flash) to generate professional legal drafts. On the frontend, I used HTML, CSS Grid/Flexbox, and vanilla JavaScript for a responsive, step-based form wizard, with Fetch API for server communication and the Blob API for file downloads.
Challenges I ran into
One major challenge was crafting AI prompts that consistently produced legally sound and well-structured documents across very different document types. I also ran into issues with frontend form validation and state management using only vanilla JavaScript, especially when handling multi-step forms. Another challenge was making file exports work smoothly in both TXT and DOCX formats while keeping the formatting consistent. Finally, managing API key security and rate limits for the Gemini API required careful handling during development.
Accomplishments that I'm proud of
Creating a scalable architecture where adding a new document type is as simple as defining a schema.
Building a clean and intuitive form wizard with progress bar that makes the UX smooth.
Successfully generating usable legal drafts for multiple document types in one platform.
Turning a complex legal workflow into something approachable for non-technical users.
What I learned
How to design apps with scalability in mind by separating schemas, prompts, and API logic.
How to think like a user when designing flows—keeping things simple but flexible.
The importance of clear prompt engineering when working with generative AI.
How to manage the balance between technical feasibility and user experience in a short development timeline.
What's next for Legal Document Generator
Expand document library: Add more specialized contracts (employment, intellectual property, partnership agreements, etc.).
Jurisdiction support: Customize documents based on country/state legal requirements.
Collaboration features: Allow multiple parties (e.g., landlord + tenant) to review and sign within the platform.
AI refinement: Improve prompt templates so drafts need less manual tweaking.
Integrations: Connect with tools like DocuSign, Notion, and Slack to make workflows seamless.
Monetization model: Explore subscription tiers or pay-per-document pricing for individuals and small businesses.

Log in or sign up for Devpost to join the conversation.