GitHub - Saharier36/legalease-client: Empowering legal access with a full-stack MERN platform. LegalEase streamlines lawyer discovery, transparent hiring, and secure transactions using Next.js 16, Better Auth, and Stripe integration. · GitHub
Skip to content

About

Empowering legal access with a full-stack MERN platform. LegalEase streamlines lawyer discovery, transparent hiring, and secure transactions using Next.js 16, Better Auth, and Stripe integration.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

⚖️ LegalEase

Online Lawyer Hiring & Legal Service Marketplace

A full-stack MERN platform connecting clients, businesses, and legal seekers with verified lawyers — streamlining discovery, hiring, payments, and case management.

Live Client Live Server GitHub Client GitHub Server



📋 Table of Contents


🎯 Purpose & Vision

Traditional legal hiring is constrained by geography, opaque referral networks, and high barriers to entry for emerging legal professionals. LegalEase democratises access to legal expertise by building a transparent, digital marketplace where:

  • Clients & Businesses can discover, compare, and hire verified lawyers with confidence — backed by real reviews, transparent pricing, and secure Stripe-powered payments.
  • Lawyers gain a global digital storefront, eliminate dependency on physical firm affiliations, and access rich analytics on their caseload and earnings.
  • Platform Administrators maintain trust and compliance through role-based governance, transaction auditing, and content moderation tools.

LegalEase demonstrates advanced full-stack (MERN) capabilities including multi-role dashboards, JWT-authenticated sessions, Google OAuth integration, real-time payment parsing, and a complete review ecosystem.


🚀 Key Features

👤 Client (Service Seeker)

Feature Description
🔍 Browse & Filter Explore verified lawyers by specialization, rating, location, and hourly rate.
👁️ Detailed Profiles View credentials, experience, service listings, and client reviews.
💳 Instant Hire Secure one-click hiring via Stripe payment integration.
⭐ Review Ecosystem Drop ratings and written reviews on hired professionals.
📜 Hiring History Full timeline of past and active engagements with status tracking.

👨‍⚖️ Lawyer (Service Provider)

Feature Description
✅ Verification Gateway One-time payment verification to unlock listing capabilities.
📊 Lawyer Dashboard Dedicated admin panel for service CRUD, availability toggling (publish/unpublish), and analytics.
💼 Case Management Track active clients, pending hires, and case statuses.
💰 Financial Analytics Earnings breakdown, transaction history, and platform metrics.

🛡️ Admin (Platform Governance)

Feature Description
👥 User Management Role escalations (client → lawyer → admin), account suspension, and auditing.
📋 Listing Moderation Review, approve, or unpublish lawyer service listings.
💳 Transaction Oversight Full visibility into platform revenue, payment disputes, and Stripe payouts.
📈 Platform Analytics Aggregate KPIs — active users, total hires, conversion funnels, revenue trends.

🔐 Authentication & Security

Feature Description
🔑 Email/Password Auth Standard secure registration & login with hashed credentials.
🌐 Google OAuth One-click sign-in via Firebase-powered Google authentication.
🪙 JWT Sessions JSON Web Token based authorization with cookie caching for seamless UX.
🚪 Role-Based Access Middleware-enforced route protection per role (client / lawyer / admin).

🧰 Tech Stack

React 19 Next.js 16 Node.js Express MongoDB Tailwind CSS 4 Stripe Better Auth JWT Framer Motion Recharts Sonner next-themes MongoDB Adapter Vercel

Core Dependencies

Layer Technology
Frontend Next.js 16, React 19, Tailwind CSS 4, Framer Motion, HeroUI
Backend Node.js, Express.js, RESTful API
Database MongoDB (with Better Auth MongoDB adapter)
Auth Better Auth (JWT plugin, Google OAuth, Email/Password)
Payments Stripe SDK (stripe v22)
Charts Recharts, React Icons
Notifications Sonner (toast system)
Deployment Vercel (client + server)

🏗 Architecture & Directory Structure

legalease-client/
├── public/                        # Static assets
├── src/
│   ├── app/                       # Next.js App Router
│   │   ├── (auth)/                # Auth routes (login, register)
│   │   │   ├── login/
│   │   │   └── register/
│   │   ├── (dashboard)/           # Protected dashboard routes
│   │   │   ├── dashboard/
│   │   │   │   ├── admin/         # Admin panel
│   │   │   │   │   ├── all-transactions/
│   │   │   │   │   ├── analytics/
│   │   │   │   │   └── manage-users/
│   │   │   │   ├── lawyer/        # Lawyer panel
│   │   │   │   │   ├── hiring-history/
│   │   │   │   │   └── manage-legal-profile/
│   │   │   │   └── user/          # User panel
│   │   │   │       ├── comments/
│   │   │   │       ├── hiring-history/
│   │   │   │       └── update-profile/
│   │   ├── (main)/                # Public/main routes
│   │   │   ├── browse-lawyers/    # Lawyer discovery
│   │   │   │   └── [id]/          # Lawyer detail page
│   │   │   └── page.js            # Landing page
│   │   ├── payment/               # Stripe payment pages
│   │   ├── unauthorized/          # 403 fallback
│   │   ├── api/                   # API route handlers
│   │   ├── layout.js
│   │   └── globals.css
│   ├── components/
│   │   ├── dashboard/             # Dashboard-specific components
│   │   │   ├── AdminDashboard/
│   │   │   ├── LawyerDashboard/
│   │   │   └── UserDashboard/
│   │   ├── home/                  # Landing page sections
│   │   ├── layout/                # Navbar, Footer, Sidebar
│   │   └── ui/                    # Reusable UI components
│   ├── core/                      # API client & session utilities
│   │   ├── apiClient.js           # Fetch wrappers (CRUD)
│   │   ├── session-client.js      # Client-side session hook
│   │   └── session.js             # Server-side session helpers
│   ├── lib/                       # Library integrations
│   │   ├── auth-client.js         # Better Auth client config
│   │   ├── auth.js                # Better Auth server config
│   │   └── stripe.js              # Stripe server init
│   ├── services/                  # Server actions & API calls
│   │   ├── actions.js             # Server mutations (create, update, delete)
│   │   └── api.js                 # Server data fetchers
│   └── utils/                     # Utility functions
├── jsconfig.json
├── next.config.mjs
├── package.json
├── postcss.config.mjs
└── tailwind.config.js

