This is a full-stack legal document analysis platform that allows users to search, analyze, and visualize relationships between legal documents, names, and entities. The application provides a dashboard for exploring court filings, flight logs, contact lists, and other legal documents while tracking connections between mentioned individuals.
Preferred communication style: Simple, everyday language.
- Framework: React with TypeScript
- Styling: Tailwind CSS with shadcn/ui components
- State Management: TanStack React Query for server state management
- Routing: Wouter for client-side routing
- Build Tool: Vite for development and production builds
- Runtime: Node.js with Express.js
- Language: TypeScript with ESM modules
- Database ORM: Drizzle ORM for type-safe database operations
- Database: PostgreSQL (configured for Neon Database)
- API Pattern: RESTful API with JSON responses
- Monorepo Layout: Client, server, and shared code in separate directories
- Client: React frontend located in
/client - Server: Express backend located in
/server - Shared: Common types and schemas in
/shared
The application uses PostgreSQL with the following main entities:
- Documents: Legal documents with metadata (court filings, flight logs, etc.)
- Names: Individuals mentioned in documents with mention counts
- Connections: Relationships between individuals based on document co-mentions
- Timeline Events: Chronological events related to documents and cases
- Document-Name Relations: Many-to-many relationship tracking
- Dashboard: Main application interface with statistics and navigation
- Document Import Center: Step-by-step guided document import process
- AI-Powered Insights: Advanced document analysis and pattern recognition using Gemini AI
- Document Management: Search, filter, and view legal documents
- Network Visualization: Interactive graph showing relationships between entities
- Timeline View: Chronological display of legal events
- Name Analysis: Analysis of individuals mentioned across documents
- Settings Page: User configuration for AI API keys and preferences
- Export Functionality: Data export in multiple formats (CSV, JSON, PDF)
- Dashboard Stats:
/api/dashboard/stats - Document CRUD:
/api/documents - Name Analysis:
/api/names - Network Data:
/api/network - Timeline Events:
/api/timeline - Export Functions:
/api/export/{format} - Document Import:
/api/documents/upload - Bulk Import:
/api/documents/import-from-url - AI Status:
/api/ai/status - AI Configuration:
/api/ai/configure - AI Test:
/api/ai/test - AI Document Analysis:
/api/ai/analyze-document - AI Pattern Recognition:
/api/ai/find-patterns - AI Network Insights:
/api/ai/generate-insights
- Document Ingestion: Documents are stored with metadata and content
- Name Extraction: Names are extracted from documents and tracked
- AI Analysis: Documents are analyzed using Gemini AI for entity extraction, sentiment analysis, and pattern recognition
- Relationship Building: Connections are established between co-mentioned individuals
- Timeline Creation: Events are chronologically organized
- Visualization: Data is presented through interactive components with AI-powered insights
- Export: Processed data can be exported in various formats
The platform integrates with Google's Gemini AI to provide advanced document analysis capabilities:
- Entity Recognition: Automatic extraction of people, organizations, and locations from legal documents
- Sentiment Analysis: Document sentiment scoring with confidence levels
- Pattern Recognition: Identification of recurring themes and connections across document collections
- Network Analysis: AI-powered insights about relationship networks and potential risk factors
- Document Summarization: Automatic generation of concise document summaries
- Smart Recommendations: Contextual suggestions for further investigation
- User-Controlled: Users provide their own free Gemini API key
- Privacy-Focused: API keys are stored securely and never logged
- Optional: All AI features are optional and the platform works without AI
- Free Tier: Utilizes Gemini's generous free tier for document analysis
- Document Analysis:
/api/ai/analyze-document- Extracts entities, topics, and sentiment - Pattern Finding:
/api/ai/find-patterns- Identifies patterns across document collections - Network Insights:
/api/ai/generate-insights- Provides insights about relationship networks - Real-time Processing: AI analysis integrated into document import workflow
- Batch Processing: Support for analyzing multiple documents simultaneously
- Neon Database: Serverless PostgreSQL database
- Connection Pooling: Using Neon's connection pooling for performance
- shadcn/ui: Comprehensive component library built on Radix UI
- Radix UI: Headless UI components for accessibility
- Tailwind CSS: Utility-first CSS framework
- D3.js: For network graph visualization and interactive charts
- TanStack React Query: For efficient data fetching and caching
- Vite: Fast development server and build tool
- TypeScript: Type safety across the entire application
- ESBuild: Fast JavaScript bundler for production builds
- Development Server: Vite dev server for frontend, tsx for backend
- Hot Reload: Both client and server support hot reloading
- Environment Variables: DATABASE_URL for database connection
- Build Process: Vite builds frontend, ESBuild bundles backend
- Static Assets: Frontend built to
/dist/public - Server Bundle: Backend bundled to
/dist/index.js - Database Migration: Drizzle migrations in
/migrations
- Development: NODE_ENV=development with local database
- Production: NODE_ENV=production with production database
- Database: PostgreSQL via DATABASE_URL environment variable
The application is designed to be deployed on platforms that support Node.js applications with PostgreSQL databases, with particular optimization for Replit's environment.