https://attendance-system.onrender.com
List of available routes:
Auth routes:
POST /login - login
User routes:
GET /users - get all users
PUT /users/:id - update user
Attendance routes:
GET /attendances - get all attendance
POST /attendances - create an attendance
PUT /attendances/:id - update attendance
GET /attendanceQRcode - get attendance QRcode
Holiday routes:
POST /holidays - create holiday
GET /holidays - get all holiday
-
Clone Project
git clone https://github.com/Will413028/Attendance-System-backend.git -
go to project folder
cd Attendance-System-backend -
setup Database with docker ( Prerequest : Docker) How to install Docker: Mac | Windows | Linux)
Option 1: MySQL
sudo docker run --restart always --name mysql-attendance-system -e MYSQL_DATABASE=attendance-system -e MYSQL_ROOT_PASSWORD=12345678 -p 3306:3306 -d mysql:5.7Option 2: MariaDB Since mysql 5.7 does not support M1 Mac, you can use mariadb (Don't need to change setting)
sudo docker run --restart always --name mysql-attendance-system -e MYSQL_DATABASE=attendance-system -e MYSQL_ROOT_PASSWORD=12345678 -p 3306:3306 -d mariadb -
Install Dependencies
npm install -
Setup .env file
Important: LATITUDE & LONGITUDE MUST change to your location otherwise clock_in can not pass position check or You can disable the ENABLE_GPS_CHECK in config.js
```
#.env example
PORT=3000
JWT_SECRET=JWT_SECRET
DB_USERNAME=root
DB_ROOT_PASSWORD=12345678
DB_DATABASE=attendance-system
DB_HOST=localhost
DB_PORT=3306
LATITUDE=
LONGITUDE=
```
- database migrate
npm run migrate - Init seed data
npm run seed - Run project
npm run start
1. Admin user
account: admin
password: tiadmin
2. Normal user
account: user1
password: titaner
account: user2
password: titaner
3. Locked user
account: user3
password: titaner
account: user4
password: titaner