🎨 Website Mockup Showcase

🏠 Landing Page

Landing Page
Hero banner
🔍 Browse Lawyers

Browse Lawyers
Filterable grid with lawyer cards
📋 Lawyer Dashboard

Lawyer Dashboard
Service management, analytics, case tracking
🛡️ Admin Panel

Admin Panel
User management, transactions, platform KPIs


🔑 Admin Demo Access

You can explore the LegalEase Admin Dashboard using the demo administrator credentials below.

Credential Details
📧 Admin Email admin@legalease.com
🔒 Admin Password admin@Passwoard345!

⚠️ Demo Access Only: These are Admin credentials, not regular user credentials. They are provided strictly for viewing and exploring the Admin Dashboard and its features. Please do not modify, delete, create, suspend, or otherwise alter any users, services, transactions, settings, or other platform data using this account.


🔐 Environment Variables

Client (legalease-client/.env.local)

# Application
NEXT_PUBLIC_BASE_URL=https://legalease-server-zeta.vercel.app

# Better Auth
BETTER_AUTH_URL=http://localhost:3000

# MongoDB
MONGODB_URI=mongodb+srv://<user>:<password>@cluster.mongodb.net/<dbname>
AUTH_DB_NAME=legalease_auth

# Google OAuth
GOOGLE_CLIENT_ID=<your-google-client-id>
GOOGLE_CLIENT_SECRET=<your-google-client-secret>

# Stripe
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_SECRET_KEY=sk_test_...

💻 Local Installation Guide

Prerequisites

  • Node.js ≥ 18.x
  • npm ≥ 9.x or pnpm ≥ 8.x
  • MongoDB Atlas account (or local instance)
  • Stripe account (test mode)
  • Google Cloud Console project (OAuth credentials)

Step 1 — Clone Repositories

# Client
git clone https://github.com/Saharier36/legalease-client.git
cd legalease-client

# Server (separate terminal)
git clone https://github.com/Saharier36/legalease-server.git
cd legalease-server

Step 2 — Install Dependencies

# Client
cd legalease-client
npm install

# Server
cd legalease-server
npm install

Step 3 — Configure Environment

Copy the respective .env files:

# Client
cp .env.example .env.local    # or create from template above

# Server
cp .env.example .env          # or create from template above

Populate all fields with your credentials (see Environment Variables section).

Step 4 — Start Development Servers

# Server (starts on http://localhost:5000)
npm run dev

# Client (separate terminal, starts on http://localhost:3000)
npm run dev

Step 5 — Verify

Open http://localhost:3000 in your browser. You should see the LegalEase landing page. Register a new account, assign a role, and explore the dashboards.

Note: The server must be running before the client can fetch lawyer listings, process payments, or authenticate users.


🛣 Future Roadmap

Feature Status Description
🎥 Video Consultation Spaces 🔮 Planned Real-time video calls via WebRTC for virtual client-lawyer meetings.
🤖 AI-Powered Contract Analysis 🔮 Planned Automated document review and risk scoring using LLM APIs.
💬 Real-Time Chat 🔮 Planned In-app messaging with typing indicators, file sharing, and read receipts.
🌍 Multi-Language Support 🔮 Planned i18n for global accessibility (English, Spanish, French, Arabic).
⭐ Lawyer Rating Algorithm 🔮 Planned Weighted scoring system combining review volume, recency, and case success rate.
📄 E-Signature Integration 🔰 Researching Embed HelloSign or DocuSign for legally binding digital contracts.
📱 Mobile App (React Native) 🔰 Researching Cross-platform native apps mirroring the web experience.
🧪 Automated Test Suite 🔰 Researching End-to-end tests with Playwright + API integration tests.

📄 License & Contributing

License

This project is licensed under the MIT License — see the LICENSE file for details.

Contributing

Contributions are welcome! Please adhere to the following guidelines:

  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

Code of Conduct

By participating, you agree to maintain a respectful, inclusive, and harassment-free environment for everyone.

Reporting Issues

Found a bug or have a feature request? Open an issue with a clear description and reproduction steps.


Built by ❤️ Saharier Omi

About

Empowering legal access with a full-stack MERN platform. LegalEase streamlines lawyer discovery, transparent hiring, and secure transactions using Next.js 16, Better Auth, and Stripe integration.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages