Back
Legal chatbot + back officeCompleted
Academic project
LEXY — Legal Solutions
- Next.js
- TypeScript
- MongoDB
- NextAuth
- OpenAI
- Tailwind
Problem
Lawyers at a firm waste time answering the same basic questions over and over, while users don't know who to ask or how to start.
Context
Team capstone project (Duoc UC, 2024). A legal platform pairing an AI chatbot to handle general questions and route complex cases to a lawyer, with a back office where the team picks up the query and follows up.
Objective
Create a clear entry point for general legal questions and connect cases that need attention with the lawyer team.
My role
- Built the frontend of the public site: hero, services, lawyer team and contact form, with Next.js, Tailwind and shadcn/ui.
- Worked within a team on an end-to-end project (chatbot + back office), integrating my part with the rest of the app.
- Helped tune the AI: adjusting the system prompt and context so it answered only within the legal domain.
Architecture & decisions
- Next.js and TypeScript for the application, MongoDB for persistence, NextAuth for authentication and OpenAI for the chatbot.
- The public site, chatbot and back office were integrated into a codebase shared by the team.
Solution
- Public site that introduces the firm and its services, with the Lexy chatbot as the entry point.
- Chatbot powered by the OpenAI API for general questions; specific cases are routed to a lawyer.
- Back office to receive the routed query and contact the person directly.
- Authentication with NextAuth and data persisted in MongoDB.
Challenges & trade-offs
- Scoping chatbot context in a sensitive domain and routing what it should not resolve automatically.
- Integrating several contributors without confusing personal responsibility with the product's total scope.
Views
Screenshots from the live site




Learnings
- First time wiring a product to an AI: constraining answers with a system prompt and context in a sensitive domain.
- Real teamwork on a shared codebase, integrating my part with everyone else's.
Result
Platform deployed on Vercel and presented as a capstone project. The site is still live and working.