Skip to content

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.

Notifications You must be signed in to change notification settings

devpayoub/AI-Legal-Assistant

Repository files navigation

AI Legal Assistant

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.

πŸ–ΌοΈ Project Screenshot

AI Legal Assistant Screenshot

πŸš€ Features

  • 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

πŸ› οΈ Tech Stack

  • 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

πŸ“‹ Prerequisites

Before running this project, make sure you have the following installed:

  • Node.js (version 18 or higher)
  • npm or yarn package manager

πŸš€ Getting Started

1. Clone the Repository

git clone <repository-url>
cd ai-legal-assistant

2. Install Dependencies

npm install
# or
yarn install

3. Run the Development Server

npm run dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result.

4. Build for Production

npm run build
# or
yarn build

5. Start Production Server

npm start
# or
yarn start

πŸ“ Project Structure

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

🎯 Key Features Explained

Document Generation

  • 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

Document Editing

  • Interactive text selection for targeted modifications
  • Real-time document updates
  • Maintains document structure and formatting

File Management

  • Support for PDF and text file uploads
  • Secure file handling with base64 encoding
  • File type validation

πŸ”§ Configuration

Environment Variables

Create a .env.local file in the root directory:

# Add your environment variables here
NEXT_PUBLIC_API_URL=your_api_url_here

API Endpoints

The application expects the following API endpoints:

  • POST /api/generation - Generate legal documents
  • POST /api/correction - Update existing documents

🎨 Customization

Styling

The project uses Tailwind CSS for styling. You can customize the design by modifying:

  • tailwind.config.ts - Tailwind configuration
  • src/app/globals.css - Global styles
  • Component-specific CSS classes

Themes

The application supports dark and light themes. Theme configuration is handled in:

  • src/providers/theme-provider.tsx
  • src/components/theme/mode-toggle.tsx

πŸ“± Responsive Design

The application is fully responsive and optimized for:

  • Desktop (1024px and above)
  • Tablet (768px - 1023px)
  • Mobile (below 768px)

πŸ§ͺ Testing

# Run linting
npm run lint

# Run type checking
npx tsc --noEmit

πŸš€ Deployment

Vercel (Recommended)

  1. Push your code to GitHub
  2. Connect your repository to Vercel
  3. Deploy automatically

Other Platforms

The application can be deployed to any platform that supports Next.js:

  • Netlify
  • Railway
  • DigitalOcean App Platform
  • AWS Amplify

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“ž Support

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.

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published