A full-stack AI-driven platform for legal case analysis.
Built with React, Tailwind CSS, Firebase Authentication, Node.js/Express, MongoDB, and Google Gemini AI.
- Authentication – Login, Signup, Forgot Password (Firebase Auth)
- User Dashboard – Sidebar navigation, Dark Mode support
- Profile Management – View & update user details with MongoDB persistence
- Case Analysis – AI-powered case analysis using Google Gemini
- Case Management – Create, edit, delete, and search cases with full CRUD operations
- Settings Page – Change password, delete account, notification preferences
- Landing Page – Responsive homepage with project branding
- React 19
- React Router DOM
- Tailwind CSS
- Firebase Authentication
- React Toastify
- Node.js / Express
- MongoDB with Mongoose
- Google Gemini AI (for case analysis)
- CORS enabled
- Node.js (v14 or higher)
- MongoDB (local or MongoDB Atlas)
- Firebase project with Authentication enabled
- Google Gemini API key
- Navigate to the backend directory:
cd legal-case-ai-backend- Install dependencies:
npm install- Create a
.envfile (copy from.env.example):
GEMINI_API_KEY=your_gemini_api_key_here
PORT=5000
MONGODB_URI=mongodb://localhost:27017/legal-case-ai- Start MongoDB (if running locally):
# On Windows (if MongoDB is installed as a service, it should start automatically)
# On Mac/Linux:
mongod- Start the backend server:
npm startThe backend will run on http://localhost:5000
- Navigate to the frontend directory:
cd legal-case-ai-frontend- Install dependencies:
npm install- Create a
.envfile:
REACT_APP_GOOGLE_API_KEY=your_firebase_api_key_here- Start the development server:
npm startThe frontend will run on http://localhost:3000
POST /api/analyze- Analyze a legal case using AI
GET /api/cases?userId=xxx- Get all cases for a userGET /api/cases/:id- Get a single casePOST /api/cases- Create a new casePUT /api/cases/:id- Update a caseDELETE /api/cases/:id- Delete a case
GET /api/profile?userId=xxx&email=xxx- Get user profilePUT /api/profile- Create or update user profile
.
├── legal-case-ai-backend/
│ ├── config/
│ │ └── database.js # MongoDB connection
│ ├── controllers/
│ │ ├── analyzeController.js # AI case analysis
│ │ ├── caseController.js # Case CRUD operations
│ │ └── profileController.js # Profile management
│ ├── models/
│ │ ├── Case.js # Case schema
│ │ └── UserProfile.js # User profile schema
│ ├── routes/
│ │ ├── analyze.js # Analysis routes
│ │ ├── cases.js # Case routes
│ │ └── profile.js # Profile routes
│ └── server.js # Express server
│
└── legal-case-ai-frontend/
├── src/
│ ├── components/
│ │ └── PrivateRoute.js # Protected route component
│ ├── pages/
│ │ ├── Cases.js # Case management page
│ │ ├── Dashboard.js # Main dashboard
│ │ ├── Home.js # Landing page
│ │ ├── Layout.js # App layout with sidebar
│ │ ├── Login.js # Authentication page
│ │ ├── Profile.js # User profile page
│ │ └── Settings.js # Settings page
│ └── firebaseConfig.js # Firebase configuration
└── package.json
✅ MongoDB integration for data persistence
✅ Full CRUD operations for cases
✅ User profile management with backend storage
✅ AI-powered case analysis with Google Gemini
✅ Save analyzed cases from dashboard
✅ Change password functionality
✅ Delete account functionality
✅ Case search and filtering
✅ Responsive design with dark mode support
- Make sure MongoDB is running before starting the backend
- Ensure Firebase Authentication is properly configured
- The app uses Firebase Auth for authentication and MongoDB for data storage
- All user data is stored securely in MongoDB