SamvidhanAI is a comprehensive AI-powered LegalTech platform designed to provide Indian citizens with instant legal guidance. Built under the Digital India initiative, it offers a sovereign AI solution trained exclusively on Indian legal corpus.
- AI Legal Consultation: Get instant answers to legal queries
- Text-based consultation with chat interface
- Voice assistance (supports Hindi & English)
- Visual document analysis (upload images/PDFs)
- Bilingual Support: Full support for English and Hindi
- Chat History: Access past consultations
- Premium Features: Detailed case citations, lawyer connections
- Secure: OTP-based authentication, data stays in India
- Verified Profile: Display credentials and expertise
- Client Management: Connect with premium users
- Messaging: Real-time chat with clients
- Dashboard: Track consultations and ratings
- User Management: View and manage all users
- Lawyer Approvals: Verify and approve lawyer registrations
- Analytics Dashboard: View platform statistics
- Deletion Requests: Handle account deletion requests
| Component | Technology |
|---|---|
| Frontend | HTML5, CSS3, JavaScript (Vanilla) |
| Backend | Node.js, Express.js |
| Database | MongoDB with Mongoose ODM |
| Authentication | JWT (JSON Web Tokens) |
| Password Hashing | bcryptjs |
| AI Integration | Ready for Gemini API / Local Model |
samvidhanai/
โโโ config/
โ โโโ database.js # MongoDB connection & schemas
โโโ middleware/
โ โโโ auth.js # JWT authentication middleware
โโโ public/
โ โโโ css/
โ โ โโโ style.css # Landing page styles
โ โ โโโ dashboard.css # User dashboard styles
โ โ โโโ admin.css # Admin dashboard styles
โ โ โโโ lawyer.css # Lawyer dashboard styles
โ โโโ js/
โ โ โโโ main.js # Landing page logic
โ โ โโโ dashboard.js # User dashboard logic
โ โ โโโ admin-dashboard.js # Admin dashboard logic
โ โ โโโ lawyer-dashboard.js # Lawyer dashboard logic
โ โโโ index.html # Landing page
โ โโโ dashboard.html # User dashboard
โ โโโ admin-dashboard.html # Admin dashboard
โ โโโ lawyer-dashboard.html # Lawyer dashboard
โโโ routes/
โ โโโ api.js # API routes
โโโ server.js # Main server file
โโโ package.json
โโโ README.md
- Node.js 18+ installed
- MongoDB 5.0+ installed and running locally
cd samvidhanainpm installEnsure MongoDB is running on your local machine:
# Windows (if MongoDB is installed as a service)
net start MongoDB
# Linux/macOS
sudo systemctl start mongodnpm startFor development with auto-restart:
npm run devOpen your browser and navigate to:
http://localhost:3000
- Username:
samvidhan - Password:
samvidhanai
For testing purposes, use OTP: 123456 for both email and phone verification.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/user/signup |
Register new user |
| POST | /api/user/login |
User login |
| POST | /api/user/verify-otp |
Verify OTP |
| POST | /api/lawyer/signup |
Register new lawyer |
| POST | /api/lawyer/login |
Lawyer login |
| POST | /api/admin/login |
Admin login |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/user/profile |
Get user profile |
| POST | /api/user/consult |
AI consultation |
| GET | /api/user/history |
Get chat history |
| POST | /api/user/upgrade |
Upgrade to premium |
| POST | /api/user/change-password |
Change password |
| POST | /api/user/request-deletion |
Request account deletion |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/admin/stats |
Get platform statistics |
| GET | /api/admin/users |
Get all users |
| GET | /api/admin/lawyers |
Get all lawyers |
| POST | /api/admin/approve-lawyer/:id |
Approve lawyer |
| POST | /api/admin/reject-lawyer/:id |
Reject lawyer |
| GET | /api/admin/deletion-requests |
Get deletion requests |
| POST | /api/admin/approve-deletion/:id |
Approve deletion |
The platform includes a mock AI service that simulates legal responses. For production deployment:
- Get your API key from Google AI Studio
- Add to environment variables:
export GEMINI_API_KEY=your_api_key_here- Uncomment the Gemini integration code in
server.js
- Set up the local model server
- Configure the endpoint in
server.js:
const LOCAL_AI_URL = 'http://localhost:8000/generate';{
fullName: String,
email: String (unique),
phone: String (unique),
password: String (hashed),
isVerified: Boolean,
isPremium: Boolean,
consentGiven: Boolean,
deletionRequested: Boolean,
chatHistory: Array,
createdAt: Date
}{
fullName: String,
email: String (unique),
phone: String (unique),
barCouncilNumber: String,
password: String (hashed),
isVerified: Boolean,
isApproved: Boolean,
createdAt: Date
}The platform is fully responsive and optimized for:
- Desktop (1200px+)
- Tablet (768px - 1199px)
- Mobile (< 768px)
Key responsive features:
- Collapsible sidebar on mobile
- Touch-friendly interface
- Optimized chat experience
- Adaptive navigation
- JWT-based authentication
- bcryptjs password hashing
- OTP verification for signup
- Data sovereignty (local MongoDB)
- CORS protection
- Input validation
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support, email support@samvidhanai.gov.in or call the helpline: 1800-XXX-XXXX
- Ministry of Law and Justice, Government of India
- Digital India Initiative
- Bharat Gen AI Legal Param Project
Made with for India ๐ฎ๐ณ