/gates-hrms

:office: GATES Assessment 2 (1 Day Hackathon with specified UC for a Human Resource Management System)

Primary LanguagePHP

Gates HRMS CRUD Demo

🏢 GATES Assessment 2 (1 Day Hackathon with specified UC for a Human Resource Management System)


Synopsis

Simple mini-project with Laravel 5.2 built during the final assessment for my internship at GATES. It is basically a CRUD app that meets the minimal use case for a Human Resource Management System specified by the representative from MDEC with some fluff here and there to make it more interesting.

Project Page: sruban.me/gates-hrms

How to use

See DEV-LINUX.md for the self-reminder notes I made when testing this on my Linux box.

There are actually two different (and decoupled) projects in this repository. A placeholder portal site and the backend HRMS system. The portal site is merely a static template that was added to allow me to play around with subdomain routing. Nevertheless, each of them live in their own Views and Controllers folder while having access to shared resources like Auth etc.

To get started, you need to do some preliminary setup first to allow the subdomain routing to work locally.

Step 1. Append this to your hosts file

127.0.0.1 hrms.gates.localhost gates.localhost

Step 2. Add these to your Apache2 Virtual Hosts Configuration

<Directory path-to-www/gates-hrms>
  Options Indexes FollowSymLinks
  AllowOverride All
  Require all granted
</Directory>
<VirtualHost *:80>
    DocumentRoot path-to-www/gates-hrms
    ServerName hrms.gates.localhost
    ServerAlias hrms.gates.localhost
    ErrorLog "logs/hrms.gates.localhost-error.log"
    CustomLog "logs/hrms.gates.localhost-access.log" common
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot path-to-www/gates-hrms
    ServerName gates.localhost
    ServerAlias gates.localhost
    ErrorLog "logs/gates.localhost-error.log"
    CustomLog "logs/gates.localhost-access.log" common
</VirtualHost>

I replaced .dev with .localhost since Google has enabled HSTS for the .dev TLD (2018). I'd prefer .test since I've bound it with my Hotel instance but I couldn't get Laravel to recognise requests from the Hotel proxy. I'm probably missing something in terms of how Hotel is meant to work but Laravel router seems to still see the request as coming from localhost and returns 404 (PR welcome! :D)

Step 3. Business as usual

  1. Clone the repository && CD into it
  2. Rename .env.example to .env and fill in your database credentials
  3. Run composer install
  4. Run php artisan key:generate
  5. Run php artisan migrate --seed Import gates-hrms.sql

You can now access the site at hrms.gates.localhost in your browser

Available logins

Username Role Password
CHUA Staff password
THARIQ Supervisor password
RUBAN Admin password

Tools used

Notes

See DEV-HEROKU.md for the self-reminder notes I made when setting it up at Heroku.

License

MIT license