Repository: Mentorship-server
A comprehensive Node.js backend server powering an intelligent career guidance and mentorship platform. Built with Express.js, MongoDB, and enhanced with Google's Gemini AI to deliver personalized career recommendations and mentorship experiences.
The Career Guidance Engine serves as the core backend infrastructure for a modern mentorship platform, enabling students and professionals to discover career paths, connect with industry mentors, and access educational resources through AI-driven recommendations.
- AI-powered career recommendations using Google Gemini API
- Comprehensive job market insights and industry trends
- Personalized career path suggestions based on skills and interests
- Seamless mentor-student matching system
- Appointment booking and scheduling functionality
- Real-time session management and tracking
- Curated educational content and learning materials
- Workshop and event management system
- Downloadable resources with organized categorization
- Job application submission and status monitoring
- Unique tracking ID system for application management
- Automated status updates and notifications
- Comprehensive event management system
- Registration and attendance tracking
- Multi-format support (online/offline events)
- Google Gemini API integration for career counseling
- Natural language processing for personalized suggestions
- Intelligent matching algorithms for mentor-student pairing
| Category | Technology |
|---|---|
| Runtime | Node.js |
| Framework | Express.js |
| Database | MongoDB with Mongoose ODM |
| Authentication | JWT (JSON Web Tokens) |
| AI Integration | Google Gemini API |
| Email Service | Nodemailer |
| File Handling | Multer |
| Security | bcrypt, CORS, Helmet |
- Node.js (v16+ recommended)
- MongoDB (local or Atlas)
- Git
# Clone the repository
git clone https://github.com/ujjwaljha1/Mentorship-server.git
cd Mentorship-server
# Install dependencies
npm install
Create a .env file in the root directory:
# Server Configuration
PORT=3001
NODE_ENV=production
# Database
MONGODB_URI=mongodb+srv://your-connection-string
# Authentication
JWT_SECRET=your-secure-jwt-secret
# AI Integration
GEMINI_API_KEY=your-gemini-api-key
# Email Configuration
SMTP_HOST=your-smtp-host
SMTP_PORT=587
SMTP_USER=your-email
SMTP_PASS=your-password
# Development mode
npm run dev
# Production mode
npm start
Server will be accessible at http://localhost:3001
| Endpoint | Description | Authentication |
|---|---|---|
/api/auth/* |
User authentication and authorization | Public/Protected |
/api/careers/* |
Career data and AI recommendations | Protected |
/api/mentors/* |
Mentor management and booking | Protected |
/api/applications/* |
Job application tracking | Protected |
/api/workshops/* |
Event and workshop management | Protected |
/api/resources/* |
Educational resource access | Protected |
graph TD
A[User Registration] --> B[Email Verification]
B --> C[Login Request]
C --> D[JWT Token Generation]
D --> E[Protected Resource Access]
E --> F[Token Validation]
F --> G[Resource Delivery]
# User Registration
POST /api/auth/signup
Content-Type: application/json
{
"username": "johndoe",
"email": "john@example.com",
"password": "securePassword123",
"name": "John Doe"
}
# Get AI-Powered Career Suggestions
POST /api/careers/suggestions
Authorization: Bearer <token>
Content-Type: application/json
{
"interests": ["technology", "problem-solving"],
"skills": ["programming", "analysis"],
"experience": "beginner"
}
# Book Mentorship Session
POST /api/mentors/book-appointment
Authorization: Bearer <token>
Content-Type: application/json
{
"mentorId": "mentor_id_here",
"preferredDate": "2024-01-15",
"sessionType": "career_guidance"
}
- Password Encryption: bcrypt hashing algorithm
- JWT Authentication: Stateless token-based authentication
- Role-Based Access Control: User, Mentor, Admin hierarchies
- Input Validation: Comprehensive request sanitization
- CORS Protection: Cross-origin request management
- Rate Limiting: API endpoint protection against abuse
// Password hashing example
const hashedPassword = await bcrypt.hash(password, 12);
// JWT token generation
const token = jwt.sign(
{ userId: user._id, role: user.role },
process.env.JWT_SECRET,
{ expiresIn: '24h' }
);
{
username: { type: String, required: true, unique: true },
name: { type: String, required: true },
email: { type: String, required: true, unique: true },
password: { type: String, required: true },
role: { type: String, enum: ['User', 'Mentor', 'Admin'] },
profile: {
jobTitle: String,
experience: Number,
skills: [String],
interests: [String]
},
timestamps: true
}
{
jobTitle: { type: String, required: true },
industry: String,
averageSalary: String,
requiredSkills: [String],
jobOutlook: String,
description: String,
companies: [String]
}
# Run in development mode with auto-reload
npm run dev
# Run tests
npm test
# Code linting
npm run lint
# Production build
npm run build
FROM node:16-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
EXPOSE 3001
CMD ["node", "index.js"]
- Heroku: Easy deployment with Git integration
- AWS EC2: Scalable cloud hosting
- Digital Ocean: Cost-effective VPS hosting
- Railway: Modern deployment platform
- Database indexing for faster queries
- Response caching for frequently accessed data
- Pagination for large dataset handling
- Connection pooling for database efficiency
- Request/response logging
- Error tracking and reporting
- Performance metrics collection
- API usage analytics
- Frontend Application: MentorShip-FrontEnd
- Live Platform: mentorshipsih.netlify.app
- Google Gemini AI: Career recommendation engine
- Email Services: Automated notifications
- Cloud Storage: Resource and file management
- Analytics: User behavior tracking
# Unit tests
npm run test:unit
# Integration tests
npm run test:integration
# API endpoint testing
npm run test:api
# Load testing
npm run test:load
- ESLint for code standardization
- Prettier for code formatting
- Husky for pre-commit hooks
- Jest for comprehensive testing
- Comprehensive endpoint documentation
- Request/response examples
- Error handling guidelines
- Authentication flow diagrams
- Detailed setup instructions
- Troubleshooting guides
- FAQ section
- Community forums
- Advanced AI Integration: Enhanced career prediction models
- Real-time Communication: WebSocket integration for live mentoring
- Mobile API: Dedicated mobile application endpoints
- Analytics Dashboard: Comprehensive platform insights
- Multi-language Support: International platform expansion
- Redis caching implementation
- GraphQL API development
- Microservices architecture migration
- Enhanced security protocols
We welcome contributions from the developer community!
- 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
- Follow established coding standards
- Write comprehensive tests for new features
- Update documentation for API changes
- Ensure backward compatibility
This project is licensed under the MIT License - see the LICENSE file for details.
- Primary Developer: Ujjwal Jha
- Project Repository: Mentorship-server
- Issues: GitHub Issues for bug reports
- Discussions: GitHub Discussions for community support
- Email: Technical support via repository contacts
π Star this repository if you find it helpful!
Version: 1.0.0 | Last Updated: January 2024 | Node.js: v16+ | MongoDB: v4.4+# Server
upstream/main