Skip to content

Repository files navigation

πŸŽ“ Shiksha Flow - AI-Powered Student Support Platform

Shiksha Flow is a comprehensive educational platform that combines AI-powered complaint management and mental health assessment to provide holistic student support. Built with Next.js 16, Firebase, and Google Gemini AI.

Next.js TypeScript Firebase Gemini AI


🌟 Key Features

πŸ€– AI-Powered Complaint Management

  • Smart Assignment: AI automatically assigns complaints to the most suitable authority based on:
    • Student type (Hosteller, Day Scholar, Night Scholar, Remote Learner)
    • Complaint content and context
    • Authority workload and availability
    • Department matching
  • Automatic Classification: AI infers complaint type (Administrative, Infrastructure, Hostel, Academic, Other)
  • Priority Determination: AI sets urgency levels (Low, Medium, High, Urgent) with 0-10 scoring
  • Sentiment Analysis: Detects student emotional state (positive, neutral, negative, frustrated, angry)
  • Key Issues Extraction: Identifies 2-5 main issues from complaint description
  • Smart Scheduling: Prioritizes complaints based on urgency (Urgent: 0-15 mins, High: 15-30 mins, etc.)

🧠 Mental Health Assessment System

  • AI-Powered Personalized Questions: Generates 15 contextual questions based on student profile
  • Comprehensive Analysis: Dual-report system with:
    • Mental State Report: Current state, stress level, key findings, concerns
    • Improvement Report: Immediate actions, short-term strategies, long-term goals
  • Professional Referral: Recommends professional help when needed
  • Actionable Insights: Tailored recommendations with priority-based actions
  • Print-Friendly Reports: Beautifully formatted 2-page reports
  • Progress Tracking: Tracks assessment history and improvement

πŸ” Secure Authentication & Authorization

  • Firebase Authentication with Email/Password
  • Role-based access control (Student, Faculty, Staff, Admin)
  • Protected routes and API endpoints
  • Firestore security rules enforcement

πŸ“Š Analytics & Reporting

  • Dashboard with real-time statistics
  • Complaint tracking by status, priority, student type
  • Mental health trends and insights
  • Admin analytics for institutional oversight

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and npm/yarn
  • Firebase account
  • Google Gemini API key

Installation

  1. Clone the repository
git clone https://github.com/your-org/shiksha-flow.git
cd shiksha-flow
  1. Install dependencies
npm install
# or
yarn install
  1. Set up environment variables

Create .env.local file in the root directory:

# Firebase Configuration (Public)
NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id

# Firebase Admin (Private - Server Only)
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
FIREBASE_CLIENT_EMAIL=firebase-adminsdk@your_project.iam.gserviceaccount.com

# Google Gemini AI (Private - Server Only)
GEMINI_API_KEY=your_gemini_api_key
  1. Set up Firebase
# Login to Firebase
firebase login

# Initialize Firebase (if not already done)
firebase init

# Deploy Firestore rules
firebase deploy --only firestore:rules
  1. Run development server
npm run dev
# or
yarn dev

Open http://localhost:3000 to see the application.


πŸ“ Project Structure

