Hired is an open-source PHP Jobs Portal. This is not a “we have all sorts of features that you will never use” kind of project. This is a simple portal with the basic features, so you can customize and build on top of it quickly.
TABLE OF CONTENTS
DOWNLOAD & NOTES
First, here are the download links and a quick “setup guide” for the impatient folks who don’t have the patience to read through everything.
REQUIREMENTS
- Apache Mod Rewrite
- PHP MYSQL PDO Extension
- Best to have at least PHP 8.0
- “Grade A” browser
Hired has not been extensively tested, but it is developed and works on a WAMP8 (Windows Apache MySQL PHP 8) server.
INSTALLATION
Just access index.php
in your browser and walk through the installer.
LICENSE & DOWNLOAD
Hired is released under the MIT License. You are free to use it for your own personal and commercial projects, modify it as you see fit. On the condition that there the software is provided “as-is”. There are no warranties provided and “no strings attached”. Code Boxx and the authors are not liable for any claims, damages, or liabilities.
Download Hired | GitHub | SourceForge
HOW TO USE
So far so good? Let us now go through a quick crash course on how to use Hired.
STEP 1) REGISTER COMPANIES
Self-explanatory step 1, register all the companies.
STEP 2) REGISTER JOBS
Next, register the jobs under the “Jobs” section. The end… Yep, it’s that simple for the time being. Until I have more time and motivation to add more features to it.
QUICK REFERENCE
This section is for the developers, a quick walkthrough of the general system structures.
FOLDER STRUCTURE
api/
The API endpoint.assets/
Public images, Javascript, CSS, etc…lib/
Core engine and library files.pages/
HTML pages.
Yes, there are only 4 folders in the entire system.
DATABASE TABLES
Field | Description |
company_id | The company ID, primary key, auto-increment. |
company_slug | URL slug, unique. |
company_name | Name of the company. |
company_desc | Company description. |
Field | Description |
job_id | Job ID, primary key and auto-increment. |
company_id | Company ID, foreign key. |
job_title | Title of the job. |
job_desc | A short description of the job. |
job_status | For now – 1 for active, 0 for “deleted” or “not available”. |
Field | Description |
user_id | User ID. Primary and foreign key, the user who made the request. |
reset_hash | Security hash. |
reset_time | Time when the request is made. |
Field | Description |
user_id | User ID, primary key and auto-increment. |
user_name | The user’s name. |
user_email | User’s email, unique to prevent duplicate registrations. |
user_role | The user’s role. “A”dmin or “U”ser. |
user_password | User’s password. |
Field | Description |
option_name | Primary key. |
option_description | Setting description. |
option_value | Setting value. |
option_group | Setting group number. |
THE FRAMEWORKS
I Was Here is built with Bootstrap and Core Boxx. Believe it or not, the initial version is built within 48 man-hours using:
Go ahead and check those out if you want… The other “pre-developed” modules of Core Boxx should also snap right in.
DEVELOPING “HIRED”
As simple as it may be, going through the entire system is still going to take some time. So instead of “explaining line-by-line”, here is a condensed version of “how to quickly customize and upgrade”.
STEP 1) CREATE/MODIFY DATABASE TABLES
Add your new tables or views, modify the existing ones.
STEP 2) ADD/UPDATE SYSTEM MODULE
class Report extends Core {
function getJobs ($id) {
return $this->DB->fetchAll(
"SELECT * FROM `jobs` WHERE `company_id`=? ORDER BY `job_id` DESC",
[$id]
);
}
}
To add a new module, create lib/LIB-Module.php
. Define class Module extends Core
, and add functions inside. In this example, we add a new report module – lib/LIB-Report.php
and class Report extends Core
. That’s all. This new module can now be loaded via $_CORE->load("Report")
and the function can be accessed via $_CORE->Report->getJobs()
.
STEP 3) ADD/UPDATE API ENDPOINT (OPTIONAL)
// (A) ADMIN ONLY
if (!isset($_SESS["user"]) || $_SESS["user"]["user_role"]!="A") {
$_CORE->respond(0, "Please sign in first", null, null, 403);
}
switch ($_REQ) {
// (B) INVALID REQUEST
default:
$_CORE->respond(0, "Invalid request", null, null, 400);
break;
// (B) GET JOBS
case "getJobs":
$_CORE->autoGETAPI("Reports", "getJobs");
break;
}}
Create api/API-Module.php
. For this example, send $_POST["id"]=123
to http://site.com/Report/getJobs/
to get the jobs report – The API will reply with a JSON encoded string.
STEP 4) ADD/UPDATE HTML CSS JAVASCRIPT
- Add your new pages in
pages/
.- For admin pages, add
pages/ADM-name.php
. - For user pages, add
pages/PAGE-name.php
. - For example,
pages/ADM-report.php
can only be accessed by administrators fromhttp://site.com/admin/report
.
- For admin pages, add
That’s about it. Just reverse engineer and copy from the existing libraries, API, and pages… You will see the development pattern here.
COMMON PROBLEMS & FIXING THEM
I-Was-Here is “not working”? Here are a few of the common problems and how to “fix” them.
I FORGOT THE PASSWORD OR DELETED ALL ADMIN ACCOUNTS
require "lib/CORE-go.php";
$_CORE->load("Users");
$_CORE->Users->save("NAME", "EMAIL", "A", "PASSWORD", OPTIONAL-USER-ID);
Just create an “account recovery” script to create a new account (or update an existing one). Run and delete this afterward.
MIGRATED TO A NEW DOMAIN
- Simply update
HOST_BASE
inlib/CORE-config.php
. - Run
$_CORE->Route->init()
to regenerate the.htaccess
andapi/.htaccess
files. - Clear the browser cache to prevent irritating cache redirects.
UPGRADING
Just override all the files and access index.php
. The installer will take care of database updates (if any).
MANUAL INSTALLATION
- Create a database and import
lib/SQL-hired.sql
. - Open
lib/CORE-config.php
, update the settings to your own.- The host settings.
- Database settings.
- If you want to develop mobile apps, consider enabling CORS.
- Generate your own JWT secret key, set the issuer to your domain or company name.
- Set the email “sent from”.
- Run
$_CORE->Route->init()
to create.htaccess
andapi/.htaccess
. - Create your own admin user. See “forgot password” above.
- Rename
lib/INSTALL-index.foo
toindex.php
.
NOT WORKING. DON’T KNOW WHY.
Open the developer’s console, reload the page and see the error message.