Event-Driven EduTech Platform powered by Motia
A production-ready, 100% dynamic system that tracks real student engagement and detects early dropout risk using event-driven workflows.
Educational dropouts are a critical challenge in modern education:
- Early Detection: Identifies at-risk students before it's too late
- Data-Driven Intervention: Enables timely mentoring and support
- Scalable Solution: Works for institutions of any size
- Real-Time Monitoring: Immediate alerts when risk levels change
This system helps educational institutions reduce dropout rates by providing actionable insights based on actual student behavior, not assumptions.
Traditional systems process data synchronously, creating bottlenecks. This system leverages Motia's event-driven architecture for:
- Controllers only emit events, no business logic
- All processing happens asynchronously in isolated steps
- Easy to scale and maintain
Student Event β Validate β Store β Analyze β Detect Risk β Notify
Every engagement event automatically triggers a complete risk assessment pipeline.
Add new steps to the workflow without touching existing code:
- Add email notifications
- Integrate with SMS services
- Connect to external analytics
- Add machine learning models
Every step logs its execution, making debugging and monitoring transparent.
- No pre-seeded students
- No mock data arrays
- No hardcoded scenarios
- No fake dashboards
- User Registration: Every student/mentor/admin registers themselves
- Real Events: All data comes from actual user submissions
- Live Monitoring: Risk detection starts only when real events occur
- Dynamic Dashboards: All analytics computed from MongoDB in real-time
This is not a demo. This is a production system.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend (React) β
β ββββββββββββ ββββββββββββ ββββββββββββ βββββββββββ β
β β Student β β Mentor β β Admin β β Auth β β
β βDashboard β βDashboard β βDashboard β β Pages β β
β ββββββββββββ ββββββββββββ ββββββββββββ βββββββββββ β
ββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ
β HTTP/REST API
ββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββ
β Backend (Express + Motia) β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Authentication Middleware β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β ββββββββββββ ββββββββββββ ββββββββββββ βββββββββββ β
β β Auth β β Student β β Mentor β β Admin β β
β β Routes β β Routes β β Routes β β Routes β β
β ββββββ¬ββββββ ββββββ¬ββββββ ββββββββββββ βββββββββββ β
β β β β
β β β motia.emit('STUDENT_EVENT') β
β β βΌ β
β ββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββ β
β β Motia Workflow Engine β β
β β ββββββββββββββββββββββββββββββββββββββββββββ β β
β β β StudentDropoutRiskWorkflow β β β
β β β 1. validateStudentEvent β β β
β β β 2. storeEvent β β β
β β β 3. analyzeEngagement β β β
β β β 4. detectDropoutRisk β β β
β β β 5. notifyStudent β β β
β β β 6. notifyMentor β β β
β β ββββββββββββββββββββββββββββββββββββββββββββ β β
β βββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββ¬ββ΄ββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββ
β MongoDB Database β
β βββββββββββ ββββββββββββββββ ββββββββββββββββββββ β
β β Users β βStudentProfileβ β EngagementEvent β β
β βββββββββββ ββββββββββββββββ ββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The system evaluates three key engagement metrics:
- Medium Risk: 3+ consecutive absences
- Resets to 0 when student attends
- High Risk: 2+ missed assignments
- Tracks submitted vs. missed ratio
- High Risk: Average score < 40%
- Calculates average from all submitted test scores
Risk levels are recalculated after every event submission via the Motia workflow.
- Node.js (LTS) - Runtime environment
- Express - Web framework
- Motia - Event-driven workflow engine
- MongoDB + Mongoose - Database
- JWT - Authentication
- bcryptjs - Password hashing
- React 18 - UI library
- Vite - Build tool
- Tailwind CSS - Styling
- Axios - HTTP client
- React Router - Routing
- Recharts - Data visualization
- Node.js v18+ and npm
- MongoDB (local or Atlas)
- Git
git clone <repository-url>
cd student-dropout-systemcd backend
npm install
# Create .env file
cp .env.example .env
# Edit .env with your configuration:
# MONGODB_URI=mongodb://localhost:27017/student-dropout-system
# JWT_SECRET=your-secret-key
# PORT=5000
# FRONTEND_URL=http://localhost:5173cd frontend
npm install
# Create .env file (optional)
# VITE_API_URL=http://localhost:5000/api# If using local MongoDB:
mongod
# If using MongoDB Atlas, ensure your connection string is in backend/.envTerminal 1 - Backend:
cd backend
npm run devTerminal 2 - Frontend:
cd frontend
npm run dev- Frontend: http://localhost:5173
- Backend API: http://localhost:5000
- Health Check: http://localhost:5000/health
- Create a new Web Service on Render
- Connect your repository
- Configure:
- Build Command:
cd backend && npm install - Start Command:
cd backend && npm start - Environment Variables:
MONGODB_URI=<your-mongodb-atlas-uri> JWT_SECRET=<random-secret-key> PORT=5000 FRONTEND_URL=<your-frontend-url> NODE_ENV=production
- Build Command:
- Create project on Railway
- Add MongoDB database (or use external MongoDB Atlas)
- Deploy from GitHub
- Add environment variables (same as above)
cd frontend
npm run build
# Deploy using Vercel CLI
vercel --prod
# Or connect GitHub repo on vercel.comEnvironment Variables on Vercel:
VITE_API_URL=<your-backend-url>/api
cd frontend
npm run build
# Deploy using Netlify CLI
netlify deploy --prod --dir=dist
# Or drag-and-drop dist/ folder on netlify.comNetlify environment variables:
VITE_API_URL=<your-backend-url>/api
- Create a free cluster at MongoDB Atlas
- Create a database user
- Whitelist IP addresses (0.0.0.0/0 for development)
- Get connection string and add to backend environment variables
- Register with your details (name, email, course, year)
- Login to access your dashboard
- Submit engagement events:
- Mark attendance (Present/Absent)
- Submit assignment status
- Record test scores
- Monitor your risk level and follow recommendations
- Register as a mentor
- View all students sorted by risk level
- Filter students by risk category
- View detailed student profiles and engagement history
- Receive alerts for high-risk students
- Register as an admin
- View institution-wide statistics:
- Total users (students/mentors/admins)
- Risk distribution
- Engagement metrics
- Average performance indicators
- Monitor high-risk students requiring immediate intervention
POST /api/auth/register- Register new userPOST /api/auth/login- Login user
POST /api/student/event- Submit engagement event (triggers Motia workflow)GET /api/student/dashboard- Get student dashboard data
GET /api/mentor/dashboard- Get all students with risk dataGET /api/mentor/student/:studentId- Get detailed student information
GET /api/admin/overview- Get institution-wide statistics
Trigger: STUDENT_EVENT
-
validateStudentEvent
- Verifies student exists and is valid
- Validates event type and data structure
- Returns validated event data
-
storeEvent
- Creates EngagementEvent document in MongoDB
- Timestamps the event
- Returns event ID
-
analyzeEngagement
- Fetches or creates StudentProfile
- Updates statistics based on event type
- Calculates running averages
-
detectDropoutRisk
- Applies risk detection rules
- Updates risk level and reasons
- Returns risk assessment
-
notifyStudent
- Generates student notification if at risk
- Provides personalized recommendations
- (In production: sends email/SMS)
-
notifyMentor
- Alerts mentors if risk level changed to Medium/High
- Includes student details and action items
- (In production: sends email/SMS)
- Modern SaaS Design: Clean, professional interface
- Calm Color Palette: Blue/green focus for educational context
- Responsive: Works on desktop, tablet, and mobile
- Real-time Feedback: Instant updates after event submission
- Color-coded Risk Badges: Visual risk level indicators
- Interactive Charts: Performance and engagement trends
- Role-based Dashboards: Tailored experience for each user type
25-30% of college students drop out, often due to undetected early warning signs.
A real-time, event-driven monitoring system that:
- Tracks student engagement automatically
- Detects dropout risk using data science
- Alerts mentors for timely intervention
- Scales across institutions
- Event-Driven Architecture: Powered by Motia for scalability
- 100% Dynamic: No mock data, real user-driven analytics
- Production-Ready: JWT auth, MongoDB, proper error handling
- Beautiful UX: Clean, modern interface built with React + Tailwind
- Reduces dropout rates through early intervention
- Saves institutional resources
- Improves student success metrics
- Empowers data-driven decision making
- Modern MERN stack with Motia
- Modular, extensible architecture
- Real-time risk calculation
- Role-based access control
- Password Hashing: bcryptjs with salt rounds
- JWT Authentication: Secure token-based auth
- Protected Routes: Middleware-based authorization
- Role-Based Access: Students/Mentors/Admins have different permissions
- Environment Variables: Sensitive data not in code
- Input Validation: All API inputs validated
{
name: String,
email: String (unique),
password: String (hashed),
role: 'student' | 'mentor' | 'admin',
course: String (for students),
year: Number (for students),
createdAt: Date
}{
userId: ObjectId (ref: User),
riskLevel: 'Low' | 'Medium' | 'High',
riskReason: String,
statistics: {
totalAttendance: Number,
presentCount: Number,
absentCount: Number,
consecutiveAbsences: Number,
assignmentsSubmitted: Number,
assignmentsMissed: Number,
averagePerformance: Number,
performanceScores: [Number]
},
lastUpdated: Date
}{
studentId: ObjectId (ref: User),
eventType: 'attendance' | 'assignment' | 'performance',
eventData: {
status: 'present' | 'absent', // for attendance
submitted: Boolean, // for assignment
assignmentName: String,
score: Number (0-100), // for performance
testName: String
},
processed: Boolean,
createdAt: Date
}- Register as a student
- Submit 3 absences consecutively β Risk becomes Medium
- Miss 2 assignments β Risk escalates to High
- Submit a test score < 40% β Remains High with multiple reasons
- Check mentor dashboard β Student appears at top with high-risk badge
- Mark attendance as present β Consecutive absences reset to 0
- Submit several assignments β Assignment ratio improves
- Score 80% on test β Average performance increases
- Risk level drops β Student moves to Medium or Low risk
This is a hackathon/educational project. To extend it:
- Add new risk factors - Create new detection rules in
detectDropoutRisk.step.js - Add email notifications - Integrate SendGrid/Nodemailer in notification steps
- Add ML predictions - Create new Motia step for predictive analytics
- Add more visualizations - Extend charts in dashboard components
MIT License - Feel free to use this for educational purposes, hackathons, or real implementations.
- β€οΈ Passion for education technology
- β‘ Motia event-driven architecture
- π― Focus on real-world impact
- π Production-ready code quality
For questions, feedback, or collaboration:
- Create an issue in this repository
- Fork and submit pull requests
- Motia for the powerful event-driven workflow engine
- MongoDB for flexible data storage
- React and Tailwind CSS for modern UI development
Remember: This system tracks real students with real engagement data. It's designed to make a difference in education, one student at a time. πβ¨