Skip to content

java-jedis/legal-connect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

235 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Legal Connect Legal Connect

Java Spring Boot Vue.js FastAPI PostgreSQL Redis Elasticsearch Qdrant JWT Docker Swagger

Connecting Clients and Lawyers with Advanced AI Features

Legal Connect is a comprehensive legal platform that bridges the gap between clients and lawyers, featuring AI-powered document analysis, real-time communication, case management, and integrated payment processing.
Quick Start Β»

Features Β· Architecture Β· API Docs

πŸ”— Quick Links

Full Application Β· Backend API Documentation Β· AI Backend Documentation

SonarCloud Analysis

Quality Gate Status Maintainability Rating Reliability Rating Security Rating Bugs Code Smells Duplicated Lines Coverage

πŸ“‘ Table of Contents

Key Features

For Clients

  • Lawyer Discovery: Advanced search and filtering system to find qualified lawyers
  • Case Management: Create, track, and manage legal cases with document organization
  • AI Legal Assistant: RAG-powered document analysis and legal question answering
  • Real-time Communication: Instant messaging and video conferencing with lawyers
  • Secure Payments: Integrated Stripe payment processing with escrow functionality
  • Document Management: Upload, organize, and share legal documents securely

For Lawyers

  • Professional Profiles: Comprehensive profile management with verification system
  • Case Tracking: Manage client cases with document and note organization
  • AI Document Analysis: Leverage AI for document review and legal research
  • Client Communication: Real-time chat and video consultations
  • Blog Publishing: Share legal insights and build thought leadership
  • Availability Management: Set consultation slots and manage appointments

For Administrators

  • Lawyer Verification: Review and approve lawyer registrations and credentials
  • User Management: Monitor and manage user accounts and activities
  • System Analytics: Track platform usage and performance metrics
  • Content Moderation: Manage blogs and user-generated content

Architecture

Legal Connect follows a microservices architecture with three main components:

System Architecture

Service Overview

  1. Backend (Spring Boot): Core business logic, user management, case management
  2. Backend AI (FastAPI): RAG system for document analysis and AI chat
  3. Frontend (Vue.js): User interface and client-side application

Integration Points

  • Authentication: JWT-based authentication shared across services
  • Real-time Communication: WebSocket integration for chat and notifications
  • Document Processing: AI backend processes documents uploaded through main backend
  • Video Conferencing: Jitsi Meet integration for lawyer-client consultations

Technical Stack

Backend Services

Component Technology Version Purpose
Main Backend Spring Boot 3.5.3 Core business logic, REST APIs
AI Backend FastAPI 0.109.2 RAG system, document analysis
Frontend Vue.js 3.5.13 User interface, SPA

Databases & Storage

Component Technology Version Purpose
Primary DB PostgreSQL 17.5 User data, cases, documents
Vector DB Qdrant Latest Document embeddings, similarity search
Cache Redis 7 Session management, caching
Search Elasticsearch 9.1.1 Full-text search for blogs
File Storage AWS S3 + Cloudinary - Document and media storage

External Integrations

  • Payment Processing: Stripe
  • Video Conferencing: Jitsi Meet (JAAS)
  • Email Services: SMTP (Zoho)
  • AI Services: Google Gemini, Google Embeddings
  • Calendar Integration: Google Calendar API

Getting Started

Prerequisites

  • Docker & Docker Compose (Recommended)
  • Java 21+ (for local backend development)
  • Python 3.12+ (for local AI backend development)
  • Node.js 20+ (for local frontend development)
  • PostgreSQL 17+, Redis 7+, Elasticsearch 9.1+ (for local development)

Quick Setup

The fastest way to get Legal Connect running is using Docker Compose:

# Clone the repository
git clone https://github.com/java-jedis/legal-connect.git
cd legal-connect

# Create environment configuration file
cp .env.example .env

# Start all services with Docker Compose
docker-compose up -d

Important Configuration Steps:

Before starting the services, you must edit the .env file with your actual configuration values. Update the following required variables:

  • POSTGRES_PASSWORD - Database password
  • JWT_SECRET - Secret key for JWT token generation
  • AWS_ACCESS_KEY, AWS_SECRET_KEY, AWS_S3_BUCKET - AWS S3 storage credentials
  • GOOGLE_API_KEY - Google AI API key (for AI features)
  • QDRANT_URL, QDRANT_API_KEY - Qdrant vector database credentials
  • MAIL_USERNAME, MAIL_PASSWORD - Email service credentials
  • STRIPE_SECRET_KEY - Stripe payment processing key
  • JAAS_APP_ID, JAAS_API_KEY - Jitsi Meet video conferencing credentials

Setting up Jitsi JAAS Credentials:

  1. Go to https://jaas.8x8.vc/#/ and create an account

  2. Create a new application and get your App ID and API Key

  3. Download the private key file and place it in the backend resources directory:

    cp /path/to/your/downloaded/key.pk backend/legalconnect/src/main/resources/jaas-key.pk
  4. Update your .env file with the JAAS credentials:

    JAAS_APP_ID=vpaas-magic-cookie-your-app-id-here
    JAAS_API_KEY=vpaas-magic-cookie-your-app-id-here/your-kid-here

