Administrative application for school staff to manage students, teachers, classes, fees, and verify parent devices. Provides comprehensive oversight of all school operations.
- Dashboard: Statistics overview of students, teachers, classes, and pending verifications
- Student Management: Create, update, delete students; add grades and attendance
- Fee Management:
- View all transactions from all students
- Approve/reject deposits with proof verification
- Approve/reject refund requests
- View proof documents (images/PDFs)
-
Device Verification: Approve or reject parent device access requests
-
User Management: View all registered users with student information
- Node.js & Express.js
- PostgreSQL with Prisma ORM
- JWT for authentication
- Helmet for security headers
- Express Rate Limit for API protection
- SHA-512 for password hashing
- React.js with Vite
- React Router for navigation
- Axios for API calls
- Tailwind CSS (via CDN)
- Lucide React for icons
- Responsive design with mobile sidebar
admin-app/
├── backend/
│ ├── src/
│ │ ├── config/
│ │ │ └── prisma.js
│ │ ├── controllers/
│ │ │ ├── adminAuthController.js
│ │ │ ├── dashboardController.js
│ │ │ ├── userManagementController.js
│ │ │ ├── studentManagementController.js
│ │ │ ├── teacherManagementController.js
│ │ │ ├── classManagementController.js
│ │ │ └── feeManagementController.js
│ │ ├── middlewares/
│ │ │ └── adminAuth.js
│ │ ├── routes/
│ │ │ └── admin.js
│ │ ├── services/
│ │ │ ├── adminAuthService.js
│ │ │ ├── dashboardService.js
│ │ │ ├── userManagementService.js
│ │ │ ├── studentManagementService.js
│ │ │ ├── teacherManagementService.js
│ │ │ ├── classManagementService.js
│ │ │ └── feeManagementService.js
│ │ └── server.js
│ ├── prisma/
│ │ ├── schema.prisma
│ │ ├── seed.js # Creates default admin
│ │ └── migrations/
│ ├── package.json
│ └── .env
├── frontend/
│ ├── src/
│ │ ├── pages/
│ │ │ ├── AdminLogin.jsx
│ │ │ ├── AdminDashboard.jsx
│ │ │ ├── Students.jsx
│ │ │ ├── Teachers.jsx
│ │ │ ├── Classes.jsx
│ │ │ ├── Fees.jsx
│ │ │ └── Devices.jsx
│ │ ├── hooks/
│ │ │ └── usePendingDevicesCount.js
│ │ ├── services/
│ │ │ └── api.js
│ │ ├── App.jsx
│ │ └── main.jsx
│ ├── index.html
│ ├── package.json
│ └── vite.config.js
└── README.md
- Node.js (v16 or higher)
- PostgreSQL database (Supabase recommended)
- npm or yarn
-
Navigate to backend directory:
cd admin-app/backend -
Install dependencies:
npm install
-
Create
.envfile:PORT=5001 DATABASE_URL=postgresql://user:password@host:5432/database JWT_SECRET=your_secure_admin_jwt_secret NODE_ENV=development
-
Run Prisma migrations and seed:
npx prisma migrate dev npx prisma generate npx prisma db seed
-
Start the backend:
npm run dev
Backend runs on http://localhost:5001
-
Navigate to frontend directory:
cd admin-app/frontend -
Install dependencies:
npm install
-
Start development server:
npm run dev
Frontend runs on http://localhost:3001
After running npx prisma db seed:
- Email: admin@school.com
- Password: admin123
Important: Change these credentials in production!
- id (UUID)
- name, email, password (hashed)
- role (admin)
- createdAt
- id (UUID)
- name, email, password
- role (parent)
- deviceId, isVerified
- studentId (references Student)
- createdAt
- id (Integer, auto-increment, max 5 digits)
- name, faculty
- classId, feeBalance
- grades[], attendance[], transactions[], users[]
- createdAt
- id (UUID)
- name, email, password
- subject
- createdAt
- id (UUID)
- name, grade, teacherId
- schedules[]
- createdAt
- id (UUID)
- studentId, type (deposit/withdraw)
- amount, status (pending/completed/rejected)
- description, proofUrl
- createdAt
- id (UUID)
- studentId, subject, grade, marks
- createdAt
- id (UUID)
- studentId, date, status (present/absent)
- createdAt
POST /api/admin/login- Admin loginPOST /api/admin/logout- Admin logout
GET /api/admin/dashboard/statistics- Get overview statistics
GET /api/admin/users- Get all users with student infoGET /api/admin/users/pending- Get pending verificationsPUT /api/admin/users/:userId/verify- Verify user devicePUT /api/admin/users/:userId/reject- Reject user device
GET /api/admin/students- Get all studentsPOST /api/admin/students- Create studentPUT /api/admin/students/:id- Update studentDELETE /api/admin/students/:id- Delete studentPOST /api/admin/students/:studentId/grades- Add gradePOST /api/admin/students/:studentId/attendance- Add attendance
GET /api/admin/teachers- Get all teachersGET /api/admin/teachers/:id- Get teacher by IDPOST /api/admin/teachers- Create teacherPUT /api/admin/teachers/:id- Update teacherDELETE /api/admin/teachers/:id- Delete teacher
GET /api/admin/classes- Get all classesGET /api/admin/classes/:id- Get class by IDPOST /api/admin/classes- Create classPUT /api/admin/classes/:id- Update classDELETE /api/admin/classes/:id- Delete class
GET /api/admin/fees/transactions- Get all transactionsGET /api/admin/fees/transactions/:id- Get transaction by IDPUT /api/admin/fees/deposits/:id/approve- Approve depositPUT /api/admin/fees/deposits/:id/reject- Reject depositPUT /api/admin/fees/refunds/:id/approve- Approve refundPUT /api/admin/fees/refunds/:id/reject- Reject refund
- Parents register in client app
- Admin sees pending devices in Devices page
- Admin can see parent name, email, and linked student
- Admin clicks "Approve" or "Reject"
- Only approved devices can login
- Admin creates student with name and faculty
- Student ID is auto-generated (integer)
- Admin can add grades (subject, grade, marks)
- Admin can record attendance (date, status)
- Parents register using this student ID
- Admin sees all transactions from all students
- Filter by: All, Pending, Approved, Rejected
- Click "View Proof" to see uploaded document
- Approve deposits: balance is added to student
- Reject deposits: no balance change
- Approve refunds: balance stays deducted
- Reject refunds: balance is restored
- Create teachers with name, email, subject
- Create classes with name, grade, teacher
- Update or delete as needed
- Full CRUD operations available
- Navigate to Students page
- Click "Add Student"
- Enter name and faculty
- Student ID is auto-generated
- Share student ID with parent for registration
- Navigate to Devices page
- See pending verification requests
- Check parent name and linked student
- Click "Approve" to grant access
- Navigate to Fees page
- Filter by "Pending"
- Click "View Proof" to see payment evidence
- Click "Approve" to add balance
- Click "Reject" to deny payment
- Navigate to Students page
- Click on student
- Click "Add Grade"
- Enter subject, grade letter, and marks
- Submit
- Navigate to Students page
- Click on student
- Click "Add Attendance"
- Select date and status (Present/Absent)
- Submit
- SHA-512 password hashing
- JWT token authentication
- Admin-only access control
- Rate limiting (100 requests per 15 minutes)
- Helmet security headers
- Input validation and sanitization
- CORS protection
- Separate admin authentication
- Total Students
- Total Teachers
- Total Classes
- Pending Device Verifications
- Total Fee Collected
- Total Refunds
- Pending Transactions
- View all transactions across all students
- Search by student name or description
- Filter by status (All/Pending/Approved)
- View proof documents before approval
- Approve/reject with one click
- Automatic balance calculations
- Transaction history with timestamps
- View all registered users
- Filter: All, Pending, Approved
- See linked student for each parent
- Approve/reject device access
- Real-time pending count in sidebar badge
PORT=5001
DATABASE_URL=postgresql://user:password@host:5432/database
JWT_SECRET=your_admin_jwt_secret_min_32_chars
NODE_ENV=development- Set environment variables
- Run migrations:
npx prisma migrate deploy - Generate Prisma client:
npx prisma generate - Seed admin:
npx prisma db seed - Start server:
npm start
- Update API_URL in
src/services/api.jsto production backend URL - Build:
npm run build - Deploy
dist/folder
- Use PostgreSQL database
- Same database as client-app
- Enable connection pooling
- Set up backups
- Configure SSL
- Use default credentials: admin@school.com / admin123
- Ensure seed script ran successfully
- Check JWT_SECRET in .env
- Verify database connection
- Ensure parents have registered in client app
- Check database for User records with isVerified=false
- Verify API endpoint is working
- Check if client app has created transactions
- Verify database connection
- Check browser console for API errors
- Ensure Prisma client is generated
- Deposits: Balance updates only after admin approval
- Refunds: Balance deducted immediately, restored if rejected
- Check transaction status in database
- Verify Prisma migrations are applied
- All API calls require admin JWT authentication
- Admin token stored in localStorage as 'adminToken'
- Sidebar shows pending device count badge
- Pagination: 12 items per page for transactions
- Student ID is auto-incrementing integer (max 5 digits)
- Faculty field replaces email for students
- Tailwind CSS loaded via CDN in index.html
- Login with default admin credentials
- View dashboard statistics
- Create new student
- Add grade to student
- Record attendance for student
- Create teacher
- Create class
- Verify parent device
- View pending transactions
- View proof document
- Approve deposit
- Reject refund
- Check balance updated correctly
The seed script (prisma/seed.js) creates:
- Default admin account (admin@school.com / admin123)
Run with: npx prisma db seed













