How mouryaveer/docgen-integrated-t2l works
Turn2Law is a legal-document platform: users choose a template or upload an input, provide document details and branding, generate and preview a PDF, then optionally validate a certificate and sign it. The README documents this workflow and the two-service proxy arrangement; sampled source confirms wizard persistence, frontend API calls, proxy security checks, and backend generation/branding behavior. Backend API wiring and several documented capabilities are represented at the documented level because their implementation was not sampled.
Main entry points: app.py Generation core · api.py FastAPI endpoints · DocEngineStandaloneApp.tsx Document wizard · docengine.ts Engine API client
Components 23
Frontend workflow
- Document wizard
T2L-site-main/app/components/DocEngineStandalone/DocEngineStandaloneApp.tsx - Dashboard workspace
T2L-site-main/app/components/DashboardDocEngine/DocEngineWorkspace.tsx - Document records
T2L-site-main/app/components/DocEngine/DocEngineExperience.tsx - Local document store
T2L-site-main/app/store/documentStore.ts - Engine API client
T2L-site-main/app/services/docengine.ts
API gateway
- Engine API route
T2L-site-main/app/api/docengine/[...path]/route.ts - File route
T2L-site-main/app/files/[...path]/route.ts - Secure engine proxy
T2L-site-main/lib/engine-proxy.ts
Document engine
- FastAPI endpoints
documentGeneration-master/docgen/api.py - Generation core
documentGeneration-master/docgen/app.py - Input classification
documentGeneration-master/docgen/classifier/classify.py - Document extractors
documentGeneration-master/docgen/extractors - PDF generation
documentGeneration-master/docgen/generators/generate.py - Branding engine
documentGeneration-master/docgen/branding/branding_engine.py - PDF signatures
documentGeneration-master/docgen/digital_signature/signer.py - Generated PDFs
documentGeneration-master/docgen
Other product tools
- Document introspector
T2L-site-main/app/components/Introspector/IntrospectorChat.tsx - Introspector API route
T2L-site-main/app/api/introspector/route.ts - Introspector service
- Legal resource hub
T2L-site-main/app/pages/Resources.tsx
Other components
- User
- Google Gemini
- XeLaTeX
Connections 24
- User → Document wizard: enters details
- User → Dashboard workspace: opens workspace
- Document wizard → Engine API client: requests engine
- Dashboard workspace → Engine API client: requests engine
- Engine API client → Engine API route: sends API calls
- Engine API route → Secure engine proxy: dispatches request
- File route → Secure engine proxy: dispatches file request
- Secure engine proxy → FastAPI endpoints: forwards request
- FastAPI endpoints → Generation core: invokes generation
- Generation core → Document extractors: extracts input text
- Generation core → Input classification: classifies input
- Input classification → Google Gemini: requests classification
- Generation core → Branding engine: resolves branding
- Generation core → PDF generation: renders document
- PDF generation → XeLaTeX: compiles LaTeX
- FastAPI endpoints → PDF signatures: signs requested PDF
- FastAPI endpoints → Generated PDFs: stores and serves PDFs
- Generated PDFs → File route: returns PDF files
- Document wizard → Document records: emits document events
- Document records → Local document store: updates records
- User → Document introspector: submits query
- Document introspector → Introspector API route: sends query
- Introspector API route → Introspector service: forwards query
- User → Legal resource hub: browses resources