LegalConnect is a Java EE web application that connects clients and lawyers with case management, chat, notifications, admin moderation, and AI-assisted legal support.
- Multi-role authentication (
client,lawyer,admin) - Client workflows: register, upload cases, track progress, review lawyers, submit complaints
- Lawyer workflows: discover pending cases, accept/manage active cases, update status/timeline
- Shared chat per case with optional file attachments
- Notification center with read/unread tracking
- Admin panel for lawyer verification, complaints handling, and audit logs
- AI support endpoint with provider mode + built-in fallback responses
- Java 8
- Java EE Web (Servlet/JSP)
- Apache Ant / NetBeans web project
- MySQL (JDBC:
mysql-connector-j-9.1.0) - Frontend: JSP/HTML/CSS/Vanilla JS
LegalConnent/
src/java/ # Servlets + utility classes
web/ # JSP/HTML views and static assets
WEB-INF/web.xml # Servlet declarations + mappings
nbproject/ # NetBeans project metadata
build.xml # Ant build entrypoint
- JDK 8+
- MySQL 8+
- GlassFish/Payara server compatible with Java EE web apps
- NetBeans (recommended) or Ant CLI
Configure database credentials via environment variables (or JVM system properties):
# Linux/macOS
export LEGALCONNECT_DB_URL="jdbc:mysql://localhost:3306/legalconnect_db?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC"
export LEGALCONNECT_DB_USER="your_db_user"
export LEGALCONNECT_DB_PASSWORD="your_db_password"# Windows PowerShell (current session)
$env:LEGALCONNECT_DB_URL="jdbc:mysql://localhost:3306/legalconnect_db?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC"
$env:LEGALCONNECT_DB_USER="your_db_user"
$env:LEGALCONNECT_DB_PASSWORD="your_db_password"DBConnectionUtil now requires these keys:
LEGALCONNECT_DB_URLLEGALCONNECT_DB_USERLEGALCONNECT_DB_PASSWORD
Create the database:
CREATE DATABASE legalconnect_db;Note: Feature tables (
case_timeline,notifications,case_messages,lawyer_reviews,complaints,admin_logs) are auto-created at runtime byFeatureSchemaUtil.
Configure Gemini via environment variables (or JVM system properties):
# Linux/macOS
export GEMINI_API_KEY="your_gemini_api_key"
export GEMINI_MODEL="gemini-2.0-flash"
export GEMINI_ENDPOINT="https://generativelanguage.googleapis.com/v1beta/models"# Windows PowerShell (current session)
$env:GEMINI_API_KEY="your_gemini_api_key"
$env:GEMINI_MODEL="gemini-2.0-flash"
$env:GEMINI_ENDPOINT="https://generativelanguage.googleapis.com/v1beta/models"If GEMINI_API_KEY is empty, the app automatically uses a grounded fallback mode.
AI analysis now includes:
- Grounded case summarization (case fields + extractable document text)
- Applicable rule hints from built-in legal knowledge notes
- Case strength and proof-required checklist
- Confidence + insufficient-evidence gate with strict response behavior
- Lawyer recommendation scoring (city, specialization, ratings, experience, similarity)
- Open this folder as a NetBeans project.
- Configure your application server (GlassFish/Payara).
- Build and run.
- Open:
http://localhost:8080/LegalConnect/
ant clean
antDeploy the generated WAR (typically dist/LegalConnect.war) to your Java EE server.
- Auth:
LoginServlet,LogoutServlet,ClientRegisterServlet,LawyerRegisterServlet - Client:
UploadCaseServlet,GetCasesServlet,GetClientCaseTrackerServlet,SubmitReviewServlet,SubmitComplaintServlet - Lawyer:
GetNewCasesServlet,AcceptCaseServlet,GetActiveCasesServlet,UpdateCaseStatusServlet,GetLawyerStatsServlet - Messaging:
GetCaseChatListServlet,GetCaseMessagesServlet,SendCaseMessageServlet - Admin:
GetAdminStatsServlet,GetAdminLawyersServlet,AdminLawyerActionServlet,GetAdminComplaintsServlet,UpdateComplaintStatusServlet,GetAdminLogsServlet - Shared:
GetNotificationsServlet,MarkNotificationsReadServlet,GetCaseTimelineServlet,AiSupportServlet
Full servlet mappings are defined in web/WEB-INF/web.xml.
Forgot Passwordlink inweb/login.htmlis currently a placeholder.- Terms/Privacy/Code of Conduct links in registration pages are placeholders.
Remember meis present in UI but not persisted in backend login logic.
- Do not commit DB passwords or API keys.
- Use environment variables or secret managers for all credentials.
- Add password reset, email verification, and stronger auth controls before production rollout.
No license file is currently included in this repository.