Skip to content

KrishnaNAcharya/mentorstack

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

146 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ MentorStack

MentorStack is a comprehensive mentorship and knowledge-sharing platform designed to connect aspiring developers with experienced mentors. Built with modern technologies, it facilitates learning through Q&A, articles, communities, real-time chat, and AI-powered assistance.

Next.js React TypeScript Node.js PostgreSQL Prisma RabbitMQ


✨ Features

🀝 Mentorship System

  • Mentor-Mentee Matching: Connect mentees with experienced mentors based on skills and interests
  • Request Management: Send, accept, or reject mentorship requests
  • Real-time Chat: WebSocket-powered private messaging between mentors and mentees
  • Connection Tracking: Manage active mentorship relationships

❓ Q&A Platform

  • Ask & Answer: Post questions and provide detailed answers
  • Voting System: Upvote/downvote questions and answers
  • Answer Validation: AI-powered answer quality assessment
  • Bookmarking: Save important questions for later reference
  • Tags: Organize questions with relevant tags

πŸ“ Articles & Knowledge Sharing

  • Article Publishing: Write and share technical articles with rich formatting
  • Image Support: Upload images via Cloudinary integration
  • Categories & Tags: Organize content by topics
  • Voting & Engagement: Upvote quality content
  • Bookmarking: Save articles to your collection

πŸ’¬ Communities

  • Create Communities: Build topic-specific communities
  • Discussion Posts: Share ideas and engage with community members
  • Member Management: Join communities and manage memberships
  • Tags & Organization: Categorize community posts
  • Real-time Discussions: WebSocket-powered community chat

πŸ€– AI Features

  • AI Chatbot: Get instant answers powered by Google Gemini AI
  • Answer Summarization: Automatically summarize multiple answers
  • Answer Validation: AI assessment of answer quality and relevance
  • Similar Questions: Find related questions using AI
  • Content Rephrasing: Improve your writing with AI assistance
  • Spell Checking: Real-time spelling corrections

πŸ† Gamification

  • Reputation System: Earn points for helpful contributions
  • Badges: Unlock achievements based on reputation milestones
  • Activity Tracking: Monitor your reputation history
  • Leaderboard: Compare your progress with others

🎨 User Experience

  • Fully Responsive: Mobile-first design that works on all devices
  • GSAP Animations: Smooth, intuitive animations throughout the app
  • Dark Mode Support: Custom CSS variables for theming
  • Profile Customization: Upload avatars, manage bio, skills, and more
  • Bookmarks Management: Organize saved questions, articles, and posts

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        Frontend (Next.js 15)                     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”‚
β”‚  β”‚  Pages   β”‚  β”‚Componentsβ”‚  β”‚  Utils   β”‚  β”‚  Hooks   β”‚       β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              ↓ ↑ HTTPS / WebSocket
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Backend (Express + TypeScript)               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”‚
β”‚  β”‚  Routes  β”‚  β”‚Middlewareβ”‚  β”‚WebSocket β”‚  β”‚  Prisma  β”‚       β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              ↓ ↑
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      Message Queue (RabbitMQ)                    β”‚
β”‚         AI Request Queue  β†’  Chatbot Agent Worker               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              ↓ ↑
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   PostgreSQL    β”‚  β”‚   Cloudinary    β”‚  β”‚  Google Gemini  β”‚
β”‚   (Neon.tech)   β”‚  β”‚  (Image CDN)    β”‚  β”‚   (AI Model)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Tech Stack

Frontend

  • Framework: Next.js 15.5.6 (App Router)
  • UI Library: React 19.0.0
  • Language: TypeScript 5.x
  • Styling: Tailwind CSS 4.x
  • Animations: GSAP (GreenSock Animation Platform)
  • State Management: React Hooks & Context
  • HTTP Client: Fetch API with custom auth wrapper
  • Image Handling: Next.js Image component

Backend

  • Runtime: Node.js 20.x
  • Framework: Express.js 5.1.0
  • Language: TypeScript 5.8.3
  • Database ORM: Prisma 6.15.0
  • Authentication: JWT (JSON Web Tokens)
  • Real-time: WebSocket (ws library)
  • Message Queue: RabbitMQ via amqplib
  • File Upload: Multer with Cloudinary storage
  • AI Integration: Google Generative AI (Gemini)

Database

  • Primary Database: PostgreSQL (hosted on Neon.tech)
  • ORM: Prisma with 26+ relational models
  • Migrations: Prisma Migrate

Infrastructure

  • Frontend Hosting: Vercel (Auto-deployment from GitHub)
  • Backend Hosting: Render.com (Docker container)
  • Chatbot Agent: Render.com (Background worker)
  • Database: Neon.tech (Serverless PostgreSQL)
  • Message Broker: CloudAMQP (RabbitMQ managed service)
  • CDN: Cloudinary (Image storage and optimization)

πŸš€ Getting Started

Prerequisites

  • Node.js: v20.x or higher
  • npm: v10.x or higher
  • PostgreSQL: Database instance (local or cloud)
  • RabbitMQ: Message broker instance
  • Git: Version control

