This is the client-facing application for parents and students to manage their school activities, including fee payments, viewing grades, attendance, and timetables.
- Authentication: Secure registration and login with SHA-512 password hashing
- Device Verification: Each device must be verified by admin before access
- Fee Management: Deposit fees and request refunds
- Academic Records: View grades, attendance, and class timetables
- Dashboard: Overview of fee balance, recent transactions, and academic performance
- Low Balance Alerts: Visual warnings when fee balance is low
- Node.js & Express.js
- MongoDB with Mongoose
- 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
- Responsive design
client-app/
├── backend/
│ ├── src/
│ │ ├── config/ # Database configuration
│ │ ├── controllers/ # Request handlers
│ │ ├── dtos/ # Data transfer objects
│ │ ├── middlewares/ # Auth, validation, etc.
│ │ ├── models/ # MongoDB schemas
│ │ ├── routes/ # API routes
│ │ ├── services/ # Business logic
│ │ ├── utils/ # Helper functions
│ │ └── server.js # Entry point
│ ├── package.json
│ └── .env.example
├── frontend/
│ ├── src/
│ │ ├── components/ # Reusable components
│ │ ├── pages/ # Page components
│ │ ├── services/ # API services
│ │ ├── styles/ # CSS files
│ │ ├── utils/ # Helper functions
│ │ ├── App.jsx # Main app component
│ │ └── main.jsx # Entry point
│ ├── package.json
│ └── vite.config.js
└── README.md
- Node.js (v16 or higher)
- Postgresql
- npm or yarn
-
Navigate to backend directory:
cd backend -
Install dependencies:
npm install
-
Create
.envfile from example:copy .env.example .env
-
Update
.envwith your configuration:PORT=5000 MONGODB_URI=mongodb://localhost:27017/school_client JWT_SECRET=your_secure_jwt_secret_key NODE_ENV=development -
Start MongoDB service
-
Run the backend:
npm run dev
Backend will run on http://localhost:5000
-
Navigate to frontend directory:
cd frontend -
Install dependencies:
npm install
-
Start the development server:
npm run dev
Frontend will run on http://localhost:3000
POST /api/auth/register- Register new userPOST /api/auth/login- Login userPOST /api/auth/logout- Logout user
POST /api/fee/deposit- Make fee paymentPOST /api/fee/withdraw- Request refundGET /api/fee/balance/:studentId- Get fee balanceGET /api/fee/history/:studentId- Get transaction history
GET /api/student/:studentId/profile- Get student profileGET /api/student/:studentId/grades- Get gradesGET /api/student/:studentId/attendance- Get attendanceGET /api/student/:studentId/timetable- Get class timetable
- SHA-512 password hashing
- JWT token authentication
- Device ID verification
- Rate limiting (100 requests per 15 minutes)
- Helmet security headers
- Input validation and sanitization
- CORS protection
- User registers with name, email, password, and role (student/parent)
- Device ID is automatically generated and stored
- Account is created but not verified
- User must wait for admin verification
- User enters email, password
- System checks device ID matches registered device
- System verifies account is approved by admin
- JWT token is issued for authenticated sessions

- Navigate to Fee Payment page
- Select transaction type (Deposit/Withdraw)
- Enter amount and optional description
- Submit transaction
- Balance is updated immediately for deposits
- Withdrawals are marked as pending for admin approval
- Dashboard shows overview of grades and attendance
- Click on specific sections for detailed views
- Timetable shows class schedule
- All API calls require authentication except registration and login
- Device verification is mandatory for login
- Sessions are managed via JWT tokens
- Frontend uses localStorage for token persistence
- Low balance threshold is set at $1000
To test the application:
- Register a new account
- Use admin panel to verify the device
- Login with verified account
- Test fee deposit/withdraw
- View academic records
- Set
NODE_ENV=productionin.env - Use strong JWT secret
- Configure MongoDB with authentication
- Build frontend:
npm run build - Serve frontend build with a web server
- Use process manager (PM2) for backend
- Set up reverse proxy (nginx)
- Enable HTTPS
- Cannot login: Ensure device is verified by admin
- API errors: Check backend is running and MongoDB is connected
- CORS errors: Verify backend CORS configuration
- Token expired: Login again to get new token




