Shiksha-Connect is a comprehensive, full-stack attendance management system designed for educational institutions. It enables teachers, administrators, and district officers to efficiently track student attendance using manual entry, facial recognition (with photo processing), or RFID methods. The system provides real-time dashboards, AI-powered analytics for insights, detailed reporting, and role-based access control. Built with modern technologies, it integrates seamlessly with external authentication services and optional AI enhancements for educational decision-making.
- Role-Based Authentication: Secure login via Emergent Auth (OAuth), supporting teachers, administrators, and district officers with appropriate permissions.
- Student Management: Add, view, and manage student profiles including personal details, class/section assignment, parent information, and photo uploads with basic facial recognition preprocessing (using OpenCV for face detection and placeholder embeddings).
- Multi-Method Attendance Marking: Mark attendance manually, via facial recognition (processed images stored as base64 with embeddings), or RFID. Supports bulk operations for classes.
- Real-Time Dashboard: Overview of daily attendance rates, trends over the last 7 days, total students, and role-specific metrics.
- AI-Powered Analytics: Generate actionable insights using Emergent LLM integration (GPT-4o-mini) to analyze attendance patterns and provide recommendations for school administrators.
- Reporting & Exports: Filterable reports by date range, class, section, or school/district. Enriched with student details for comprehensive views.
- Classes & Sections: Organized student grouping with aggregation for easy navigation.
- Image Processing: Secure photo upload handling with face detection, resizing, and embedding generation for future recognition features.
- Responsive UI: Modern React interface with Tailwind CSS, Radix UI components, and Recharts for visualizations.
The system follows a client-server architecture with asynchronous operations for scalability.
graph TD
A[Frontend: React App<br/>Dashboard, Student Mgmt,<br/>Attendance, Analytics,<br/>Reports] -->|Axios API Calls<br/>Session Token| B[Backend: FastAPI Server<br/>Auth, Students, Attendance,<br/>Analytics, Reports]
B -->|MongoDB Queries<br/>Async Motor| C[Database: MongoDB<br/>Users, Students,<br/>Attendance Records]
B -->|Photo Upload<br/>OpenCV Processing| D[Image Processing<br/>Face Detection & Embeddings]
B -->|Optional AI Insights| E[Emergent LLM<br/>GPT-4o-mini<br/>Analytics Generation]
F[Emergent Auth Service<br/>OAuth/Session Mgmt] -->|Session ID/Redirect| A
A -->|Webcam/Camera| G[Live Attendance Capture<br/>React Webcam]
style A fill:#e1f5fe
style B fill:#f3e5f5
style C fill:#e8f5e8
style D fill:#fff3e0
style E fill:#fce4ec
style F fill:#e0f2f1
- Frontend: Handles UI routing, API interactions, and local state management.
- Backend: Exposes RESTful APIs with authentication middleware.
- Database: NoSQL for flexible schema handling attendance and student data.
- Integrations: External auth and AI services for extensibility.
- Framework: FastAPI (async Python web framework)
- Database: MongoDB (with Motor for async operations)
- Image Processing: OpenCV, Pillow (PIL)
- Authentication: HTTPBearer with session tokens; integrates with Emergent Auth
- AI Integration: Emergent LLM (optional GPT-4o-mini via OpenAI)
- Other: Pydantic for models, bcrypt for hashing, CORS middleware
- Framework: React 18 with React Router for SPA navigation
- Styling: Tailwind CSS, Radix UI primitives for accessible components
- State & Forms: React Hook Form, Zod for validation
- API Client: Axios with cookie-based auth
- UI/UX: Framer Motion for animations, Recharts for charts, Sonner for toasts
- Build Tools: CRACO for Tailwind integration, Yarn as package manager
- Environment: Docker-compatible structure
- Testing: Basic unit tests (extendable)
- Logging: Python logging module
Before installation:
- Python 3.8+
- Node.js 18+ and Yarn 1.22+
- MongoDB (local or cloud instance, e.g., MongoDB Atlas)
- Git for cloning the repository
- Optional: Emergent API key for AI features and auth
- OpenCV dependencies (install via system package manager if needed, e.g.,
brew install opencvon macOS)
Set up environment variables in .env files (see installation).
-
Navigate to the backend directory:
cd backend -
Install dependencies:
pip install -r requirements.txt(Or use
requirements_modified.txtif custom versions are needed.) -
Configure environment variables in
backend/.env:MONGO_URL=mongodb://localhost:27017/shiksha_connect DB_NAME=shiksha_connect CORS_ORIGINS=http://localhost:3000 EMERGENT_LLM_KEY=your_emergent_key_here # Optional for AI -
Run the server:
uvicorn server:app --reload --host 0.0.0.0 --port 8000The API will be available at
http://localhost:8000. Check docs athttp://localhost:8000/docs.
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
yarn install -
Configure environment variables in
frontend/.env:REACT_APP_BACKEND_URL=http://localhost:8000 -
Start the development server:
yarn startThe app will open at
http://localhost:3000.
- Install and run MongoDB locally, or use a cloud service.
- The app auto-creates collections (users, students, attendance) on first use.
- No migrations needed due to NoSQL flexibility.
-
Authentication: The app uses Emergent Auth. On first visit, it redirects to the login page. Click "Login" to authenticate via the external service. After approval, it processes the session and redirects back.
-
Dashboard: View overview stats, today's attendance, and trends.
-
Student Management (
/students): Add students with optional photo upload (face detection applied). View lists filtered by class/section. -
Attendance Marking (
/attendance): Select date, class, and mark status for students (bulk or individual). -
Analytics (
/analytics): Generate insights with AI (if enabled) for selected date ranges. -
Reports (
/reports): Download or view filtered attendance reports.
For demo purposes, roles default to "teacher" on new users. Test with sample data via API docs.
All endpoints under /api with JWT/session token auth (via cookies or Authorization header).
| Endpoint | Method | Description | Parameters |
|---|---|---|---|
/auth/session-data |
GET | Process Emergent session and create user | Header: X-Session-ID |
/students |
POST | Create student (with photo) | Form data: name, roll_number, etc.; File: photo |
/students |
GET | List students | Query: class_name, section |
/students/{student_id} |
GET | Get single student | Path: student_id |
/attendance/mark |
POST | Mark attendance for students | Body: student_ids[], date, status, method |
/attendance |
GET | Get attendance for date | Query: date, class_name, section |
/reports/attendance |
POST | Generate report | Body: filters (school_id, dates, etc.) |
/analytics/insights |
POST | AI analytics | Body: school_id, date_range, etc. |
/analytics/dashboard |
GET | Dashboard data | None (role-based) |
/classes |
GET | List classes/sections | None |
/auth/logout |
POST | Logout user | None |
Full OpenAPI docs available at /docs.
- Running Tests: Backend -
pytest backend_test.py; Frontend -yarn test. - Adding Features: Extend Pydantic models and routes in
server.py; Add React components insrc/components/. - Facial Recognition: Currently placeholder embeddings; integrate full ML model (e.g., face_recognition lib) for production.
- Security: Ensure HTTPS in production; validate all uploads.
- Performance: Use MongoDB indexes on frequent queries (e.g., date, student_id).
Contributions welcome! Fork the repo, create a feature branch, and submit a PR. Focus on:
- Bug fixes
- New features (e.g., email notifications, export to CSV)
- Documentation improvements
- Tests
Please follow PEP 8 for Python and ESLint for JS. See CONTRIBUTING.md for details (create if needed).
This project is licensed under the MIT License - see the LICENSE file for details.
- Report issues on GitHub.
- For Emergent integration help: Emergent Docs.
- Contact: Your GitHub or open an issue.
Built with ❤️ for education. Track, analyze, and improve attendance effortlessly.