Installation

  1. Clone the repository

    git clone https://github.com/Major-Project-26/mentorstack.git
    cd mentorstack
  2. Install dependencies

    Frontend:

    cd frontend
    npm install

    Backend:

    cd backend
    npm install

    Chatbot Agent:

    cd chatbot-agent
    npm install
  3. Environment Configuration

    Frontend (.env.local):

    NEXT_PUBLIC_API_URL=http://localhost:5000

    Backend (.env):

    # Database
    DATABASE_URL=postgresql://user:password@localhost:5432/mentorstack
    
    # JWT
    JWT_SECRET=your-super-secret-jwt-key-here
    
    # Cloudinary
    CLOUDINARY_CLOUD_NAME=your-cloud-name
    CLOUDINARY_API_KEY=your-api-key
    CLOUDINARY_API_SECRET=your-api-secret
    
    # Google Gemini AI
    GEMINI_API_KEY=your-gemini-api-key
    
    # RabbitMQ
    RABBITMQ_URL=amqp://localhost:5672

    Chatbot Agent (.env):

    BACKEND_API_URL=http://localhost:5000
    RABBITMQ_URL=amqp://localhost:5672
    GEMINI_API_KEY=your-gemini-api-key
  4. Database Setup

    cd backend
    
    # Generate Prisma client
    npx prisma generate
    
    # Run migrations
    npx prisma migrate dev
    
    # Seed database (optional)
    npx prisma db seed
  5. Run the Application

    Terminal 1 - Backend:

    cd backend
    npm run dev

    Terminal 2 - Frontend:

    cd frontend
    npm run dev

    Terminal 3 - Chatbot Agent:

    cd chatbot-agent
    node agent.js
  6. Access the Application


πŸ“ Project Structure

mentorstack/
β”œβ”€β”€ frontend/                 # Next.js frontend application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/             # App router pages
β”‚   β”‚   β”œβ”€β”€ components/      # Reusable React components
β”‚   β”‚   β”œβ”€β”€ lib/             # Utilities and API client
β”‚   β”‚   └── utils/           # Helper functions
β”‚   β”œβ”€β”€ public/              # Static assets
β”‚   └── package.json
β”‚
β”œβ”€β”€ backend/                 # Express.js backend API
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ routes/         # API route handlers
β”‚   β”‚   β”œβ”€β”€ middleware/     # Auth and validation middleware
β”‚   β”‚   β”œβ”€β”€ lib/            # Database and external services
β”‚   β”‚   └── realtime/       # WebSocket and RabbitMQ logic
β”‚   β”œβ”€β”€ prisma/
β”‚   β”‚   β”œβ”€β”€ schema.prisma   # Database schema
β”‚   β”‚   β”œβ”€β”€ migrations/     # Database migrations
β”‚   β”‚   └── seed.ts         # Database seeding script
β”‚   └── package.json
β”‚
β”œβ”€β”€ chatbot-agent/           # AI chatbot worker
β”‚   β”œβ”€β”€ agent.js            # Main worker process
β”‚   └── package.json
β”‚
β”œβ”€β”€ docker-compose.yml       # Local development services
└── README.md               # This file

πŸ”‘ Key Features Implementation

Authentication Flow

  1. User registers with email, password, and role (mentor/mentee)
  2. JWT token generated on successful login
  3. Token stored in localStorage and sent with each API request
  4. Middleware validates token and attaches user info to request

Real-time Communication

  • WebSocket Server: Handles connections for chat and AI responses
  • RabbitMQ: Asynchronous message processing for AI requests
  • Pub/Sub Pattern: Efficient message distribution

Database Models

  • 26+ Prisma models including:
    • User management (Users, Roles)
    • Mentorship (Requests, Connections, Conversations, Messages)
    • Content (Questions, Answers, Articles, Communities, Posts)
    • Engagement (Votes, Bookmarks, Tags)
    • Gamification (Badges, Reputation History)
    • AI Logs

API Endpoints

  • /api/auth - Authentication (login, register)
  • /api/users - User management
  • /api/questions - Q&A operations
  • /api/articles - Article CRUD
  • /api/communities - Community management
  • /api/chat - Messaging and AI chat
  • /api/badges - Badge system
  • /api/upload - File uploads
  • /api/bookmarks - Bookmark management

πŸš€ Deployment

Production URLs


🀝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License.


πŸ‘₯ Team

Major-Project-26 Team

  • Full-stack development
  • UI/UX design
  • Database architecture
  • AI integration

Built with ❀️ by the MentorStack Team

About

MentorStack is a mentorship platform connecting developers with experienced mentors. Features include real-time chat, Q&A forums, article publishing, community discussions, & AI-powered assistance via Google Gemini. Built with Next.js 15, Express, PostgreSQL, Prisma, RabbitMQ, & WebSocket for seamless real-time collaboration & knowledge sharing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 97.9%
  • JavaScript 1.5%
  • Other 0.6%