Sinceides Platform is a comprehensive Learning Management System (LMS) backend built with modern technologies. This platform provides complete functionality for managing courses, lessons, users, and educational content with advanced features like video streaming, adaptive learning, and AI-powered recommendations.
- JWT-based authentication with refresh token rotation
- Role-based access control (RBAC)
- Password hashing with bcrypt
- Rate limiting and security headers
- Input validation with Zod schemas
- Create and manage courses with rich media
- Upload course banners and intro videos
- Lesson management with video content
- Automatic thumbnail generation
- File attachment support
- Multi-quality video streaming (360p to 1080p)
- Automatic video compression
- Thumbnail generation from videos
- Cloudinary integration for CDN delivery
- Adaptive bitrate streaming
- Personalized learning recommendations
- Adaptive content difficulty adjustment
- Learning pattern analysis
- Predictive analytics for course completion
- At-risk student identification
- User engagement metrics
- Course completion predictions
- Learning path optimization
- Performance analytics
- Risk assessment algorithms
- Challenge system (Daily, Weekly, Monthly)
- Leaderboards and rankings
- Achievement tracking
- Progress monitoring
The platform uses a modular architecture for better maintainability:
api/
βββ services.js # Core services, repositories, and data models
βββ main.js # Advanced business logic and service implementations
βββ api.js # API endpoints, middleware, and controllers
βββ index.ts # Main entry point for Vercel deployment
βββ config/ # Configuration files
- Runtime: Node.js 18+
- Framework: Express.js
- Language: TypeScript
- Authentication: JWT + Passport.js
- Validation: Zod schemas
- Database: Supabase (PostgreSQL)
- File Storage: Cloudinary
- Cache: Redis (Upstash)
- Search: Full-text search with Supabase
- Platform: Vercel Serverless Functions
- CI/CD: GitHub Actions
- Monitoring: Built-in health checks
- Documentation: Swagger/OpenAPI 3.0
- Node.js 18 or higher
- npm or yarn
- Supabase account
- Cloudinary account
- Upstash Redis account
- Clone the repository
git clone https://github.com/your-username/sinceides-backend.git
cd sinceides-backend- Install dependencies
npm install- Set up environment variables
cp env.example .envEdit .env with your configuration:
# Supabase Configuration
SUPABASE_URL=your_supabase_project_url
SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
# Cloudinary Configuration
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
# Redis Configuration
UPSTASH_REDIS_REST_URL=your_upstash_redis_url
UPSTASH_REDIS_REST_TOKEN=your_upstash_redis_token
# JWT Configuration
JWT_SECRET=your_jwt_secret_key
JWT_REFRESH_SECRET=your_jwt_refresh_secret_key
JWT_EXPIRES_IN=1h
JWT_REFRESH_EXPIRES_IN=7d
# Server Configuration
PORT=3000
NODE_ENV=development
CORS_ORIGIN=http://localhost:3000- Run the development server
npm run devThe API will be available at http://localhost:3000
- Development:
http://localhost:3000/docs - Production:
https://your-domain.vercel.app/docs
POST /api/auth/register- Register new userPOST /api/auth/login- User loginPOST /api/auth/refresh- Refresh access tokenPOST /api/auth/logout- User logout
GET /api/courses- Get public coursesPOST /api/courses- Create course (with file upload)GET /api/courses/:id- Get course detailsPUT /api/courses/:id- Update courseDELETE /api/courses/:id- Delete course
POST /api/courses/:courseId/lessons- Create lesson (with video upload)GET /api/courses/:courseId/lessons- Get course lessonsGET /api/courses/:courseId/lessons/:id- Get lesson detailsPUT /api/courses/:courseId/lessons/:id- Update lessonDELETE /api/courses/:courseId/lessons/:id- Delete lesson
GET /api/users/:id- Get user profilePUT /api/users/:id- Update user profileGET /api/users- Get users list (Admin/HR)PUT /api/users/:id/block- Block user (Admin)
POST /api/upload- Upload filesDELETE /api/files- Delete files
See API_DOCUMENTATION.md for detailed endpoint documentation.
| Variable | Description | Required | Default |
|---|---|---|---|
SUPABASE_URL |
Supabase project URL | β | - |
SUPABASE_SERVICE_ROLE_KEY |
Supabase service role key | β | - |
CLOUDINARY_CLOUD_NAME |
Cloudinary cloud name | β | - |
CLOUDINARY_API_KEY |
Cloudinary API key | β | - |
CLOUDINARY_API_SECRET |
Cloudinary API secret | β | - |
UPSTASH_REDIS_REST_URL |
Upstash Redis URL | β | - |
UPSTASH_REDIS_REST_TOKEN |
Upstash Redis token | β | - |
JWT_SECRET |
JWT signing secret | β | - |
JWT_REFRESH_SECRET |
JWT refresh secret | β | - |
PORT |
Server port | β | 3000 |
NODE_ENV |
Environment | β | development |
CORS_ORIGIN |
CORS origin | β | http://localhost:3000 |
- Maximum file size: 50MB
- Supported image types: JPEG, PNG, WebP, GIF
- Supported video types: MP4, WebM, AVI, MOV
- Supported document types: PDF, DOC, DOCX
-
Connect Repository
- Connect your GitHub repository to Vercel
- Import the project
-
Configure Environment Variables
- Add all required environment variables in Vercel dashboard
- Set
NODE_ENV=production
-
Deploy
- Deploy automatically on push to main branch
- Or deploy manually from Vercel dashboard
# Build the project
npm run build
# Start production server
npm startcurl http://localhost:3000/api/health# Register
curl -X POST http://localhost:3000/api/auth/register \
-H "Content-Type: application/json" \
-d '{"name":"Test User","email":"test@example.com","password":"password123","phoneNumber":"+1234567890","role":"student"}'
# Login
curl -X POST http://localhost:3000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"test@example.com","password":"password123"}'- Database connectivity
- Redis cache status
- Cloudinary service status
- API response times
- Structured logging with Winston
- Request/response logging
- Error tracking
- Performance metrics
- JWT token expiration
- Refresh token rotation
- Password strength validation
- Account lockout protection
- Rate limiting (100 requests/15 minutes)
- CORS protection
- Helmet security headers
- Input sanitization
- SQL injection prevention
- File type validation
- File size limits
- Malware scanning (via Cloudinary)
- Secure file storage
- 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 TypeScript best practices
- Write comprehensive tests
- Update documentation
- Follow the existing code style
- Ensure all tests pass
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: API Documentation
- Issues: GitHub Issues
- Email: support@sinceides.com
- Discord: Join our community
- Supabase team for the amazing database platform
- Cloudinary for excellent media management
- Vercel for seamless deployment
- The open-source community for inspiration
Version: 2.0.0
Last Updated: 2024-01-01
Maintained by: Sinceides Development Team