Your intelligent legal services marketplace - Connecting clients with the right legal professionals through AI-powered matching
LegalEase is a modern, full-stack legal services platform that bridges the gap between clients seeking legal assistance and qualified legal service providers. Using advanced AI-powered vector search, the platform intelligently matches clients with the most relevant legal professionals based on their specific needs.
- AI-Powered Search - Semantic search using HuggingFace embeddings to find the perfect legal match
- Real-Time Chat - Built-in messaging system for seamless client-provider communication
- Provider Analytics - Comprehensive dashboard with request statistics and trends
- Secure Authentication - Powered by Supabase with role-based access control
- Responsive Design - Beautiful, modern UI that works on all devices
- Lightning Fast - Built with Next.js 15 for optimal performance
- Node.js 20.x or higher
- npm or yarn
- A Supabase account
- A HuggingFace API key
-
Clone the repository
git clone https://github.com/satvikvirmani/legalease.git cd legalease -
Install dependencies
npm install
-
Set up environment variables
Create a
.env.localfile in the root directory:NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key HUGGINGFACE_API_KEY=your_huggingface_api_key
-
Run the development server
npm run dev
-
Open your browser
Navigate to http://localhost:3000
- Sign Up - Create an account and select "Client" as your role
- Complete Your Profile - Fill in basic information and address details
- Search for Providers - Describe your legal issue in natural language
- Review Matches - Browse AI-matched legal professionals
- Submit Requests - Send service requests to providers you're interested in
- Communicate - Once approved, use the built-in chat to discuss your case
- Manage Requests - Track all your requests through different statuses
- Sign Up - Register as a "Provider"
- Build Your Profile - Add credentials, specializations, and experience
- Write a Description - Describe your services (this powers the AI matching!)
- Receive Requests - Get notified when clients match with you
- Accept or Decline - Review and respond to client requests
- Collaborate - Use real-time chat to work with clients
- Track Performance - Monitor your request statistics on the dashboard
- Framework: Next.js 15 (App Router)
- UI Library: HeroUI (NextUI fork)
- Styling: TailwindCSS
- Charts: Recharts
- Icons: Heroicons
- Database: Supabase (PostgreSQL)
- Authentication: Supabase Auth
- Real-Time: Supabase Realtime
- Storage: Supabase Storage
- Vector Search: PostgreSQL with pgvector
- Embeddings: HuggingFace Inference API
- Model: sentence-transformers/all-MiniLM-L6-v2
- Hosting: Vercel
- Analytics: Vercel Analytics
- Version Control: Git/GitHub
legalease/
├── app/
│ ├── api/
│ │ └── generateEmbedding/ # AI embedding generation
│ ├── auth/
│ │ └── signout/ # Authentication routes
│ ├── dashboard/
│ │ ├── account/ # Profile management
│ │ ├── client-home/ # Client dashboard & search
│ │ ├── provider-home/ # Provider analytics
│ │ ├── approvedrequests/ # Approved requests + chat
│ │ ├── pendingrequests/ # Pending requests
│ │ ├── rejectedrequests/ # Rejected requests
│ │ ├── closedrequests/ # Closed requests
│ │ └── profile/[slug]/ # Dynamic provider profiles
│ ├── login/ # Login page
│ ├── register/ # Registration page
│ └── utils/
│ └── supabase/ # Supabase client utilities
├── components/
│ └── ui/ # Reusable UI components
└── public/ # Static assets
LegalEase uses cutting-edge vector similarity search to match clients with providers:
- Provider descriptions are converted to 384-dimensional vectors using HuggingFace's sentence transformers
- Client queries are similarly vectorized
- PostgreSQL's pgvector extension finds the closest semantic matches
- Results are ranked by relevance, not just keyword matching
Built on Supabase Realtime, the chat system provides:
- Instant message delivery
- Connection state management
- Message history with date grouping
- Typing indicators (coming soon!)
Providers get insights into their business with:
- Request status distribution (pie chart)
- Week-over-week trend analysis
- Status counts for quick overview
- Historical data tracking
- Row Level Security (RLS) - Database-level access control
- Secure Authentication - JWT-based session management
- Environment Variables - Sensitive data never exposed to client
- Middleware Protection - Route guards for authenticated areas
- Input Validation - Server-side validation on all forms
- profiles - User profile information
- addresses - User location data
- providers - Provider-specific details and embeddings
- requests - Service request lifecycle
- messages - Real-time chat messages
Uses PostgreSQL's pgvector extension with cosine similarity for semantic search.
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available under the MIT License.
- Next.js - The React framework for production
- Supabase - Open source Firebase alternative
- HuggingFace - AI model hosting and inference
- HeroUI - Beautiful React UI components
- Vercel - Deployment and hosting platform
If you encounter any issues or have questions, please open an issue on GitHub.