EduFlow is a comprehensive full-stack e-learning platform built with the MERN stack (MongoDB, Express, React, Node.js). It delivers a modern learning experience with an intuitive interface, interactive courses, and powerful admin tools. ๐
- Multiple Login Methods: Email/password and Google OAuth integration ๐
- Role-Based Access: Admin and student portals with appropriate permissions ๐ฉโ๐ผ๐จโ๐
- Secure Sessions: JWT authentication with "Remember Me" option ๐ก๏ธ
- Smooth Onboarding: Quick signup process to get started in seconds! โก
- Intuitive Course Catalog: Browse, search, and filter courses easily ๐
- Admin Tools: Comprehensive course creation and management dashboard ๐ ๏ธ
- Rich Content: Support for video lectures, documents, and interactive quizzes ๐น๐โ๏ธ
- Analytics: Detailed course performance metrics with beautiful charts ๐
- Personalized Dashboard: Track enrolled courses and progress at a glance ๐
- Interactive Learning: Video playback, quiz attempts, and progress tracking ๐ฏ
- Achievement System: Earn certificates upon course completion ๐
- Bookmarking: Save courses for later viewing with one click ๐
- Mobile Friendly: Learn on any device, anytime, anywhere! ๐ฑ๐ป
- Automatic Generation: PDF certificates upon course completion ๐
- Verification Portal: Public verification of certificate authenticity ๐
- Professional Design: Customizable certificate templates for a polished look โจ
- Social Sharing: Easy sharing to LinkedIn and other platforms for career growth ๐
- Customizable Profile: Update personal information and preferences easily ๐
- Avatar Management: Upload and manage profile pictures to express yourself ๐ผ๏ธ
- Learning Statistics: Visual representation of learning journey with colorful charts ๐
- Settings Panel: Manage notification and account preferences your way โ๏ธ
- 24/7 Support: Intelligent chat assistant for course recommendations ๐ฌ
- Contextual Help: Tailored assistance based on user location in the app ๐ง
- Voice Capability: Optional voice interaction mode for hands-free learning ๐ค
- Personalized Responses: Smart suggestions based on your learning history ๐ฎ
- ๐งญ React Router for smooth navigation
- ๐งฉ shadcn/ui for beautiful component library
- ๐ jsPDF and html2canvas for certificate generation
- ๐ฑ Responsive design for all devices
- ๐๏ธ Mongoose for MongoDB ORM
- โ Express Validator for request validation
- ๐ Multer for file uploads
- ๐ Secure API endpoints
- ๐ฆ Node.js (v14 or higher)
- ๐๏ธ MongoDB (local or Atlas)
- ๐ฅ Firebase account (for Google authentication)
-
Clone the repository ๐
git clone https://github.com/nveed-gung/eduflow.git cd eduflow -
Install dependencies ๐ฅ
npm run install-all
-
Configure environment variables โ๏ธ
- Create a
.envfile in the server directory based on.env.example - Set up MongoDB connection
- Configure Firebase credentials
- Create a
-
Run the application ๐โโ๏ธ
# Development mode (runs both client and server) npm run dev # Run client only npm run client # Run server only npm run server
-
Access the application ๐
- Frontend: http://localhost:5173
- Backend API: http://localhost:5000
- Start learning! ๐
EduFlow is optimized for seamless deployment to Render as a single Web Service. ๐ข
-
Create a MongoDB Atlas Database ๐๏ธ
- Sign up for MongoDB Atlas
- Create a new cluster
- Set up database access (username & password)
- Add network access for Render IPs (0.0.0.0/0 for simplicity)
- Get your connection string
-
Set up GitHub Repository ๐
git add . git commit -m "Prepare for deployment" git push
-
Deploy to Render ๐
- Sign up for Render
- From your dashboard, select "New" and "Web Service"
- Connect your GitHub repo
- Configure your Web Service:
- Name:
eduflow(or your preferred name) - Environment:
Node - Build Command:
bash ./render-build.sh - Start Command:
NODE_ENV=production npm start - Auto-Deploy: Enable
- Name:
-
Set Environment Variables ๐
NODE_ENV:productionMONGODB_URI: Your MongoDB Atlas connection stringJWT_SECRET: Your secret key for JWT tokensRENDER:true- All Firebase configuration variables
-
Wait for Deployment โณ
- Render will build and deploy your application
- Once deployed, you can access your application at the provided Render URL
- Share with the world! ๐
PORT=5000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
CLIENT_URL=http://localhost:5173
FIREBASE_PROJECT_ID=your_firebase_project_id
FIREBASE_PRIVATE_KEY=your_firebase_private_key
FIREBASE_CLIENT_EMAIL=your_firebase_client_email
For development (.env.development):
VITE_API_URL=http://localhost:5000/api
VITE_FIREBASE_API_KEY=your_firebase_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_firebase_auth_domain
VITE_FIREBASE_PROJECT_ID=your_firebase_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_firebase_storage_bucket
VITE_FIREBASE_APP_ID=your_firebase_app_id
If you're seeing Error fetching courses: Pt or ERR_CONNECTION_REFUSED errors:
-
Clear Browser State: ๐งน
- Open browser console (F12)
- Copy and paste the code from
reset-app-state.jsto clear local storage and reload - This often resolves client-side connection caching issues
-
Check Network Configuration: ๐ง
- Ensure the API URL is configured properly in
client/src/lib/api.ts - The production build should be using a relative path (
/api) not an absolute URL - Check browser console to see which API URL is being used
- Ensure the API URL is configured properly in
-
Verify Environment Variables: ๐
- Client: Ensure the
.env.productionfile containsVITE_API_URL=/api - All API calls should use the centralized API client from
client/src/lib/api.ts
- Client: Ensure the
-
Run Diagnostic Script: ๐ฉบ
node diagnose-connection.js
If your deployed app on Render continues to show API connection errors:
-
Check Render Logs: ๐
- Look for any server-side errors in the Render dashboard logs
- Verify the server is starting correctly and connecting to MongoDB
-
Inspect Network Requests: ๐
- Use browser developer tools to check network requests
- Ensure requests are going to
/api/*paths, nothttp://localhost:5000/api/*
-
Force a Clean Deployment: ๐งผ
- Commit your changes with these API fixes:
git add . git commit -m "Fix API connection issues in production" git push
- If automatic deployments are enabled, this will trigger a fresh build
- Otherwise, manually deploy from the Render dashboard
-
Manual Client Fix: ๐ช
- If you still have issues, try the reset script in the browser console:
localStorage.clear(); sessionStorage.clear(); location.reload(true);
