A platform for skill sharing and learning built with Next.js and MongoDB, following MVC architecture.
This project follows the Model-View-Controller (MVC) architecture with an additional service layer to enhance maintainability and scalability. For detailed information about the architecture, please refer to the MVC-ARCHITECTURE.md file.
- MVC Architecture: Clear separation of concerns between models, views, and controllers
- Service Layer: Specialized services for cross-cutting concerns like notifications and database operations
- Configuration Management: Centralized configuration for easy environment management
- Standardized API Responses: Consistent response format across all endpoints
- Input Validation: Comprehensive validation utilities for user input
- Structured Logging: Centralized logging service for better debugging and monitoring
- Maintainability: Well-organized code that's easier to understand and modify
- Scalability: New features can be added without affecting existing functionality
- Reusability: Controllers and services can be reused across the application
- Testability: Components can be tested in isolation
- Consistency: Standardized patterns for common operations
Create a .env.local
file in the root directory with the following variables:
# Server
PORT=3000
NODE_ENV=development
# Database
MONGODB_URI=mongodb://localhost:27017/skillshikhi
MONGODB_DB=skillshikhi
# Authentication
JWT_SECRET=your_jwt_secret_key_here
JWT_EXPIRES_IN=7d
# Email
EMAIL_HOST=smtp.example.com
EMAIL_PORT=587
EMAIL_SECURE=false
[email protected]
EMAIL_PASSWORD=your_email_password
EMAIL_FROM=SkillShikhi <[email protected]>
# Cloudinary
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
# Application
BASE_URL=http://localhost:3000
Install dependencies:
npm install
# or
yarn install
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.
SkillShikhi/
├── app/ # Next.js app router pages and API routes
│ ├── api/ # API endpoints (using controllers)
│ └── ... # Page routes
├── components/ # Shared UI components
├── config/ # Centralized configuration management
├── controllers/ # Business logic organized by feature
│ ├── auth/ # Authentication controllers
│ ├── user/ # User-related controllers
│ ├── skill/ # Skill-related controllers
│ ├── session/ # Session-related controllers
│ └── ... # Other feature controllers
├── lib/ # Core libraries and integrations
├── middleware/ # Request middleware
├── models/ # Data models
├── public/ # Static assets
├── services/ # Service layer for complex operations
│ ├── databaseService.js # Database connection and operations
│ ├── loggerService.js # Centralized logging functionality
│ ├── notificationService.js # Email and notification handling
│ └── ... # Other services
├── utils/ # Helper functions
│ ├── apiResponse.js # Standardized API response formatting
│ ├── validation.js # Input validation utilities
│ └── ... # Other utilities
└── views/ # Feature-specific view components
├── auth/ # Authentication views
├── user/ # User-related views
├── skill/ # Skill-related views
└── ... # Other feature views
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.