This is a full-stack application for an attendance marking system built with Node.js, React, and PostgreSQL. It utilizes the face-api.js library for face recognition-based attendance marking, making it a useful sample project for anyone looking to implement similar functionality.
Live at https://attendance-iitgoa.vercel.app
Before running the application, ensure you have the following installed:
- Node.js (
v20.0.0
and above) - npm (Node Package Manager)
- PostgreSQL (version 9.6 or later)
Follow these steps to run the application locally:
-
Clone the repository
git clone https://github.com/pranavtodkar/attendance-marking-system.git cd attendance-marking-system
-
Install dependencies Install dependencies for both backend and frontend:
cd frontend npm install cd ../backend npm install
-
Generate Google Auth CLIENT_ID (or ask the Repo Owner) Follow steps from https://blog.logrocket.com/guide-adding-google-login-react-app to get your Google Auth running.
-
Create a .env file
In thebackend
folder, create a new .env file and add the following environment variables:SECRET_KEY="your_secret_key" POSTGRES_URL="your_postgres_host_url"
In the
frontend
folder, create a new .env file and add the following environment variables:REACT_APP_BACKEND_URL = "your_backend_url" REACT_APP_GAUTH_CLIENT_ID = "your_google_console_auth_client_id"
Replace your_secret_key with a secure secret key for JSON Web Token (JWT) signing, your_postgres_host_url with a PostgreSQL database host URL, your_backend_url with backend URL and your_google_console_auth_client_id with Client ID from Google cloud console.
-
Create a PostgreSQL database Create a new PostgreSQL database named attendance-marking
-
Create tables Use the SQL script
database/Tables CREATE.sql
to create the necessary tables -
Insert dummy data To populate the database with some dummy data for start, use the SQL script
database/Tables INSERT test data.sql
-
Start the backend server In the backend folder, start the server:
cd backend npm run dev
-
Start the frontend development server In a new terminal window, navigate to the frontend folder and start the development server:
cd frontend npm start
The application should now be running at http://localhost:3000.
Congratulations! You have successfully set up and run the Attendance Marking System application locally.