Skip to content

samarthpatel24/Retirewise

Repository files navigation

RetireWise

AI-powered pension management platform with real-time chatbot assistance, Monte Carlo simulations, and interactive scenario analysis for retirement planning.

✨ Features

  • 🤖 AI Chatbot - Real-time retirement planning guidance with LLM integration (Mistral/LLaVA)
  • 📊 What-If Simulations - Monte Carlo analysis and stress testing for portfolio scenarios
  • 📈 Interactive Dashboards - Role-based analytics for Members, Advisors, and Regulators
  • 🔐 Secure Authentication - NextAuth.js with JWT and role-based access control
  • 💹 Financial Modeling - Advanced algorithms for retirement projections and optimization
  • 📱 Responsive UI - Modern interface built with Next.js 15 and Tailwind CSS

🛠️ Tech Stack

Frontend: Next.js 15, React, NextAuth.js, Tailwind CSS, Plotly.js
Backend: Node.js, Express, PostgreSQL
AI/ML: LLM Integration (Mistral/LLaVA), Monte Carlo Simulations
Security: JWT, Role-Based Access Control, Helmet, CORS

� Project Structure

RetireWise/
├── frontend/                   # Next.js Frontend Application
│   ├── src/
│   │   ├── app/               # App Router (Next.js 15)
│   │   │   ├── (auth)/        # Authentication pages
│   │   │   ├── api/           # API routes & proxy
│   │   │   └── dashboard/     # Protected dashboards
│   │   ├── components/        # React components
│   │   │   ├── auth/          # Auth components
│   │   │   ├── charts/        # Chart components
│   │   │   └── roles/         # Role-specific dashboards
│   │   ├── hooks/             # Custom React hooks
│   │   ├── lib/               # API services & utilities
│   │   └── styles/            # Styles
│   └── public/                # Static assets
│
├── backend/                    # Express.js Backend Server
│   ├── src/
│   │   ├── routes/            # API routes
│   │   ├── controllers/       # Business logic
│   │   ├── services/          # Core services
│   │   │   ├── ChatbotService.js
│   │   │   ├── WhatIfSimulatorService.js
│   │   │   └── GraphInsightsService.js
│   │   ├── middleware/        # Auth & validation
│   │   ├── config/            # Configuration
│   │   └── models/            # Data models
│   ├── database/              # Migrations & seeders
│   ├── logs/                  # Audit logs
│   └── tests/                 # Test suites
│
├── documentation/             # Project documentation
└── scripts/                   # Utility scripts

�🚀 Quick Start

# Clone repository
git clone https://github.com/sahilgoyal7214/MUFG.git
cd MUFG

# Install dependencies
pnpm install
cd frontend && pnpm install && cd ..
cd backend && pnpm install && cd ..

# Start backend (port 4000)
cd backend && pnpm start &

# Start frontend (port 3000)
cd frontend && pnpm dev

Access: http://localhost:3000
API Docs: http://localhost:4000/api-docs
Test Login: advisor1 / password123

📋 Scripts

# Frontend
cd frontend
pnpm dev                  # Development server
pnpm build                # Production build

# Backend
cd backend
pnpm start                # Production server
node generate-test-token.js [role]  # Generate JWT tokens

⚙️ Environment Setup

Frontend (.env.local)

NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-secret-key
BACKEND_URL=http://localhost:4000

Backend (.env)

PORT=4000
JWT_SECRET=your-secret-key
DATABASE_URL=postgresql://username:password@host:5432/database
LOCAL_LLM_URL=http://localhost:11434/api/generate

📡 API Documentation

Swagger UI: http://localhost:4000/api-docs

Key Endpoints:

  • /api/auth/* - Authentication and JWT verification
  • /api/members/* - Pension data management
  • /api/chatbot/message - AI-powered guidance
  • /api/graph-insights/analyze - Visual chart analysis
  • /api/analytics/dashboard - Role-based analytics

🔐 User Roles

  • MEMBER - Personal pension data and chatbot access
  • ADVISOR - Client portfolio management and analytics
  • REGULATOR - System-wide access and compliance monitoring

📚 Documentation

  • backend/README.md - Backend setup guide
  • documentation/PROJECT-SETUP-COMPLETE.md - Complete setup instructions
  • documentation/backend/SWAGGER-API-DOCUMENTATION.md - API reference

🤝 Contributing

Contributions welcome! Please fork the repository and submit a pull request.

📝 License

MIT License

About

AI-powered pension management platform with real-time chatbot assistance, Monte Carlo simulations, and interactive scenario analysis for retirement planning. Built with Next.js, Node.js, PostgreSQL, and LLM integration.

Topics

Resources

Stars

Watchers

Forks

Contributors