A modern, intelligent legal document generation and management system built with Next.js, React, and TypeScript. This application helps users create and modify legal documents using AI-powered assistance.
- AI-Powered Document Generation: Generate legal documents based on user inputs
- Document Types: Support for Lawsuits and Pre-litigation Appeals
- Interactive Document Editing: Select and modify specific parts of generated documents
- File Upload Support: Upload evidence documents (PDF, text files)
- Real-time Validation: Form validation with helpful error messages
- Responsive Design: Works seamlessly on desktop and mobile devices
- Dark/Light Theme: Toggle between dark and light themes
- Modern UI: Built with Tailwind CSS and shadcn/ui components
- Framework: Next.js 14 with App Router
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: shadcn/ui
- Form Handling: React Hook Form with Zod validation
- HTTP Client: Axios
- Icons: Lucide React
- Theme: next-themes
Before running this project, make sure you have the following installed:
- Node.js (version 18 or higher)
- npm or yarn package manager
git clone <repository-url>
cd ai-legal-assistant
npm install
# or
yarn install
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
npm run build
# or
yarn build
npm start
# or
yarn start
ai-legal-assistant/
βββ src/
β βββ app/
β β βββ api/ # API routes
β β βββ globals.css # Global styles
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Home page
β β βββ not-found.tsx # 404 page
β βββ components/
β β βββ forms/ # Form components
β β βββ hero/ # Hero section
β β βββ navigation/ # Navigation component
β β βββ section-divider/
β β βββ section-heading/
β β βββ theme/ # Theme components
β β βββ ui/ # UI components
β βββ lib/ # Utility functions
β βββ providers/ # Context providers
βββ public/ # Static assets
βββ package.json
βββ tailwind.config.ts
βββ README.md
- Users can select document type (Lawsuit or Pre-litigation Appeal)
- Input legal topic and case details
- Upload supporting evidence documents
- AI generates comprehensive legal documents
- Interactive text selection for targeted modifications
- Real-time document updates
- Maintains document structure and formatting
- Support for PDF and text file uploads
- Secure file handling with base64 encoding
- File type validation
Create a .env.local
file in the root directory:
# Add your environment variables here
NEXT_PUBLIC_API_URL=your_api_url_here
The application expects the following API endpoints:
POST /api/generation
- Generate legal documentsPOST /api/correction
- Update existing documents
The project uses Tailwind CSS for styling. You can customize the design by modifying:
tailwind.config.ts
- Tailwind configurationsrc/app/globals.css
- Global styles- Component-specific CSS classes
The application supports dark and light themes. Theme configuration is handled in:
src/providers/theme-provider.tsx
src/components/theme/mode-toggle.tsx
The application is fully responsive and optimized for:
- Desktop (1024px and above)
- Tablet (768px - 1023px)
- Mobile (below 768px)
# Run linting
npm run lint
# Run type checking
npx tsc --noEmit
- Push your code to GitHub
- Connect your repository to Vercel
- Deploy automatically
The application can be deployed to any platform that supports Next.js:
- Netlify
- Railway
- DigitalOcean App Platform
- AWS Amplify
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Next.js
- UI components from shadcn/ui
- Icons from Lucide React
- Styling with Tailwind CSS
If you have any questions or need support, please open an issue in the GitHub repository.
Note: This application is for educational and demonstration purposes. For actual legal advice, please consult with qualified legal professionals.