Welcome to the backend repository for Smart Attendance, a simple yet efficient attendance management system that leverages facial recognition technology for streamlined and secure attendance tracking.
- JWT Authentication: Secure access through JWT for all API routes.
- Role-based Authorization: Middleware to enforce specific roles, e.g., admin-only access.
- Facial Recognition Integration: Integrate with a facial recognition service for automated attendance tracking.
- Leave Management: Automatically track remaining leave days per account, with carryover policy.
- Clone the repository:
git clone https://github.com/username/smart-attendance-backend.git
- Install dependencies:
cd smart-attendance-backend npm install - Set up the database:
- Ensure MySQL is running with the following credentials:
- User:
root - Password: (no password)
- Host:
localhost - Database:
smart-att
- User:
- Run the following Prisma commands:
npx prisma db push
- Ensure MySQL is running with the following credentials:
Set up a .env file in the root directory with the following keys:
DATABASE_URL=mysql://root:@localhost:3306/smart-attStart the development server:
npm run devnpm run dev: Start the server in development mode withnodemonnpm run build: Build the project for productionnpm start: Start the server in production mode
The database is managed via Prisma ORM with key models:
- Account: User details and roles.
- Presence: Records attendance data.
- LeaveRequest: Tracks leave requests and approvals.
- Schedule: Manages user schedules and availability.
We welcome contributions! Please check out the Contributing Guidelines for more information.
This project is licensed under the MIT License.
