Skip to content

StudentSathi : An AI-powered early warning system designed to help educational institutions identify at-risk students and improve retention rates.

License

Notifications You must be signed in to change notification settings

naman-agarwal-16/StudentSathi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

110 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

StudentSathi - Student Engagement & Analytics Platform

License: MIT Node.js TypeScript PRs Welcome

A comprehensive Learning Management System with role-based access control, real-time analytics, and LMS integration support. Built for modern education with Supabase and ready for separate deployment.

Overview

StudentSathi is a production-ready LMS platform designed for educators to track student engagement, manage attendance, analyze performance, and integrate with external platforms. Features enterprise-grade RBAC, Supabase integration, and monorepo structure optimized for independent frontend/backend deployment.

Features

Implemented

1. Authentication & Authorization

  • Secure user registration and login with JWT
  • Access and refresh token mechanism
  • Password reset via email
  • Role-based access control (Admin, Teacher, Assistant)
  • Protected API endpoints
  • HttpOnly cookie security

2. Student Management

  • Complete CRUD operations for students
  • Pagination and search functionality
  • Engagement score tracking
  • Attendance rate monitoring
  • Student profile management

3. Alert System

  • Real-time alert generation
  • Unread notification counts
  • Alert categorization (engagement drop, attendance low, grade drop, behavioral)
  • Severity levels (low, medium, high, critical)
  • Mark as read/acknowledged functionality

4. Attendance Tracking

  • Bulk attendance recording
  • Date-based attendance queries
  • Student attendance history
  • Automatic attendance rate calculation
  • Status tracking (present, absent, late, excused)

5. Performance & Grades

  • Grade recording with automatic GPA calculation
  • Subject-wise performance tracking
  • Letter grade assignment (A to F scale)
  • Overall and per-subject GPA
  • Performance history and trends

6. Analytics Dashboard

  • Real-time dashboard metrics
  • Date-range filtering (7/30/90 days)
  • Attendance trends
  • Engagement trends
  • Performance averages
  • Active student monitoring

7. LMS Integrations

  • Configurable LMS integrations (Google Classroom, Canvas, Moodle, Teams)
  • Encrypted API key storage
  • Sync data functionality (stub implementation)

8. Webhook System

  • Webhook configuration for external services
  • Event-based triggers
  • Webhook management (CRUD operations)

9. Real-time UX

  • Loading states on all actions
  • Toast notifications for success/error
  • Auto-refresh of notification counts (30s interval)
  • Optimistic UI updates
  • Error handling with retry logic

Tech Stack

Backend

  • Runtime: Node.js 18+
  • Framework: Express.js
  • Language: TypeScript
  • Database: PostgreSQL
  • ORM: Prisma
  • Authentication: JWT + bcrypt
  • Email: Nodemailer
  • Security: Helmet, CORS, Rate Limiting
  • Validation: Zod

Frontend

  • Framework: React 18
  • Language: TypeScript
  • Build Tool: Vite
  • UI Library: shadcn/ui
  • Styling: TailwindCSS
  • State Management: React Query (TanStack Query)
  • HTTP Client: Axios
  • Routing: React Router v6

Project Structure

StudentSathi/                    # Monorepo root
β”œβ”€β”€ frontend/                    # Frontend application (React + Vite)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/          # React components
β”‚   β”‚   β”‚   └── ui/             # shadcn/ui components
β”‚   β”‚   β”œβ”€β”€ pages/              # Page components
β”‚   β”‚   β”œβ”€β”€ hooks/              # Custom hooks (auth, RBAC)
β”‚   β”‚   β”œβ”€β”€ services/           # API service layer
β”‚   β”‚   β”œβ”€β”€ lib/                # Utilities
β”‚   β”‚   └── types/              # TypeScript types
β”‚   β”œβ”€β”€ public/                 # Static assets
β”‚   β”œβ”€β”€ package.json            # Frontend dependencies
β”‚   └── vite.config.ts          # Vite configuration
β”œβ”€β”€ backend/                     # Backend API (Express + Prisma)
β”‚   β”œβ”€β”€ prisma/
β”‚   β”‚   β”œβ”€β”€ schema.prisma       # Database schema
β”‚   β”‚   └── migrations/         # Database migrations
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ controllers/        # Request handlers
β”‚   β”‚   β”œβ”€β”€ services/           # Business logic
β”‚   β”‚   β”œβ”€β”€ routes/             # API routes
β”‚   β”‚   β”œβ”€β”€ middleware/         # Auth, RBAC, validation
β”‚   β”‚   β”œβ”€β”€ types/              # DTOs and types
β”‚   β”‚   └── config/             # Configuration
β”‚   └── package.json            # Backend dependencies
β”œβ”€β”€ .github/
β”‚   β”œβ”€β”€ workflows/              # CI/CD pipelines
β”‚   β”œβ”€β”€ ISSUE_TEMPLATE/         # Issue templates
β”‚   └── PULL_REQUEST_TEMPLATE.md
β”œβ”€β”€ package.json                # Root package (monorepo scripts)
β”œβ”€β”€ LICENSE                     # MIT License
β”œβ”€β”€ CONTRIBUTING.md             # Contribution guidelines
β”œβ”€β”€ CODE_OF_CONDUCT.md          # Community guidelines
β”œβ”€β”€ CHANGELOG.md                # Version history
β”œβ”€β”€ SECURITY.md                 # Security policy
β”œβ”€β”€ SETUP_GUIDE.md              # Local development setup
β”œβ”€β”€ SUPABASE_MIGRATION.md       # Supabase migration guide
β”œβ”€β”€ RBAC_GUIDE.md               # RBAC implementation guide
└── README.md                   # This file

Quick Start

Try the Live Demo

Experience StudentSathi without setup! Use these credentials:

Teacher Account:

  • Email: demo@studentsathi.com
  • Password: demo123
  • Access: Full teacher dashboard with student analytics

Admin Account:

  • Email: admin@studentsathi.com
  • Password: admin123
  • Access: Complete system administration

Student Account:

  • Email: student@studentsathi.com
  • Password: student123
  • Access: Student dashboard with personal analytics

Note: Demo accounts contain pre-populated sample data including student records, attendance, grades, and alerts.


Prerequisites

  • Node.js 18+ and npm 9+
  • PostgreSQL 14+ OR Supabase account
  • Git

Local Development

# 1. Clone repository
git clone https://github.com/naman-agarwal-16/StudentSathi.git
cd StudentSathi

# 2. Install all dependencies
npm run install:all

# 3. Configure backend
cd backend
cp .env.example .env
# Edit .env with your database credentials

# 4. Run database migrations
npx prisma generate
npx prisma migrate dev

# 5. Seed demo data (optional)
npm run seed

# 6. Start development servers (from root)
cd ..
npm run dev
# Frontend: http://localhost:8080
# Backend: http://localhost:3001

Using Supabase

See SUPABASE_MIGRATION.md for complete Supabase setup guide.

# Quick Supabase setup
cd backend
cp .env.example .env

# Update DATABASE_URL in .env:
# DATABASE_URL="postgresql://postgres.[PROJECT-REF]:[PASSWORD]@aws-0-[REGION].pooler.supabase.com:6543/postgres?pgbouncer=true"

npx prisma generate
npx prisma migrate deploy

API Documentation

All API endpoints are documented in SETUP_GUIDE.md.

Key endpoints:

  • POST /api/auth/login - User authentication
  • GET /api/students - List students
  • GET /api/alerts/unread - Get unread alert count
  • POST /api/attendance/bulk - Record attendance
  • GET /api/analytics/summary - Dashboard data

Security

  • Password hashing with bcrypt (salt rounds: 12)
  • JWT token authentication with refresh tokens
  • HttpOnly cookies for secure token storage
  • CORS protection with configurable origins
  • Rate limiting (100 requests per 15 minutes)
  • Input validation with Zod schemas
  • SQL injection protection (Prisma ORM)
  • XSS protection with sanitization
  • Security headers (Helmet.js)
  • Encrypted API key storage
  • Role-based access control (RBAC)
  • Row-level security ready (Supabase RLS)

See SECURITY.md for security policy and SECURITY_IMPLEMENTATION.md for implementation details.

Testing

# Run all tests
npm run test

# Backend tests
cd backend
npm test
npm run test:coverage

# Frontend linting
cd frontend
npm run lint

Current test coverage: ~90% (backend)

Development

Monorepo Commands (from root)

npm run dev                 # Start both frontend and backend
npm run dev:frontend        # Start only frontend
npm run dev:backend         # Start only backend
npm run build               # Build both projects
npm run build:frontend      # Build frontend
npm run build:backend       # Build backend
npm run install:all         # Install all dependencies
npm run prisma:generate     # Generate Prisma Client
npm run prisma:migrate      # Run database migrations
npm run prisma:studio       # Open Prisma Studio

Backend Development

cd backend
npm run dev                 # Starts on port 3001 with hot reload
npm run build               # Build for production
npm start                   # Start production server

Frontend Development

cd frontend
npm run dev                 # Starts on port 8080 with HMR
npm run build               # Build for production
npm run preview             # Preview production build

Database Management

cd backend
npx prisma studio  # Visual database browser
npx prisma migrate dev  # Create new migration
npx prisma generate  # Regenerate Prisma client

Environment Variables

Deployment

Separate Frontend & Backend Deployment

This project is structured as a monorepo with independent frontend and backend that can be deployed separately.

Deploy Backend

Recommended Platforms:

  • Railway - Easy PostgreSQL + Node.js deployment
  • Render - Free tier available
  • Heroku - Classic PaaS
  • Fly.io - Global edge deployment

Quick Deploy to Railway:

# Install Railway CLI
npm install -g @railway/cli

# Login and deploy
railway login
railway init
railway add
railway up

# Set environment variables in Railway dashboard

Deploy Frontend

Recommended Platforms:

Quick Deploy to Vercel:

# Install Vercel CLI
npm install -g vercel

# Deploy
cd frontend
vercel

# Set VITE_API_BASE_URL environment variable

Using Supabase

See SUPABASE_MIGRATION.md for complete guide.

Benefits:

  • Managed PostgreSQL database
  • Connection pooling included
  • Automatic backups
  • Real-time capabilities
  • Row Level Security (RLS)

Environment Variables

Backend (backend/.env)

# Database
DATABASE_URL="postgresql://user:pass@localhost:5432/studentsathi"
# OR for Supabase:
DATABASE_URL="postgresql://postgres.[PROJECT-REF]:[PASSWORD]@aws-0-[REGION].pooler.supabase.com:6543/postgres?pgbouncer=true"

# Security
JWT_SECRET=your-secret-key-minimum-32-characters-long
ENCRYPTION_KEY=your-encryption-key-32-characters-long
FRONTEND_URL=http://localhost:8080

# Email (Optional - for password reset)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-password

Frontend (frontend/.env)

# API Configuration
VITE_API_BASE_URL=http://localhost:3001/api
# OR for production:
VITE_API_BASE_URL=https://your-backend.railway.app/api

# Supabase (Optional - if using Supabase client directly)
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your-anon-key

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Quick Start:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes following our code style
  4. Add tests for new features
  5. Commit using conventional commits (feat:, fix:, docs:, etc.)
  6. Push and open a Pull Request

See also:

πŸ“‹ Roadmap

Phase 1 (Completed)

  • Authentication system with JWT
  • Student CRUD operations
  • Alert management system
  • Attendance tracking
  • Performance/grades management
  • Analytics dashboard
  • LMS integrations (infrastructure)
  • Webhook system (infrastructure)
  • Role-based access control (RBAC)
  • Monorepo structure for separate deployment
  • Supabase integration support

Phase 2 (In Progress)

  • Enhanced UI/UX improvements
  • Comprehensive test coverage (>95%)
  • E2E tests with Playwright
  • Real LMS integrations (Google Classroom, Canvas)
  • Actual webhook delivery system
  • Two-factor authentication (2FA)

Phase 3 (Planned)

  • Advanced analytics and ML predictions
  • Mobile app (React Native)
  • Real-time notifications (WebSocket)
  • Bulk import/export (CSV, Excel)
  • Custom reporting system
  • Multi-language support (i18n)

License

MIT License - see LICENSE file for details.

Documentation

Support

Acknowledgments

Built with modern technologies and best practices:

  • Frontend: React 18, TypeScript, Vite, shadcn/ui, TailwindCSS
  • Backend: Node.js, Express, Prisma, PostgreSQL
  • Database: Supabase/PostgreSQL
  • Deployment: Vercel, Railway, Netlify ready
  • Testing: Jest, React Testing Library
  • CI/CD: GitHub Actions

Special thanks to the open-source community and contributors!


Built with Love for Education

GitHub stars GitHub forks

Version 1.0.0 | Status: Production Ready | License: MIT

Report Bug β€’ Request Feature β€’ View Demo β€’ Documentation

About

StudentSathi : An AI-powered early warning system designed to help educational institutions identify at-risk students and improve retention rates.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published