LawBridge is a full‑stack legal services platform that connects users with verified legal professionals and provides AI‑powered legal assistance. The system supports secure authentication, lawyer consultations, appointment booking, video calls, payments, document analysis, and a production‑grade RAG‑based legal chatbot.
LawBridge Database Schema: https://dbdocs.io/officialdslc1552005/LawBridgeSchema?view=relationships
- Secure authentication with access‑token + refresh‑token architecture
- Email verification and optional Two‑Factor Authentication (TOTP)
- Browse lawyers by specialization and availability
- Appointment booking and management
- Razorpay payment integration
- Real‑time video consultations using Stream.io
- AI legal assistant using RAG over Indian Constitutional Law
- Responsive UI
- Professional profile management
- Availability and schedule control
- Appointment dashboard
- Earnings and completed consultation tracking
- Join meetings with Users
- Centralized admin dashboard
- User and lawyer management
- Appointment moderation
- Revenue and platform analytics
- React 19.1.1
- Vite
- Tailwind CSS 4.x
- React Router DOM 7.x
- Axios
- React Context API
- Stream.io Video SDK
- Moment.js
- Node.js
- Express.js 5.x
- MongoDB with Mongoose
- JWT (Access + Refresh tokens)
- Bcrypt
- Zod validation
- Multer + Cloudinary
- Razorpay SDK
- Stream.io Node SDK
- FastAPI (Python)
- LangChain
- Pinecone Vector Database
- Google Embedding Model 004
- Google Gemini 2.5 Flash
- Custom RAG pipeline with session memory
- Frontend communicates with Backend using REST APIs
- Backend issues short‑lived access tokens and long‑lived refresh tokens
- Refresh tokens are stored in HttpOnly cookies
- Chatbot runs as an isolated FastAPI service
- Backend and chatbot communicate using a shared RAG_SECRET_KEY
- All sensitive credentials are environment‑based
Law_Bridge_FullStack/
├── Frontend/
├── Backend/
├── Admin/
├── chatbot/
├── doc_analyser/
├── LICENSE
└── README.md
- Node.js v18+
- pnpm v10+
- Python 3.10+
- MongoDB Atlas or local MongoDB
- Git
Clone the repository:
git clone https://github.com/Divyansh1552005/Law_Bridge_Application.git
cd Law_Bridge_FullStack
Install dependencies:
Frontend:
cd Frontend
pnpm install
Backend:
cd Backend
pnpm install
Admin:
cd Admin
pnpm install
Chatbot:
cd chatbot
python3 -m venv rag
source rag/bin/activate
pip install -r req.txt
See the .env.example in the Frontend, Backend, Chatbot and Admin folders.
- Stateless JWT‑based authentication
- Short‑lived access tokens sent via Authorization header
- Refresh tokens stored in HttpOnly cookies
- Centralized refresh and logout endpoints
- Email verification before full access
- Optional TOTP‑based Two‑Factor Authentication
- Password hashing with bcrypt
- Zod‑based request validation
- Role‑based access control (User, Lawyer, Admin)
- Unified API response format
- Centralized error handling
- Async handler abstraction
- Separate routers for auth, user, lawyer, admin
- Token refresh handled automatically by frontend Axios interceptor
- Shared logout and refresh routes across roles
- Secure cookie configuration (httpOnly, sameSite, secure)
Backend:
cd Backend
pnpm start
Frontend:
cd Frontend
pnpm run dev
Admin:
cd Admin
pnpm run dev
Chatbot:
cd chatbot
source rag/bin/activate
python main.py
- Fork the repository
- Create a feature branch
- Commit changes
- Open a pull request
This project is licensed under the MIT License.
For support, contact: lawbridgeorg@gmail.com
LawBridge is an informational platform and does not provide legal advice. AI‑generated responses are for educational purposes only. Users must consult qualified legal professionals before making legal decisions.
Built by the LawBridge Team