shiksha-flow/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                          # Next.js App Router
β”‚   β”‚   β”œβ”€β”€ api/                      # API Routes
β”‚   β”‚   β”‚   β”œβ”€β”€ ai/
β”‚   β”‚   β”‚   β”‚   └── assign-complaint/ # AI complaint assignment
β”‚   β”‚   β”‚   β”œβ”€β”€ mental-health/        # Mental health APIs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ generate-personalized-questions/
β”‚   β”‚   β”‚   β”‚   └── analyze-comprehensive/
β”‚   β”‚   β”‚   └── register-student/
β”‚   β”‚   β”œβ”€β”€ dashboard/                # Dashboard pages
β”‚   β”‚   β”‚   β”œβ”€β”€ complaints/           # Complaint management
β”‚   β”‚   β”‚   β”œβ”€β”€ mental-health/        # Mental health assessment
β”‚   β”‚   β”‚   └── register-student/
β”‚   β”‚   └── login/                    # Authentication
β”‚   β”œβ”€β”€ components/                   # React components
β”‚   β”‚   β”œβ”€β”€ auth/                     # Auth guards
β”‚   β”‚   β”œβ”€β”€ complaints/               # Complaint components
β”‚   β”‚   β”œβ”€β”€ mental-health/            # Mental health components
β”‚   β”‚   β”œβ”€β”€ layout/                   # Layout components
β”‚   β”‚   └── ui/                       # Reusable UI components
β”‚   β”œβ”€β”€ lib/                          # Utilities
β”‚   β”‚   β”œβ”€β”€ firebase/                 # Firebase config & helpers
β”‚   β”‚   └── firestore/                # Firestore queries
β”‚   β”œβ”€β”€ types/                        # TypeScript types
β”‚   β”œβ”€β”€ hooks/                        # Custom React hooks
β”‚   β”œβ”€β”€ context/                      # React Context (Auth)
β”‚   └── config/                       # App configuration
β”œβ”€β”€ docs/                             # Documentation
β”‚   β”œβ”€β”€ API.md                        # API documentation
β”‚   β”œβ”€β”€ Structure.md                  # Project structure
β”‚   └── IMPACT_AND_FEASIBILITY.md     # Impact analysis
β”œβ”€β”€ public/                           # Static assets
β”œβ”€β”€ firestore.rules                   # Firestore security rules
β”œβ”€β”€ firebase.json                     # Firebase configuration
└── package.json                      # Dependencies

See docs/Structure.md for detailed structure.


πŸ› οΈ Tech Stack

Layer Technology Purpose
Frontend Next.js 16.1.1 (React 19) Server-side rendering, App Router
Styling Tailwind CSS 4 Utility-first CSS framework
Animations Framer Motion Smooth UI animations
Backend Next.js API Routes Serverless API endpoints
Database Firebase Firestore NoSQL cloud database
Authentication Firebase Auth User authentication & management
AI Google Gemini 1.5 Flash Natural language processing
Deployment Vercel Production hosting
Language TypeScript Type-safe development

πŸ“š Documentation


πŸ”‘ Key Components

Complaint System Flow

Student Submits β†’ AI Analyzes β†’ Auto-Assigns β†’ Authority Reviews β†’ Resolution (Also real time status update on student's dashboard)

Mental Health Flow

Welcome β†’ dashboard/mental-health β†’ 15 Questions β†’ AI Analysis β†’ Dual Reports β†’ Actions

πŸš€ Deployment

Build for Production

npm run build
npm run start

Deploy to Vercel

vercel deploy --prod

Deploy Firebase Rules

firebase deploy --only firestore:rules

πŸ§ͺ Testing

Run Development Server

npm run dev

Build Test

npm run build

Lint Check

npm run lint

πŸ“Š Performance

  • Page Load Time: ~1.5s
  • Question Generation: ~3-4s
  • AI Analysis: ~5-8s
  • Database Queries: ~150ms
  • Concurrent Users: 100+ supported

πŸ”’ Security Features

  • βœ… Firebase Authentication
  • βœ… Firestore Security Rules
  • βœ… Role-Based Access Control (RBAC)
  • βœ… Environment Variable Protection
  • βœ… API Route Authentication
  • βœ… Input Validation & Sanitization
  • βœ… HTTPS Only
  • βœ… CORS Protection

🀝 Contributing

Contributions are welcome! Please:

  1. Star and Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License.


πŸ‘₯ Team


πŸ“ž Support

For issues, questions, or suggestions:


🎯 Roadmap

Phase 1 (βœ… Complete)

  • Core complaint system
  • AI-powered assignment
  • Mental health assessment
  • Dual-report generation

Phase 2 (In Progress)

  • Analytics dashboard
  • Email notifications
  • Report history tracking
  • User feedback collection

Phase 3 (Planned)

  • Multi-language support
  • Advanced analytics
  • Integration with LMS
  • Mobile apps (iOS/Android)

🌟 Acknowledgments


Built with passion for students' wellness and academic success

Last Updated: January 9, 2026

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages