iSecureVMS
September 15, 2024
Web

iSecureVMS

iSecureVMS streamlines visitor and contractor management with a secure, user-friendly platform available on both web and mobile. It enhances workplace safety and efficiency through digital workflows and real-time monitoring.

Laravel PHPMySQLBootstrap 4jQueryFlutter (Mobile App)

Overview

iSecureVMS is a modern visitor management system designed for offices, factories, and secure facilities. It replaces manual logbooks with digital pre-registration, QR-based check-in/out, real-time notifications, and customizable reports. The system supports both visitor and contractor flows, integrates with access control devices, and provides mobile app functionality for seamless on-site operations. With a multi-tenant setup, each client has isolated data security while sharing a single, easily maintainable codebase.

Key Achievements

  • Deployed across 20+ client facilities with thousands of monthly visitor check-ins
  • Reduced lobby congestion by 50% using QR code–based fast check-in/out
  • Automated email and SMS notifications, improving visitor communication efficiency
  • Enhanced compliance by digitizing visitor logs and enabling customizable reporting

iSecureVMS : Visitor Management Software

About Laravel

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:

  • Simple, fast routing engine.
  • Powerful dependency injection container.
  • Multiple back-ends for session and cache storage.
  • Expressive, intuitive database ORM.
  • Database agnostic schema migrations.
  • Robust background job processing.
  • Real-time event broadcasting.
  • Laravel is accessible, powerful, and provides tools required for large, robust applications.

    Learning Laravel

    Laravel has the most extensive and thorough documentation and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.

    If you don't feel like reading, Laracasts can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.

    Server Requirements

    The Laravel framework has a few system requirements. You should ensure that your web server has the following minimum PHP version and extensions:

  • PHP >= 8.1
  • Ctype PHP Extension
  • cURL PHP Extension
  • DOM PHP Extension
  • Fileinfo PHP Extension
  • Filter PHP Extension
  • Hash PHP Extension
  • Mbstring PHP Extension
  • OpenSSL PHP Extension
  • PCRE PHP Extension
  • PDO PHP Extension
  • Session PHP Extension
  • Tokenizer PHP Extension
  • XML PHP Extension
  • Additionally, I want to add the zip and unzip extensions Composer will use when downloading my dependencies, and the MySQL PHP extension since that’s the database type I’m using in my application.

    I can accomplish this using apt, a command line utility for managing packages on Linux systems.

    First - I’ll specify a new repository apt can download software packages from. The repository we’re adding is ppa:ondrej/php, the primary source for PHP-related packages.

    bash
    sudo add-apt-repository ppa:ondrej/php
    
    sudo apt update
    

    Finally, we can get the necessary extensions. In my case, the command to do that looks like the following.

    bash
    sudo apt install php-fpm php-mysql php-mbstring unzip php-json php-bcmath php-zip php-gd php-tokenizer php-xml
    

    Get dependencies

    Next, we need to pull in the application’s Composer dependencies (i.e. our vendor/ directory).

    If working on a production server, use the following command so any development-specific dependencies are excluded and the version number of your dependencies match whatever was used in development and written to composer.lock:

    bash
    composer install --optimize-autoloader --no-dev
    
    composer update
    

    Build .env file

    Every Laravel application needs a .env file with environment-specific configurations. Because the contents of this file are going to differ from environment to environment, it is not tracked as part of your version control repository (it’s ignored via the .gitignore config file) and therefor you have to manually create it whenever setting up the application in a new environment.

    To do this, you can copy the provided .env.example file and update to as appropriate:

    bash
    cp .env.example .env
    

    Run the following command to generate the APP_KEY value within your .env file:

    bash
    php artisan key:generate
    

    Set permissions

    There are two directories within a Laravel application that need to be writable by the server: storage and bootstrap/cache. Within these directories, the server will write application-specific files such as cache info, session data, error logs, etc.

    To allow this to happen, you need to update the permissions of storage and bootstrap/cache so they are owned by the system user your web server is running as.

    Run the following command to see which user your Nginx web server runs as:

    bash
    chown -R www-data:www-data .
    
    chown -R www-data storage
    chown -R www-data bootstrap/cache
    
    chmod -R 775 storage
    chmod -R 775 storage/*
    

    Server Configuration (Nginx) on Ubuntu Server

    At this point, everything is set up within our application, we just need to configure our server to run it.

    Within /etc/nginx/sites-available/ create a new file with the following content (ref: Nginx deployment guide on offical website). You can call the file whatever you want; I’ll name mine demo after the name of the app.

    Within the content update the following:

  • server_name should point to the domain (or subdomain) you’re using for this application
  • root should point to the path of your Laravel application’s public directory
  • The reference to php8.2-fpm.sock should match whatever version of PHP your server is running
  • bash
        server {
            listen 80;
            listen [::]:80;
            server_name example.com;
            root /srv/example.com/public;
    
            access_log /var/log/nginx/example.com.access.log;
            error_log /var/log/nginx/example.com.error.log;
    
            add_header X-Frame-Options "SAMEORIGIN";
            add_header X-Content-Type-Options "nosniff";
    
            index index.php;
    
            charset utf-8;
    
            location / {
                try_files $uri $uri/ /index.php?$query_string;
            }
    
            location = /favicon.ico { access_log off; log_not_found off; }
            location = /robots.txt  { access_log off; log_not_found off; }
    
            error_page 404 /index.php;
    
            location ~ .php$ {
                fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
                fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
                include fastcgi_params;
            }
    
            location ~ /.(?!well-known).* {
                deny all;
            }
        }
    

    Next, to enable this config we need to symbolically link the file to the /etc/nginx/sites-enabled directory.

    To do this, run the following command, replacing demo with the name of the file you created:

    bash
    sudo ln -s /etc/nginx/sites-available/demo /etc/nginx/sites-enabled
    
    sudo nginx -t
    

    Expected output:

    bash
    nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
    nginx: configuration file /etc/nginx/nginx.conf test is successful
    

    If all looks good, restart Nginx to make the changes take effect:

    bash
    systemctl restart nginx
    

    To Install Certbot

    bash
    sudo apt install python3-certbot-nginx
    
    sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
    

    After you execute this command there will be a couple of entries that you will need to fill, such as the email address, agreement about the terms and conditions, if you want to share your email adress or not, and the redirect options.

    bash
    root@vps:~# sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
    Saving debug log to /var/log/letsencrypt/letsencrypt.log
    Plugins selected: Authenticator nginx, Installer nginx
    Enter email address (used for urgent renewal and security notices) (Enter 'c' to
    cancel): admin@yourdomain.com
    
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Please read the Terms of Service at
    https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
    agree in order to register with the ACME server at
    https://acme-v02.api.letsencrypt.org/directory
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    (Y)yes/(N)no: Y
    
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Would you be willing to share your email address with the Electronic Frontier
    Foundation, a founding partner of the Let's Encrypt project and the non-profit
    organization that develops Certbot? We'd like to send you email about our work
    encrypting the web, EFF news, campaigns, and ways to support digital freedom.
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    (Y)es/(N)o: N
    Obtaining a new certificate
    Performing the following challenges:
    http-01 challenge for yourdomain.com
    http-01 challenge for www.yourdomain.com
    Waiting for verification...
    Cleaning up challenges
    Deploying Certificate to VirtualHost /etc/nginx/sites-available/yourdomain.com
    

    If everything is set up as should be the certificate will be installed and you will receive the message below.

    bash
    Congratulations! You have successfully enabled https://yourdomain.com and https://www.yourdomain.com
    
    You should test your configuration at:
    https://www.ssllabs.com/ssltest/analyze.html?d=yourdomain.com
    https://www.ssllabs.com/ssltest/analyze.html?d=www.yourdomain.com
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    
    IMPORTANT NOTES:
     - Congratulations! Your certificate and chain have been saved at:
       /etc/letsencrypt/live/yourdomain.com/fullchain.pem
       Your key file has been saved at:
       /etc/letsencrypt/live/yourdomain.com/privkey.pem
       Your cert will expire on 2022-05-07. To obtain a new or tweaked
       version of this certificate in the future, simply run certbot again
       with the "certonly" option. To non-interactively renew *all* of
       your certificates, run "certbot renew"
     - Your account credentials have been saved in your Certbot
       configuration directory at /etc/letsencrypt. You should make a
       secure backup of this folder now. This configuration directory will
       also contain certificates and private keys obtained by Certbot so
       making regular backups of this folder is ideal.
     - If you like Certbot, please consider supporting our work by:
    
       Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
       Donating to EFF:                    https://eff.org/donate-le
    

    MySql Mariadb Database Configuration

    To install mariaDB, first run the following command to update the package index on your server:

    bash
    sudo apt update
    

    Then, run the following command to install:

    bash
    sudo apt install mariadb-server
    

    you can start the database service by run the following command:

    bash
    systemctl start mysql
    

    To secure your installation, after installation, it's suggested you secure your installation with the following command:

    bash
    sudo mysql_secure_installation
    

    Here are a summary of responses for each prompt it presents you with:

  • when it asks Enter current Password for root (enter for none):leave it blank and hit enter
  • when it asks you if you want to...
  • Change the root password?, enter No.
  • Remove anonymous users?, enter Yes.
  • Disallow root login remotely?, enter Yes.
  • Remove test database and access to it?, enter Yes.
  • Reload previlege tables now?, enter Yes.
  • New User in Mysql database

    Run the following command to create new user for mysql database:

    bash
    sudo mysql -u root
    
    CREATE USER 'your-username-here'@'localhost' IDENTIFIED BY 'your-password-here';
    

    Next, we need to grant the username privileges to manage the database:

    bash
    GRANT ALL PRIVILEGES ON your-database-name-here . * TO 'your-username-here'@'localhost';
    

    Sathishkumar Ranganathan

    Full-stack Software Developer passionate about creating scalable web applications and smart systems with React.js, Next.js, PHP, and Flutter.

    Connect

    Keyboard Shortcuts

    K
    Search
    T
    Toggle theme
    2026 Sathishkumar Ranganathan. All rights reserved.
    Built withusing Next.js & Tailwind
    Sathishkumar Ranganathan | Portfolio