AI-powered legal case management platform built with Next.js, Supabase, and advanced AI technologies.
- AI-Powered Document Analysis: Advanced document analysis and legal research powered by cutting-edge AI
- Case Management: Organize and manage all your legal documents in one secure platform
- Secure & Compliant: Enterprise-grade security with full compliance for legal professionals
- Team Collaboration: Work seamlessly with your team on cases and document analysis
- Lightning Fast: Get instant insights and analysis with optimized AI processing
- User Authentication: Secure login/signup with Supabase authentication
- Modern UI: Clean, professional light theme interface
- Frontend: Next.js 14 with App Router
- Styling: Tailwind CSS v4 with custom design system
- Authentication: Supabase Auth with Row Level Security (RLS)
- Database: PostgreSQL via Supabase
- AI Services:
- Anthropic Claude for conversational AI
- Voyage AI for text embeddings
- DataStax Astra DB for vector storage
- UI Components: Custom component library with Radix UI primitives
- Deployment: Vercel-ready configuration
- Node.js 18+
- npm or yarn
- Supabase account
- Anthropic API key
- Voyage AI API key
- DataStax Astra DB account
git clone <repository-url>
cd LawGenix-AInpm install
# or
yarn installCreate a .env.local file in the root directory:
# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
# Database URLs (for Prisma)
DATABASE_URL=your_supabase_database_url
DIRECT_URL=your_supabase_direct_url
# AI Services
ANTHROPIC_API_KEY=your_anthropic_api_key
VOYAGE_API_KEY=your_voyage_api_key
# Astra DB Configuration
ASTRA_DB_APPLICATION_TOKEN=your_astra_db_token
ASTRA_DB_ID=your_astra_db_id
ASTRA_DB_REGION=your_astra_db_region
ASTRA_DB_KEYSPACE=your_keyspace
# Application
NEXT_PUBLIC_BASE_URL=http://localhost:3000Run the Supabase setup script in your Supabase SQL editor:
-- Enable Row Level Security
ALTER TABLE profiles ENABLE ROW LEVEL SECURITY;
ALTER TABLE "Case" ENABLE ROW LEVEL SECURITY;
ALTER TABLE "Document" ENABLE ROW LEVEL SECURITY;
ALTER TABLE "Conversation" ENABLE ROW LEVEL SECURITY;
ALTER TABLE "Message" ENABLE ROW LEVEL SECURITY;
ALTER TABLE "LinkedImage" ENABLE ROW LEVEL SECURITY;
-- Create trigger for automatic profile creation
CREATE OR REPLACE FUNCTION public.handle_new_user()
RETURNS TRIGGER AS $$
BEGIN
INSERT INTO public.profiles (id, email, display_name)
VALUES (NEW.id, NEW.email, COALESCE(NEW.raw_user_meta_data->>'full_name', NEW.email));
RETURN NEW;
END;
$$ LANGUAGE plpgsql SECURITY DEFINER;
CREATE TRIGGER on_auth_user_created
AFTER INSERT ON auth.users
FOR EACH ROW EXECUTE FUNCTION public.handle_new_user();
-- Add RLS policies (see supabase-setup.sql for complete setup)npm run dev
# or
yarn devOpen http://localhost:3000 to view the application.
LawGenix-AI/
βββ app/ # Next.js App Router
β βββ (auth)/ # Authentication routes
β β βββ auth/
β β βββ login/ # Login page
β β βββ signup/ # Signup page
β β βββ callback/ # OAuth callback
β β βββ actions.ts # Auth server actions
β βββ (dashboard)/ # Protected dashboard routes
β β βββ dashboard/ # Main dashboard
β βββ api/ # API routes
β β βββ conversations/ # Chat API
β β βββ health/ # Health check
β β βββ agent/ # AI agent endpoints
β βββ globals.css # Global styles
β βββ layout.tsx # Root layout
β βββ page.tsx # Landing page
βββ components/ # React components
β βββ ui/ # UI component library
β βββ app-sidebar.tsx # Main sidebar
β βββ login-form.tsx # Login form
β βββ signup-form.tsx # Signup form
β βββ nav-user.tsx # User navigation
βββ utils/ # Utility functions
β βββ supabase/ # Supabase client setup
β βββ ragFunctions/ # AI/RAG functions
βββ prisma/ # Database schema
β βββ schema.prisma # Prisma schema
βββ middleware.ts # Next.js middleware
βββ tailwind.config.ts # Tailwind configuration
βββ package.json # Dependencies
- Create a new Supabase project
- Enable Row Level Security (RLS)
- Run the SQL setup script from
supabase-setup.sql - Configure authentication settings:
- Disable email confirmation requirement
- Set up OAuth providers (GitHub, Google)
- Get your database URLs:
- Go to Settings > Database
- Copy the connection strings for
DATABASE_URLandDIRECT_URL
- Sign up at Anthropic Console
- Generate API key
- Add to environment variables
- Sign up at Voyage AI
- Generate API key for embeddings
- Add to environment variables
- Create account at DataStax Astra
- Create a new database
- Generate application token
- Configure keyspace and region
- Light Theme: Clean, professional white background with dark text
- Responsive Design: Works on desktop, tablet, and mobile
- Modern Components: Custom UI component library
- Accessibility: WCAG compliant design
- Loading States: Smooth loading animations
- Error Handling: User-friendly error messages
- Signup: Users create accounts with email/password or OAuth
- Profile Creation: Automatic profile creation in
profilestable - Login: Secure authentication with Supabase
- Session Management: Automatic session handling with middleware
- Logout: Complete session clearing and redirect
- Connect your GitHub repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy automatically on push to main branch
Ensure all environment variables are set in your deployment platform:
NEXT_PUBLIC_SUPABASE_URL=your_production_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_production_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_production_service_role_key
DATABASE_URL=your_production_database_url
DIRECT_URL=your_production_direct_url
ANTHROPIC_API_KEY=your_production_anthropic_key
VOYAGE_API_KEY=your_production_voyage_key
ASTRA_DB_APPLICATION_TOKEN=your_production_astra_token
ASTRA_DB_ID=your_production_astra_db_id
ASTRA_DB_REGION=your_production_region
ASTRA_DB_KEYSPACE=your_production_keyspace
NEXT_PUBLIC_BASE_URL=https://your-domain.com# Run tests
npm run test
# Run linting
npm run lint
# Type checking
npm run type-check- β Branding Update: Changed from "Legal Assist AI" to "Lawgenix AI"
- β Light Theme: Complete transition from dark to light theme
- β Navigation Cleanup: Removed "Data Library", "Document Assistant", "Reports"
- β Authentication Fixes: Improved login/signup flow and session management
- β User Profile: Fetch and display correct user data from profiles table
- β Logout Functionality: Proper session clearing and redirect
- β CSS Fixes: Resolved Tailwind CSS v4 configuration issues
- β Vercel Deployment: Fixed build conflicts and added proper configuration
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add 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.
For support, email support@lawgenix.ai or create an issue in this repository.
Lawgenix AI - Empowering legal professionals with intelligent AI solutions.