This application will be used to track when a staff clock in & out of the office. It is developed using the frontend and backend pattern. It requires a staff to login into the system to be able to clockin/clockout once day, view his/profile, update his/her profile, view list of all staff and logout
To run this project, you will need to add the following environment variables to your .env file
NODE_ENV = development
PORT
MONGODB_URI
JWT_SECRET
Clone the project
git clone https://github.com/wuyepabdul/releaf-clock-in-system
Go to the project directory
cd releaf-clock-in-system
Install dependencies
npm install
Go to the frontend directory inside releaf-clock-in-system directory
cd frontend
Install dependencies
npm install
Go to the root directory, that is, releaf-clock-in-system Start the application
npm run dev
Clone the project
git clone https://github.com/wuyepabdul/releaf-clock-in-system
Go to the project directory
cd releaf-clock-in-system
Install server-side dependencies
npm install
Go to the frontend directory inside releaf-clock-in-system directory
cd frontend
Install client-side dependencies
npm install
Go to root directory (releaf-clock-in-system) Start backend server
cd releaf-clock-in-system
npm start
Go to frontend directory (releaf-clock-in-system) Start client-server
cd releaf-clock-in-system/frontend
npm start
Go to the root directory, that is, releaf-clock-in-system Start the application (run both backend and frontend servers together)
cd releaf-clock-in-system
npm run dev
Client: React, Redux, Bootstrap, Material-ui
Server: Node, Express, Mongoose, MongoDB
- Create a staff
- Login a staff
- Clockin a staff
- Clockout a staff
- View staff profile
- Update a staff
- View list of all staff
- Logout
GET /api/staff/list
Parameter | Type | Description |
---|---|---|
token |
string |
Required. Staff token when loggedIn |
GET /api/staff/profile
Parameter | Type | Description |
---|---|---|
token |
string |
Required. Staff token when logged In |
POST /api/auth/register
Parameter | Type | Description |
---|---|---|
name,email,password,department |
string |
Required. Staff info to create record |
POST /api/auth/login
Parameter | Type | Description |
---|---|---|
email,password |
string |
Required. Staff info to login into the system |
PUT /api/staff/profile
Parameter | Type | Description |
---|---|---|
token,name |
string |
Required. staff login token and new name to updated |
PUT /api/staff/clockin
Parameter | Type | Description |
---|---|---|
staffId |
string |
Required. staffId used to clockin |
PUT /api/staff/clockout
Parameter | Type | Description |
---|---|---|
staffId |
string |
Required. staffId used to clockout |
Takes staff name and generates a staffID which is used to clockin/clockout.
Takes staff (mongodb id) to create a jwt token
middleware to check if staff is logged in
middlewares to validate form data
Visit the below link and experience the functionalities firsthand
https://relief-clockin-system.herokuapp.com/
To run tests, run the following command
cd releaf-clock-in-system
npm run test