This is a web application that tracks attendance based on user location using React, Node.js, OpenStreetMap, and MongoDB.
- Real-time location tracking
- Visual map representation using OpenStreetMap
- Automatic attendance marking when within office premises
- MongoDB database for attendance records
- Node.js (v14 or higher)
- MongoDB installed and running locally
- Modern web browser with geolocation support
-
Clone the repository
-
Install dependencies:
npm install cd client && npm install cd ../server && npm install
-
Configure office location:
- Open
server/server.js - Update the
officeLocationobject with your office's coordinates:const officeLocation = { latitude: YOUR_OFFICE_LATITUDE, longitude: YOUR_OFFICE_LONGITUDE, radius: RADIUS_IN_METERS };
- Open
-
Start the application:
# Start MongoDB (if not already running) mongod # In the root directory npm run dev
-
Open your browser and navigate to
http://localhost:3000
- The application requests your location when you visit the website
- Your position is displayed on the map along with the office premises
- If you are within the specified office radius, your attendance will be marked
- The attendance status is displayed on the screen
- Frontend: React, React-Leaflet
- Backend: Node.js, Express
- Database: MongoDB
- Map: OpenStreetMap