A comprehensive Next.js application for managing Balvihar classes, students, attendance, fees, and expenditures. The system supports two user roles: Admin (full access) and Guru (teacher access).
- Student Management: Add, edit, and manage all students across different groups
- Attendance Tracking: Mark and view attendance for all students with calendar view
- Fee Payment Tracking: Record and track annual fee payments for all students
- Group Management: Create and manage student groups/categories
- Guru Management: Add, edit, and manage gurus (teachers)
- Comprehensive Dashboard: Overview statistics and quick actions
- My Students: View and manage students assigned to the guru
- Attendance Tracking: Mark attendance for assigned students
- Fee Payments: Track fee payments from assigned students
- Expenditure Management: Record and track expenditures with balance calculation
- Personal Dashboard: View statistics for assigned students and financial balance
- Role-Based Access: Separate interfaces for Admin and Guru roles
- Mobile-First Design: Optimized for mobile devices with responsive UI
- Firebase Integration: Real-time data storage using Firestore
- Calendar View: Visual attendance calendar for easy tracking
- Search & Filter: Filter students, attendance, and fees by group, date, and year
- Next.js 16 (App Router)
- TypeScript
- Tailwind CSS
- Shadcn UI Components
- Firebase Firestore & Firebase Auth
- Firebase Analytics
- date-fns for date handling
- Lucide React for icons
- Node.js 18+ and npm
- Firebase project with Firestore enabled
- Clone the repository and install dependencies:
npm install-
Set up Firebase:
- Create a Firebase project at Firebase Console
- Enable Firestore Database
- Get your Firebase configuration from Project Settings
-
Configure environment variables:
Create a
.env.localfile in the root directory with your Firebase configuration:
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
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=your_measurement_id # Optional, for Analytics- Run the development server:
npm run dev- Open http://localhost:3000 in your browser.
-
Select Role: On the home page, choose between Admin or Guru role.
-
Create Gurus (Admin only): Navigate to the Gurus page and add guru/teacher profiles.
-
Create Student Groups (Admin only): Navigate to the Groups page and create student groups/categories.
-
Add Students (Admin only): Go to the Students page and add students, assigning them to a guru and group.
-
Mark Attendance: Use the Attendance page to mark attendance for classes (calendar view available for admins).
-
Record Fee Payments: Use the Fees page to record annual fee payments.
-
Track Expenditures (Guru only): Gurus can record their expenditures to track balance.
balvihar/
├── app/ # Next.js app directory
│ ├── page.tsx # Home page (role selection)
│ ├── admin/ # Admin routes
│ │ ├── page.tsx # Admin dashboard
│ │ ├── students/ # Student management
│ │ ├── attendance/ # Attendance tracking (with calendar)
│ │ ├── fees/ # Fee payment tracking
│ │ ├── groups/ # Group management
│ │ └── gurus/ # Guru management
│ ├── guru/ # Guru routes
│ │ ├── page.tsx # Guru dashboard
│ │ ├── students/ # My students
│ │ ├── attendance/ # Attendance for my students
│ │ ├── fees/ # Fee payments from my students
│ │ └── expenditures/ # Expenditure tracking
│ └── layout.tsx # Root layout
├── components/
│ ├── AdminBottomNav.tsx # Admin navigation
│ ├── GuruBottomNav.tsx # Guru navigation
│ └── ui/ # Shadcn UI components
├── lib/
│ ├── firebase.ts # Firebase configuration
│ ├── services/ # Data service layer
│ │ ├── students.ts
│ │ ├── attendance.ts
│ │ ├── fees.ts
│ │ ├── groups.ts
│ │ ├── gurus.ts
│ │ ├── expenditures.ts
│ │ └── users.ts
│ └── utils.ts # Utility functions
└── types/
└── index.ts # TypeScript type definitions
The app uses the following Firestore collections:
students- Student information (linked to guru and group)groups- Student group/category definitionsattendance- Attendance records (linked to students)feePayments- Fee payment records (linked to students)gurus- Guru/teacher profilesexpenditures- Expenditure records (linked to gurus)users- User accounts with role-based access
- Overview statistics (total students, today's attendance, fees paid, groups)
- Quick action buttons to all management pages
- Recent fee payments list
- Statistics for assigned students only
- Today's attendance for assigned students
- Fee payments from assigned students
- Remaining balance calculation (fees collected - expenditures)
- Quick actions to student, attendance, fees, and expenditures pages
- Admin: Add, edit, delete all students
- Guru: View and manage only assigned students
- Search and filter by group
- View student details including school, class, contact information
- Link students to gurus and groups
- Admin: Mark attendance for all students with calendar view
- Guru: Mark attendance for assigned students only
- Filter by group and date
- View attendance summary and statistics
- Calendar view (Admin) for visual attendance tracking
- Admin: Record and view all fee payments
- Guru: Record and view fees from assigned students only
- Filter by year and group
- View payment statistics
- Track paid and unpaid students
- Create and manage student groups/categories
- View student count per group
- Edit and delete groups (with validation to prevent deletion if students exist)
- Create and manage guru/teacher profiles
- Link students to gurus
- View guru details including contact information
- Activate/deactivate gurus
- Record expenditures with description, amount, date, and category
- View expenditure history
- Calculate remaining balance (fees collected - expenditures)
- Track spending by category
- Full access to all features
- Manage all students, gurus, and groups
- View and manage all attendance and fees
- Access to calendar view for attendance
- Comprehensive dashboard with all statistics
- Access limited to assigned students
- Mark attendance for assigned students
- Record fee payments from assigned students
- Manage personal expenditures
- View balance (fees collected - expenditures)
- Personal dashboard with relevant statistics
The app is designed with mobile devices in mind:
- Responsive layouts that work on all screen sizes
- Touch-friendly buttons and interactions
- Bottom navigation for easy access (role-specific)
- Optimized forms and dialogs for mobile
- Calendar view optimized for mobile devices
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
All Firebase configuration should be stored in .env.local (never commit this file). See SETUP.md for detailed configuration instructions.
This project is private and intended for Balvihar use only.