This prototype explores how Large Language Models (LLMs) can enhance legal workflows by enabling intelligent case analysis, real-time transcription, and contextual feedback. By integrating AI into the legal process, it supports more efficient decision-making, improves accessibility to complex information, and fosters a deeper understanding of legal content through personalized, adaptive assistance.
| Index | Description |
|---|---|
| High Level Architecture | High level overview illustrating component interactions |
| Deployment | How to deploy the project |
| User Guide | The working solution |
| Directories | General project directory structure |
| API Documentation | Documentation on the API the project uses |
| Credits | Meet the team behind the solution |
| License | License details |
| User Removal | How to completely remove a user from the platform |
The following architecture diagram illustrates the various AWS components utilized to deliver the solution. For an in-depth explanation of the frontend and backend stacks, please look at the Architecture Guide.
To deploy this solution, please follow the steps laid out in the Deployment Guide
Please refer to the Web App User Guide for instructions on navigating the web app interface.
├── cdk/
│ ├── bin/ # CDK app entry point
│ ├── lambda/ # Lambda function source code
│ │ ├── assess_progress/ # Progress assessment (Python)
│ │ ├── audioToText/ # Audio transcription (Python)
│ │ ├── authorization/ # Cognito triggers and authorizers (Node.js)
│ │ ├── case_generation/ # AI case title generation (Python)
│ │ ├── db_setup/ # Database initialization and migrations (Node.js)
│ │ ├── generatePreSignedURL/ # S3 presigned URL generation (Python)
│ │ ├── handlers/ # REST API handlers — admin, instructor, student (Node.js)
│ │ ├── notificationService/ # EventBridge notification delivery (Node.js)
│ │ ├── playground_generation/ # Prompt playground testing (Python)
│ │ ├── summary_generation/ # Legal summary generation (Python)
│ │ ├── text_generation/ # Interview assistant chat (Python)
│ │ └── websocket/ # WebSocket connect, disconnect, default route (Node.js)
│ ├── layers/ # Lambda layers (Node.js and Python dependencies)
│ ├── lib/ # CDK stack definitions
│ │ ├── api-stack.ts # API Gateway, Cognito, Lambda functions, Bedrock guardrails
│ │ ├── database-stack.ts # RDS PostgreSQL, RDS Proxy
│ │ ├── dbFlow-stack.ts # Database initialization trigger
│ │ ├── vpc-stack.ts # VPC and networking
│ │ ├── amplify-stack.ts # Frontend hosting
│ │ ├── cicd-stack.ts # CI/CD pipeline
│ │ └── waf-stack.ts # WAF configuration
│ ├── test/ # CDK tests
│ └── OpenAPI_Swagger_Definition.yaml
│
├── frontend/
│ ├── public/ # Static assets
│ └── src/
│ ├── components/ # Reusable UI components
│ │ ├── Admin/ # Admin-specific components (prompt editor, playground, model config)
│ │ ├── Case/ # Case components (notepad, feedback)
│ │ ├── Chat/ # Chat interface (chat bar, AI response, user message)
│ │ ├── Help/ # Help and onboarding components
│ │ ├── Notifications/ # Notification system components
│ │ └── Supervisor/ # Supervisor/instructor components
│ ├── contexts/ # React Context providers (user, theme)
│ ├── hooks/ # Custom React hooks (useWebSocket, etc.)
│ ├── lib/ # Shared library utilities
│ ├── pages/ # Page components
│ │ ├── Admin/ # Admin dashboard, AI configuration, settings
│ │ ├── Advocate/ # Student/advocate dashboard and case management
│ │ ├── Case/ # Case detail views (overview, assistant, summaries, transcriptions, feedback)
│ │ ├── Supervisor/ # Instructor dashboard and case oversight
│ │ └── Login.tsx # Authentication page
│ ├── services/ # API service layer
│ ├── types/ # TypeScript type definitions
│ └── utils/ # Utility functions
│
├── docs/
│ ├── llm_interaction/ # LLM interaction documentation
│ ├── media/ # Screenshots and diagrams
│ ├── api-documentation.md # REST API documentation
│ ├── architectureDeepDive.md # Architecture deep dive
│ ├── databaseMigrations.md # Database migration guide
│ ├── dependencyManagement.md # Python dependency management
│ ├── deploymentGuide.md # Deployment instructions
│ ├── modificationGuide.md # Customization guide
│ ├── securityGuide.md # Security documentation
│ └── userGuide.md # End-user guide
/cdk: AWS CDK infrastructure code (TypeScript)/bin: CDK app entry point and stack orchestration/lambda: Lambda function source code (Node.js 22.x and Python 3.11/3.12)/layers: Lambda layers for shared dependencies (postgres, psycopg3, aws-jwt-verify)/lib: CDK stack definitions for all infrastructure (VPC, database, API, auth, hosting, WAF)
/frontend: React 19 frontend application (TypeScript, Vite, MUI, Tailwind CSS)/src/components: Reusable UI components organized by feature area/src/contexts: React Context providers for global state/src/hooks: Custom hooks including WebSocket management/src/pages: Page-level components organized by user role/src/services: API service layer for backend communication/src/types: Shared TypeScript type definitions
/docs: Project documentation including deployment, architecture, security, and user guides
REST API documentation: API Documentation
LLM interaction details: LLM Interaction Overview
For information on how Python dependencies are locked and managed across Lambda functions, see the Dependency Management Guide.
For information on the database migration system, see the Database Migrations Guide.
For details on the security architecture including WAF, guardrails, authentication, and encryption, see the Security Guide.
Steps to implement optional modifications such as changing the colours of the application can be found here.
To disable or remove a user from the platform (database records, Cognito identity, and DynamoDB data), follow the User Disable / Removal Guide.
This application was architected and developed by Aniket Nemade with project assistance by Thien Lam Nguyen. Thanks to the UBC Cloud Innovation Centre Technical and Project Management teams for their guidance and support.
This project is distributed under the MIT License.
Licenses of libraries and tools used by the system are listed below:
- For PostgreSQL and pgvector
- "a liberal Open Source license, similar to the BSD or MIT licenses."
LLaMa 3 Community License Agreement
- For Llama 3 70B Instruct model
Anthropic Acceptable Use Policy
- For Claude 3 Sonnet, accessed via AWS Bedrock
- Usage governed by the AWS Bedrock Service Terms and Anthropic's Acceptable Use Policy
