Hệ thống quản lý sinh viên và điểm danh với công nghệ hiện đại, hỗ trợ điểm danh QR code có xác minh GPS và thiết bị.
- Runtime: Node.js + Express.js
- Language: TypeScript
- Database: PostgreSQL + Prisma ORM
- Authentication: JWT + RBAC (Role-Based Access Control)
- Security: bcrypt, helmet, express-rate-limit
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Styling: TailwindCSS + shadcn/ui
- PWA: Service Worker + Manifest
- Đăng ký/đăng nhập với xác thực email
- JWT tokens với refresh mechanism
- 2FA với TOTP (Google Authenticator)
- Phân quyền RBAC: Admin, Teacher, Student
- Ràng buộc thiết bị qua deviceId
- QR code có thời hạn (3-5 phút)
- Xác minh GPS location (radius control)
- Chống gian lận điểm danh hộ
- Tự động gửi email nhắc nhở
- CRUD classes và enrollments
- Import/Export danh sách từ Excel
- Thống kê điểm danh theo lớp
- Dashboard cho từng vai trò
student-management-system/
├── backend/ # API Server (Node.js + Express)
│ ├── prisma/ # Database schema
│ ├── src/
│ │ ├── controllers/ # Route handlers
│ │ ├── middleware/ # Auth, validation, etc.
│ │ ├── routes/ # API routes
│ │ ├── services/ # Business logic
│ │ ├── types/ # TypeScript types
│ │ └── utils/ # Helper functions
│ └── package.json
├── frontend/ # Client App (Next.js)
└── docs/ # Documentation
├── api-spec.md # API documentation
└── detailed-design/ # Feature specifications
- Node.js 18+
- PostgreSQL
- Git
cd backend
npm install
npx prisma generate
npm run devServer sẽ chạy tại: http://localhost:3001
Copy .env.example thành .env và cấu hình:
DATABASE_URL="postgresql://user:password@localhost:5432/dbname"
JWT_SECRET="your-super-secret-key"POST /api/auth/register- Đăng ký tài khoảnPOST /api/auth/login- Đăng nhậpPOST /api/auth/verify-email- Xác thực email
POST /api/attendance/create-session- Tạo buổi điểm danh (Teacher)POST /api/attendance/check-in- Điểm danh (Student)GET /api/attendance/session/:id- Thông tin buổi học
GET /api/classes- Danh sách lớp họcPOST /api/classes/:id/import- Import danh sách từ ExcelGET /api/classes/:id/export- Export báo cáo Excel
npm run dev # Development server
npm run build # Build cho production
npm run db:migrate # Chạy database migrations
npm run db:studio # Mở Prisma Studio
npm test # Chạy tests- Fork repository
- Tạo feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Tạo Pull Request
This project is licensed under the ISC License.
Developed with ❤️ by TQD-Tech Team