Access the applications:

Individual Service Setup

For detailed setup instructions for each service, refer to their respective README files:

πŸ“‹ Service Documentation

Service Description Setup Guide
Backend Spring Boot API server with PostgreSQL, Redis, Elasticsearch Backend Setup Guide
Backend AI FastAPI RAG system with Qdrant vector database AI Backend Setup Guide
Frontend Vue.js SPA with real-time features Frontend Setup Guide

πŸ”§ Configuration Files

Each service includes example configuration files:

  • Backend: backend/.env.example, backend/legalconnect/src/main/resources/application.example.yml
  • Backend AI: backend-ai/env.example
  • Frontend: frontend/.env.example

Database Design

The system uses multiple databases optimized for different use cases:

Backend Database Schema

Backend Database Schema

AI Backend Database Schema

AI Backend Database Schema

Database Architecture

  • PostgreSQL: Primary relational database for user data, cases, documents, and business logic
  • Qdrant: Vector database for storing document embeddings and similarity search
  • Redis: In-memory cache for sessions, temporary data, and performance optimization
  • Elasticsearch: Search engine for full-text search capabilities in blogs and documents

Key Entities

  • Users & Lawyers: User management with role-based access control
  • Cases & Documents: Case lifecycle management with document organization
  • Chat & Messages: Real-time messaging system
  • Blogs & Reviews: Content management and rating system
  • Payments & Meetings: Financial transactions and appointment scheduling

API Documentation

Interactive Documentation

Each service provides comprehensive API documentation:

Service Documentation Endpoint
Backend Swagger UI http://localhost:8080/v1/swagger-ui/index.html
AI Backend FastAPI Docs http://localhost:8000/docs
Frontend Component Docs See Frontend README

API Sections

Main Backend APIs

  • Authentication: User registration, login, email verification
  • User Management: Profile management, lawyer verification
  • Case Management: Case lifecycle, document handling
  • Chat System: Real-time messaging, conversation management
  • Blog System: Content creation, subscription management
  • Payment Processing: Stripe integration, transaction management

AI Backend APIs

  • Chat Endpoints: AI-powered legal assistance
  • Document Processing: Upload and analysis of legal documents
  • Search Endpoints: Semantic search across legal documents
  • Session Management: Chat history and context management

Testing and Quality

Code Quality Monitoring

Legal Connect uses SonarCloud for continuous code quality monitoring:

  • Quality Gate: Automated quality checks on every commit
  • Code Coverage: Comprehensive test coverage tracking
  • Security Analysis: Vulnerability detection and security hotspots
  • Maintainability: Code smells and technical debt monitoring

View detailed analysis: SonarCloud Dashboard

Testing Strategy

  • Backend: JUnit 5, Mockito, Integration tests
  • AI Backend: pytest, FastAPI TestClient
  • Frontend: Vue Test Utils, Jest (planned)
  • E2E Testing: Cypress (planned)

Project Structure

legal-connect/
β”œβ”€β”€ backend/                    # Spring Boot main backend
β”‚   β”œβ”€β”€ legalconnect/          # Spring Boot application
β”‚   β”œβ”€β”€ docker-compose.yml    # Backend services (PostgreSQL, Redis, Elasticsearch)
β”‚   β”œβ”€β”€ Dockerfile            # Backend container configuration
β”‚   └── README.md             # Backend setup guide
β”œβ”€β”€ backend-ai/               # FastAPI AI backend
β”‚   β”œβ”€β”€ app/                  # FastAPI application
β”‚   β”œβ”€β”€ docker-compose.yml   # AI services (PostgreSQL, Redis)
β”‚   β”œβ”€β”€ Dockerfile           # AI backend container configuration
β”‚   └── README.md            # AI backend setup guide
β”œβ”€β”€ frontend/                # Vue.js frontend
β”‚   β”œβ”€β”€ src/                 # Vue.js application source
β”‚   β”œβ”€β”€ Dockerfile          # Frontend container configuration
β”‚   └── README.md           # Frontend setup guide
β”œβ”€β”€ docs/                   # Documentation and assets
β”‚   β”œβ”€β”€ logo.png           # Project logo
β”‚   β”œβ”€β”€ architecture.png   # System architecture diagram
β”‚   └── database_schema.png # Database schema diagram
β”œβ”€β”€ docker-compose.yml     # Full system orchestration
└── README.md             # This file

Contributing

We welcome contributions to Legal Connect! Please follow these steps:

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

Development Guidelines

  • Follow the coding standards for each service (Java, Python, JavaScript)
  • Write comprehensive tests for new features
  • Update documentation for API changes
  • Ensure all quality gates pass in SonarCloud

Authors

Java Jedis Team

Majedul Islam - Full Stack Developer | System Architect

Shakil Ahmed - Full Stack Developer | AI Integration Specialist

Contact

About

Legal Connect - AI-Powered Legal Platform A comprehensive legal platform connecting clients and lawyers with advanced AI features including document analysis, real-time communication, case management, and integrated payment processing. Built with Spring Boot, Vue.js, and FastAPI.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors