A full-stack MERN platform connecting clients, businesses, and legal seekers with verified lawyers — streamlining discovery, hiring, payments, and case management.
- Purpose & Vision
- Key Features
- Tech Stack
- Architecture & Directory Structure
- Website Mockup Showcase
- Admin Demo Access
- Environment Variables
- Local Installation Guide
- Future Roadmap
- License & Contributing
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.
| 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. |
| 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. |
| 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. |
| 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). |
| 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) |
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
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.
# 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_...- 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)
# 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# Client
cd legalease-client
npm install
# Server
cd legalease-server
npm installCopy the respective .env files:
# Client
cp .env.example .env.local # or create from template above
# Server
cp .env.example .env # or create from template abovePopulate all fields with your credentials (see Environment Variables section).
# Server (starts on http://localhost:5000)
npm run dev
# Client (separate terminal, starts on http://localhost:3000)
npm run devOpen 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.
This project is licensed under the MIT License — see the LICENSE file for details.
Contributions are welcome! Please adhere to the following guidelines:
- 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
By participating, you agree to maintain a respectful, inclusive, and harassment-free environment for everyone.
Found a bug or have a feature request? Open an issue with a clear description and reproduction steps.
Built by ❤️ Saharier Omi




