Skip to main content
Live2024·Solo

LegalOne

A web application designed to streamline legal services by providing a platform for users, lawyers, and administrators.

legalone.vercel.app
LegalOne: full-stack legal services platform with real-time messaging
legalone.vercel.appSecure
AESMessage Encryption
JWT + RBACAuth
GraphQLAPI
Socket.IOReal-Time

What It Is

LegalOne is a full-stack legal services platform that connects clients, lawyers, and administrators on a single secure platform. It features JWT-based authentication with granular RBAC, a modular GraphQL API backed by Prisma and MongoDB, and secure one-to-one real-time messaging with AES-encrypted payloads over Socket.IO. The platform is designed for auditability, security, and clean role separation, making sensitive legal communications both efficient and traceable.

How It Works

1

Authentication & Role-Based Access

JWT tokens encode user roles (client, lawyer, admin) and are verified on every API request. Prisma middleware enforces role-scoped data access at the ORM layer, so a lawyer cannot query another lawyer's case file even with a valid token.

2

GraphQL API with Prisma

A modular Apollo Server schema separates public resolvers (case lookup, lawyer directory) from authenticated resolvers (case management, messaging, admin controls). Prisma type-safe queries against MongoDB ensure schema consistency and catch data access errors at compile time.

3

AES-Encrypted Real-Time Messaging

Socket.IO powers one-to-one messaging between clients and lawyers. Message payloads are AES-encrypted client-side before transmission and decrypted only by the intended recipient. Session-based authentication gates socket connection establishment.

What I Owned

Security Architecture

Designed and implemented the full auth stack: JWT issuance, refresh token rotation, RBAC enforcement via Prisma middleware, and AES encryption for the messaging layer. Conducted a threat model review before launch to identify and close privilege escalation paths.

API & Database Design

Authored the GraphQL schema, Apollo Server resolvers, and Prisma data models. Established the MongoDB document structure for cases, messages, and user profiles, and built the migration scripts for schema evolution.

Real-Time Messaging System

Built the Socket.IO server and client integration, including room management, connection authentication, message delivery confirmations, and the AES encryption/decryption utility layer shared between client and server.

Tech Stack

Next.js 15TypeScriptTailwindCSSPrismaMongoDBGraphQLApollo ServerSocket.io
View on GitHub

Browse the source code, commits, and technical implementation details for LegalOne.

Open Repository

More Projects