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.
- 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
- 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
- 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
- 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 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
- 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
- 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
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 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) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
- 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
- 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)
- Primary Database: PostgreSQL (hosted on Neon.tech)
- ORM: Prisma with 26+ relational models
- Migrations: Prisma Migrate
- 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)
- Node.js: v20.x or higher
- npm: v10.x or higher
- PostgreSQL: Database instance (local or cloud)
- RabbitMQ: Message broker instance
- Git: Version control
-
Clone the repository
git clone https://github.com/Major-Project-26/mentorstack.git cd mentorstack -
Install dependencies
Frontend:
cd frontend npm installBackend:
cd backend npm installChatbot Agent:
cd chatbot-agent npm install -
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
-
Database Setup
cd backend # Generate Prisma client npx prisma generate # Run migrations npx prisma migrate dev # Seed database (optional) npx prisma db seed
-
Run the Application
Terminal 1 - Backend:
cd backend npm run devTerminal 2 - Frontend:
cd frontend npm run devTerminal 3 - Chatbot Agent:
cd chatbot-agent node agent.js -
Access the Application
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- Backend Health: http://localhost:5000/health
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
- User registers with email, password, and role (mentor/mentee)
- JWT token generated on successful login
- Token stored in localStorage and sent with each API request
- Middleware validates token and attaches user info to request
- WebSocket Server: Handles connections for chat and AI responses
- RabbitMQ: Asynchronous message processing for AI requests
- Pub/Sub Pattern: Efficient message distribution
- 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/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
- Frontend: https://mentorstack.vercel.app
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.
Major-Project-26 Team
- Full-stack development
- UI/UX design
- Database architecture
- AI integration
Built with β€οΈ by the MentorStack Team