Skip to content

Kavipatel0/KnightHacks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 

Repository files navigation

⚖️ PowerLegal - Intelligent Legal Case Management System

License Next.js TypeScript React

Justice Powered by Intelligence

A sophisticated AI-powered legal case management platform featuring multi-agent orchestration, intelligent document processing, and seamless client communication.

FeaturesQuick StartEnvironment SetupDocumentation


📋 Table of Contents


🏛️ Overview

PowerLegal Pro is a cutting edge legal case management system that combines the power of artificial intelligence with proven legal workflows. Built with Next.js and powered by OpenAI's advanced language models, this platform streamlines every aspect of legal practice management—from client communication to legal research, document processing to task automation.

🎯 Perfect For

  • Law Firms seeking to automate routine tasks
  • Solo Practitioners needing intelligent assistance
  • Legal Departments requiring scalable case management
  • Personal Injury Attorneys managing complex documentation

✨ Key Features

  • 🤖 Multi-Agent AI System - Four specialized AI agents (Records Wrangler, Communication Guru, Legal Researcher, Scheduler) working in concert to automate legal workflows
  • 📧 Intelligent Email Management - Gmail integration with automatic scanning, smart drafting, and case matching
  • 📁 Document Intelligence - AI-powered document processing, PDF generation, and audio transcription
  • 📊 Smart Case Management - Visual task boards, case timelines, and automated task detection

💡 See MULTI_AGENT_SYSTEM.md for detailed information about the AI agent architecture


🛠️ Tech Stack

Frontend: Next.js 16 • React 19 • TypeScript • Tailwind CSS • shadcn/ui

Backend: Supabase (PostgreSQL) • Next.js API Routes • OpenAI API • Google APIs

AI: GPT-4 Language Models • Custom Multi-Agent Orchestration • Whisper Transcription


🚀 Quick Start

Prerequisites

  • Node.js 18.17 or later
  • npm or yarn or pnpm
  • Supabase account
  • OpenAI API key
  • Google Cloud project (for Gmail integration)

Installation

  1. Clone the repository
git clone https://github.com/Kavipatel0/KnightHacks.git
cd KnigtHacks/my-app
  1. Install dependencies
npm install
# or
yarn install
# or
pnpm install
  1. Set up environment variables

Create a .env.local file in the my-app directory (see Environment Setup below)

  1. Run the development server
npm run dev
# or
yarn dev
# or
pnpm dev
  1. Open your browser

Navigate to http://localhost:3000


🔐 Environment Setup

Create a .env file in the my-app directory with the following variables:

Example .env

GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_REDIRECT_URI=http://localhost:3000/api/auth/callback
GOOGLE_REFRESH_TOKEN=
NEXT_PUBLIC_OPENAI_API_KEY=
OPENAI_API_KEY=
NEXT_PUBLIC_BASE_URL=http://localhost:3000

# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=

📝 Configuration Notes

OpenAI API Key

  1. Sign up at OpenAI Platform
  2. Navigate to API Keys section
  3. Click Create new secret key
  4. Copy and paste into your .env.local

Supabase Setup

  1. Create a project at Supabase
  2. Go to Project SettingsAPI
  3. Copy the Project URL and anon/public key
  4. Paste into .env.local

Google Cloud Setup

  1. Go to Google Cloud Console
  2. Create a new project or select existing
  3. Enable Gmail API and Google+ API
  4. Go to CredentialsCreate CredentialsOAuth Client ID
  5. Set application type to Web application
  6. Add authorized redirect URI: http://localhost:3000/api/auth/callback
  7. Copy Client ID and Client Secret

Gmail Refresh Token

  • The refresh token is generated automatically after the first OAuth flow
  • Leave this blank initially; it will be populated after first authentication

💻 Development

Available Scripts

# Start development server
npm run dev

# Build for production
npm run build

# Start production server
npm start

🧪 Testing

Run Tests

# Test email sending
node test-email-sending.js

# Test communication agent
node test-communication-guru.js

# Test legal researcher
node test-legal-researcher.js

# Test multi-agent system
node test-multi-agent.js

🚢 Deployment

Deploy to Vercel

  1. Push your code to GitHub
  2. Import project in Vercel
  3. Add environment variables in Vercel dashboard
  4. Deploy!

Environment Variables in Production

Remember to update these in production:

  • NEXT_PUBLIC_BASE_URL - Your production domain
  • GOOGLE_REDIRECT_URI - Production OAuth callback URL

📜 License

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


📚 Documentation


Making justice accessible through technology ⚖️

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •