Code Monkey home page Code Monkey logo

visitorqr's Introduction

VisitorQR

Requirements

  1. Web server with PHP version ^8.1 support.

  2. PHP extensions: curl, exif, fileinfo, gd, intl, mbstring, mysqli, openssl, pdo_mysql, sodium, xsl

    I listed every extensions enabled on my development environment. I don't really know what extensions required for the packages installed ๐Ÿ˜†

  3. NodeJS version ^14.18.0.

  4. Composer version ^2.3.10

Project installation

  1. Download the release or clone this project inside your web server root folder. Make sure Virtualhost / Server block is configured correctly to point /public as document root.

  2. Copy .env.example file and rename it to .env.

  3. Create a new database and set the newly created database credentials inside .env file.

  4. Run these commands to compile the assets and install the project.

    composer compile-project

    php artisan install PASSWORD USER_NAME EMAIL_ADDRESS

Customizations

  1. You can replace the title of the system with your organization name by editing ORG_NAME inside .env file.

  2. You may replace the logo used for this system by replacing these files:

    • resources/img/logo/favicon.ico
    • resources/img/logo/logo.svg

    The image ratio is 1x1. Finish the logo replacement by running npm run build command to rebuild the assets.

Troubleshooting

File Permission Error

If you encountered an issue with file permission, make sure you change the owner and group of this system directory on your file system.

For NGINX running on Ubuntu, you can run these commands on this system directory assuming NGINX user and group is www-data:

  • sudo chown -R www-data:www-data *
  • sudo chown www-data:www-data .*

Deleting Visitors By Its Age

You can remove visitors that have a certain age (in seconds) after their addition to the system. You can do that by running the artisan deleteVisitorByAge command. Run php artisan help deleteVisitorByAge for more info.

To schedule deleteVisitorByAge command, you need to define it in app/Console/Kernel.php file's schedule method. For example:

protected function schedule(Schedule $schedule)
{
    $schedule->command('deleteVisitorByAge --days=3')
    ->daily()
    ->runInBackground();
}

This will schedule the deletion of visitors that are 3 days old every day at midnight.

To running the actual Laravel Scheduler, add a single cron entry to your server to run schedule:run command every minute.

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

Refer this article on how to add Cron entries in Linux.

Refer Laravel documentation for more info in task scheduling.

Logs

All logs of deleteVisitorByAge command are stored in storage/logs/deleteVisitorByAgeCommand.log file.

Copyright

Copyright (c) 2022 Muhammad Hanis Irfan Bin Mohd Zaid.

Licensed under the MIT license.

visitorqr's People

Contributors

hanisirfan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.