Skip to content

Finarva is a NestJS-based backend platform designed to empower Financial agents in delivering personalized financial services to microentrepreneurs. The system supports user authentication, client management, tailored investment plans (e.g., small cap, large cap,), insurance services, quiz-based profiling, and learning content delivery.

Notifications You must be signed in to change notification settings

techySPHINX/Finarva

Repository files navigation

🧠 Finarva AI Backend – Empowering Microentrepreneurs with Intelligence

NestJS MongoDB Prisma OpenAI Gemini Swagger

✨ A powerful NestJS backend for the Gromo Platform, enabling AI-driven quiz generation, investment advice, insurance suggestions, and personalized learning for India's microentrepreneurs.


🌟 Features

  • 👤 Client Management – Manage detailed client profiles and preferences
  • 🧠 AI-Generated Quiz Suggestions – Personalized quiz generation using Gemini/OpenAI
  • 📚 Smart Learning Recommendations – Recommend relevant content based on behavior
  • 📈 Investment Engine – Assist with small-cap, gold, equity investments & more
  • 🛡️ Insurance Advisory – Intelligent suggestions based on client background
  • 🌍 Multi-language Support – Serve localized content to clients in their native languages
  • 🧩 Modular & Scalable – Built using a clean, service-repository pattern
  • 🧪 Swagger API Docs – Auto-generated, interactive API documentation

🏗️ Tech Stack

Layer Technology
Backend NestJS
Database MongoDB + Prisma
AI Models OpenAI GPT-4 / Gemini Pro
Documentation Swagger + class-validator
Deployment Ready for Docker / CI-CD Pipelines

📂 Folder Structure

📦 src
├── ai                # AI Integration layer (Gemini/OpenAI)
├── client            # Client module (profile, preferences)
├── quiz              # Quiz suggestion, history & records
├── investment        # Investments & recommendations
├── insurance         # Insurance suggestion logic
├── learning          # Content learning logic
├── common            # DTOs, interceptors, validators
└── prisma            # Prisma schema & database setup

🚀 Getting Started

✅ Prerequisites

  • Node.js v18+
  • MongoDB (Local or Atlas)
  • Prisma CLI
  • OpenAI / Gemini API Key

📦 Installation

git clone https://github.com/techySPHINX/Finarva
cd Finarva
npm install

⚙️ Setup .env File

Create a .env file in the root with the following content:

DATABASE_URL=mongodb://localhost:27017/gromo
OPENAI_API_KEY=sk-xxx
GEMINI_API_KEY=your-gemini-key

🔁 Prisma Setup

npx prisma generate

▶️ Run Dev Server

npm run start:dev

📖 API Documentation

Access the interactive Swagger documentation at:

http://localhost:3000/api

Explore all endpoints, test requests, and view schemas.


🤖 AI Integration Highlights

  • Uses client profile, quiz history, and language to generate:
    • 📊 Quiz Suggestions
    • 📚 Content Recommendations
    • 🛡️ Investment & Insurance Advice

Easily switch between OpenAI and Gemini via AiService.


📤 Sample Payloads

🎯 Quiz Suggestion Request

POST /ai/quiz-suggestions

{
  "profile": {
    "name": "Ravi",
    "age": 32,
    "occupation": "Street Vendor",
    "interests": ["insurance", "savings"],
    "investmentExperience": "beginner"
  },
  "quizHistory": [],
  "language": "hi"
}

📚 Learning Content Suggestion

POST /ai/learning-suggestions

{
  "profile": {
    "age": 28,
    "occupation": "Tailor",
    "investmentExperience": "beginner"
  },
  "interests": ["mutual funds", "budgeting"]
}

🧪 Testing & Linting

npm run lint        # Run linter
npm run test        # Run unit tests

💡 Developer Tips

  • Use @nestjs/swagger decorators to auto-generate docs
  • DTOs are validated with class-validator
  • Prisma handles MongoDB integration with schema enforcement
  • Modular folders make future extension a breeze

📜 License

This project is licensed under the MIT License.


🤝 Contributing

We welcome contributions!

# Clone and create a new branch
git checkout -b feature/your-feature-name

# Make changes, then commit
git commit -m "feat: added investment insight AI"

# Push and open a PR 🚀
git push origin feature/your-feature-name

👨‍💻 Maintainer

Made with ❤️ by Jagan Kumar Hotta


🚀 Powering the next generation of microentrepreneurs through intelligence.

About

Finarva is a NestJS-based backend platform designed to empower Financial agents in delivering personalized financial services to microentrepreneurs. The system supports user authentication, client management, tailored investment plans (e.g., small cap, large cap,), insurance services, quiz-based profiling, and learning content delivery.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages