Skip to content

davishkar/vms

Repository files navigation

Visitor Management System (VMS)

A comprehensive, web-based Visitor Management System designed to streamline the process of tracking visitors, managing entries, and enhancing security for offices, factories, and institutions.

🚀 Features

For Guards

  • Visitor Entry: Easy-to-use form to register new visitors (Name, Mobile, Purpose, Meet Person).
  • Photo Capture: Integrated camera support to capture visitor photos directly from the browser.
  • ID Document Upload: Support for uploading ID proofs (JPG, PNG, PDF).
  • Visitor Checkout: Simple interface to mark visitors as checked out.
  • Real-time Status: View current visitor status.

For HR / Admin

  • Dashboard: Overview of pending, approved, and rejected visitors.
  • Approval Workflow: Approve or reject visitor entries with reasons.
  • Pre-scheduling: Schedule visits in advance.
  • Visitor History: View complete logs of all past visits.
  • Export Data: Export visitor data to CSV for reporting.
  • Notification Management: Manage push notification subscriptions.

Technical & Security

  • SMS Notifications: Configurable SMS alerts (currently in Log mode for dev).
  • Push Notifications: Service Worker implementation for real-time alerts.
  • Secure File Handling: Unique filenames, validation, and storage outside the DB.
  • Responsive Design: Works on Desktop and Mobile devices.

🛠️ Technology Stack

  • Frontend: HTML5, CSS3, JavaScript (Vanilla), Service Workers
  • Backend: PHP (Native)
  • Database: MySQL
  • Server: Apache (via XAMPP/WAMP)

📋 Prerequisites

  • XAMPP (or WAMP/MAMP) installed.
  • Web Browser with camera permissions allowed (Chrome/Edge recommended).

⚙️ Installation & Setup

1. Project Setup

  1. Navigate to your XAMPP htdocs directory (e.g., C:\xampp\htdocs).
  2. Create a folder named vms.
  3. Copy all project files into C:\xampp\htdocs\vms.

2. Database Configuration

  1. Open phpMyAdmin (http://localhost/phpmyadmin).
  2. Create a new database named visitor_management (or simply import the SQL file which handles this).
  3. Import the database.sql file located in the project root.
    • Click Import tab.
    • Choose File -> database.sql.
    • Click Go.
  4. (Optional) Run migration_add_photos.sql if you are upgrading or if database.sql does not include photo columns (check the file content).

3. Database Connection

Verify the settings in includes/db_connect.php:

$host = 'localhost';
$db   = 'visitor_management';
$user = 'root';
$pass = ''; // Default XAMPP password

4. Create Upload Directories

Ensure the following directories exist and have write permissions:

  • uploads/photos/
  • uploads/documents/

🖥️ Usage

Guard Portal

  • URL: http://localhost/vms/guard/entry.html
  • Login: guard1 / password (if auth is enabled for this page)
  • Action: Fill details, take photo, and submit.

HR / Admin Portal

  • URL: http://localhost/vms/hr/login.html
  • Login:
    • Username: admin
    • Password: password
  • Action: View dashboard, approve/reject requests, view history.

📂 Directory Structure

vms/
├── api/                  # PHP API endpoints (CRUD operations)
├── guard/                # Guard interface (Entry form, index)
├── hr/                   # HR/Admin interface (Dashboard, Login)
├── includes/             # Shared PHP files (DB connect, functions)
├── uploads/              # Stored visitor photos and documents
├── database.sql          # Main database schema
├── sw.js                 # Service Worker for notifications
└── index.php             # Main entry point (redirects/landing)

⚠️ Troubleshooting

  • Camera not working: Ensure you are accessing via localhost or https. Browsers block camera access on insecure http connections (except localhost).
  • File Upload Error: Check if uploads/ folder exists and has write permissions.
  • Database Connection Error: Verify credentials in includes/db_connect.php.
  • Notifications not appearing: Ensure you have clicked "Subscribe to Notifications" and allowed browser permissions.

📝 License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors