A production-ready full-stack document risk analysis platform built using modern cloud-native architecture, scalable backend services, secure authentication workflows, and real-world deployment practices.
LexiGuard allows users to upload legal or business documents, perform automated risk analysis, classify document risk levels, and manage document processing workflows through a modern responsive dashboard.
The project demonstrates practical software engineering concepts including REST API development, Prisma ORM workflows, PostgreSQL integration, JWT authentication, asynchronous processing architecture, cloud deployment, and production-grade application structuring.
🚀 Live Frontend:
⚙️ Live Backend API:
GET /healthExample:
https://lexiguard-doctrust-backend.onrender.com/health- Upload PDF, DOC, DOCX, and TXT files
- Drag-and-drop upload support
- Real-time upload progress tracking
- Document lifecycle management
- Persistent document metadata storage
-
Automated document analysis
-
Risk classification system:
- Low Risk
- Medium Risk
- High Risk
-
Structured JSON-based analysis results
-
Clause extraction architecture
-
Extensible AI-ready processing pipeline
- JWT-based authentication
- Secure password hashing using bcrypt
- Protected API routes
- Rate limiting
- Helmet security middleware
- Environment variable-based configuration
- CORS protection
- Secure HTTP headers
- RESTful API architecture
- Express middleware architecture
- Modular route structure
- Centralized error handling
- Structured logging using Winston
- Prisma ORM integration
- PostgreSQL relational database integration
| Service | Platform |
|---|---|
| Frontend | Vercel |
| Backend | Render |
| Database | PostgreSQL / Neon |
The project architecture is intentionally designed to support future Azure cloud-native integration including:
- Azure Blob Storage
- Azure Functions
- Azure PostgreSQL
- Azure Key Vault
- Event-driven background processing
- Serverless document workflows
This enables the platform to evolve into a fully scalable enterprise-grade cloud-native document processing system.
- React 18
- Vite
- TypeScript
- Tailwind CSS
- Axios
- React Router DOM
- React Hot Toast
- Node.js
- Express.js
- TypeScript
- Prisma ORM
- JWT Authentication
- Winston Logger
- Multer File Upload
- PostgreSQL
- Prisma ORM
- JSON-based analysis storage
- Vercel
- Render
- Neon PostgreSQL
- GitHub
- Prisma Migrations
- Environment Variables
- REST API Architecture
Frontend (React + Vite + TypeScript)
│
│ HTTPS REST API
▼
Backend API (Node.js + Express)
Hosted on Render
│
▼
PostgreSQL Database (Neon)
│
▼
Prisma ORM
User uploads document
↓
Frontend sends multipart/form-data request
↓
Backend validates request
↓
Document metadata stored in PostgreSQL
↓
Risk analysis processing executes
↓
Analysis result stored as JSON
↓
Frontend fetches updated document state
↓
Dashboard updates automatically
lexiguard/
│
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ ├── hooks/
│ │ ├── pages/
│ │ ├── services/
│ │ ├── types/
│ │ └── utils/
│ │
│ ├── public/
│ ├── package.json
│ └── vite.config.ts
│
├── backend/
│ ├── prisma/
│ │ ├── migrations/
│ │ └── schema.prisma
│ │
│ ├── src/
│ │ ├── middleware/
│ │ ├── routes/
│ │ ├── services/
│ │ ├── utils/
│ │ └── index.ts
│ │
│ ├── package.json
│ └── tsconfig.json
│
├── .gitignore
└── README.md
git clone https://github.com/YogeshwaranOfficial/Lexiguard-Doctrust.gitcd backendnpm installCreate a .env file inside backend:
DATABASE_URL=your_postgresql_connection_string
JWT_SECRET=your_secure_jwt_secret
FRONTEND_URL=http://localhost:5173
PORT=3001npx prisma generatenpx prisma migrate devnpm run devnpm run build
npm startcd frontendnpm installCreate a .env file inside frontend:
VITE_API_URL=http://localhost:3001npm run devVITE_API_URL=https://lexiguard-doctrust-backend.onrender.comnpm install && npx prisma generate && npx prisma migrate deploy && npm run buildnpm startnpx prisma generatePurpose:
- Generates Prisma client code from
schema.prisma - Used inside application runtime
npx prisma migrate dev --name initPurpose:
- Creates migration SQL files
- Updates database schema
- Tracks schema history
npx prisma migrate deployPurpose:
- Applies existing migrations safely in production
POST /api/auth/register
POST /api/auth/loginPOST /api/documents/upload
GET /api/documents
GET /api/documents/:id
DELETE /api/documents/:idGET /health- React architecture
- TypeScript integration
- API communication
- State handling
- File upload workflows
- Responsive UI development
- REST API design
- Middleware architecture
- Authentication systems
- Error handling
- Logging systems
- File handling
- Prisma ORM integration
- PostgreSQL schema design
- Prisma migrations
- JSON data storage
- Relational modeling
- Production deployment
- Render deployment workflows
- Vercel deployment workflows
- Environment variable management
- CI-ready project structure
- Cloud database integration
- JWT authentication
- Password hashing
- Secure headers
- Rate limiting
- CORS handling
- Secure environment configuration
- No hardcoded secrets
- Environment variable isolation
- JWT expiration handling
- Password hashing using bcrypt
- Secure API middleware
- CORS origin validation
- Rate limiting protection
Planned improvements:
- Azure Blob Storage integration
- Azure Functions background processing
- Azure Key Vault integration
- AI-powered NLP analysis
- OpenAI integration
- Real-time WebSocket updates
- RBAC authorization
- Docker containerization
- GitHub Actions CI/CD
- Redis caching
- Unit & integration testing
- Monitoring & observability
- Multi-tenant architecture
Contributions and improvements are welcome.
Fork → Clone → Create Branch → Commit → Push → Pull Request
This project is licensed under the MIT License.
Developed by Yogeshwaran S