From a6ff5db126f29f2b26161f6df40261e84c58cf3a Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 3 Apr 2021 17:13:55 +0300 Subject: Added setup and a bit of project information to README --- README.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 641416b..cdb43fd 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,31 @@ # devrix-job-board -The repository for my solution of DevriX's exam for their internship program + +The repository for my solution of DevriX's exam for their internship program. + +It's an oversimplified job offer website, (roughly) following the MVC design pattern and using the LAMP stack (with MySQL). + +## Contents +- [Getting started](#Getting%20started) +- [Tools](#Tools) + +## Getting started + +1. As previously mentioned, the project uses the LAMP stack. Links on setting it up: [Ubuntu 20.04](https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-20-04), [Debian 8](https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-debian-8) or [CentOS 8](https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mariadb-php-lamp-stack-on-centos-8). + +2. Currently this repo provides an Apache configuration file (`configs/devrix-job-board.conf`) with the localhost domain `djb.local`. + - To use that domain, you'll also need to open your `/etc/hosts` file and add on a new line line `127.0.0.1 djb.local`, but **be wary**, it will break any other localhost domains you've setup. + - If you wanna use it in a server-hosted environment, update the values of `ServerName` and `ServerAlias` with your desired domain and subdomain. + +3. Finally, we'll need to move the source code to the `/var/www/devrix-job-board/` folder. + - This (and creating the folder if it doesn't exist) can be done automatically, just run with sudo the `move-to-www.sh`: + ``` + sudo ./tools/move-to-www.sh + ``` + +## Tools + +This repo contains some tools that could be useful during setup and development of the app. They're all located in the `tools` folder. + +1. `move-to-www.sh` - moves the source code (located in `src`) to the `/var/www/devrix-job-board/` folder +2. `watch-move-to-www.sh` - does the same thing as `move-to-www.sh`, but does it automatically every time you update a file inside the `src` folder. Especially useful while developing the application. + - Dependencies: [`inotify-tools`](https://pkgs.org/download/inotify-tools) -- cgit v1.3.1-26-gb76a From efdeffeba81ba473dbd38aa5466590e306bffdb3 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 3 Apr 2021 17:52:02 +0300 Subject: Added a lot more information about the project and it's future in the README --- README.md | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 3 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index cdb43fd..a06819e 100644 --- a/README.md +++ b/README.md @@ -4,24 +4,57 @@ The repository for my solution of DevriX's exam for their internship program. It's an oversimplified job offer website, (roughly) following the MVC design pattern and using the LAMP stack (with MySQL). +**CREDENTIALS FOR DASHBOARD** +``` +Username: admin +Password: admin +``` + ## Contents - [Getting started](#Getting%20started) +- [Structure](#Structure) - [Tools](#Tools) +- [Issues and Future](#Issues%20and%20Future) ## Getting started 1. As previously mentioned, the project uses the LAMP stack. Links on setting it up: [Ubuntu 20.04](https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-20-04), [Debian 8](https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-debian-8) or [CentOS 8](https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mariadb-php-lamp-stack-on-centos-8). -2. Currently this repo provides an Apache configuration file (`configs/devrix-job-board.conf`) with the localhost domain `djb.local`. - - To use that domain, you'll also need to open your `/etc/hosts` file and add on a new line line `127.0.0.1 djb.local`, but **be wary**, it will break any other localhost domains you've setup. +2. You'll need to update the source code with your `MySQL` credentials. In the file `src/models/DB.php`, on lines 6 to 9 you'll find the connection information. You'll need to change the values of `$username` and `$password` with your own. + - If you're connecting to a remote database or have your database at a non-standart port, you'll also need to change `$servername`. Changing the value of `$dbname` is completely up to preference. + - Don't worry if the database doesn't exist, when the app starts it automatically creates the database and tables if they don't exist. + +3. Currently this repo provides an Apache configuration file (`configs/devrix-job-board.conf`) with the localhost domain `djb.local`. + - To use that domain, you'll also need to open your `/etc/hosts` file and add, on a new line, `127.0.0.1 djb.local`. **Be ware**, it will break any other localhost domains you've setup. - If you wanna use it in a server-hosted environment, update the values of `ServerName` and `ServerAlias` with your desired domain and subdomain. -3. Finally, we'll need to move the source code to the `/var/www/devrix-job-board/` folder. +4. Finally, we'll need to move the source code to the `/var/www/devrix-job-board/` folder. - This (and creating the folder if it doesn't exist) can be done automatically, just run with sudo the `move-to-www.sh`: ``` sudo ./tools/move-to-www.sh ``` +## Structure + +This section serves pretty much as a small documentatino of the overall project. + +### Back-end + +For the back-end, it uses pure PHP, without any libraries what so ever. Database access is done with automatically generated queries (see [`DB.php`](https://github.com/Syndamia/devrix-job-board/blob/main/src/models/DB.php)) and URI routing is done, using the `$_SERVER`'s request URI (see [index.php, Line 44](https://github.com/Syndamia/devrix-job-board/blob/67bc860ea4b3db5033a42038ab86d0df955c9295/src/index.php#L44)). + +The database has two tables: `companies` and `job_offers`. Inside `companies` is stored the different company name. `job_offers` contains the actual job offers, where the company is referenced with a foreign key to the `comapnies` table. + +### Front-end + +The front-end is a modified version of the given [template](https://github.com/xavortm/html-template-jobs). I took the CSS and the structure of the HTML files and applied it as closely to the original as I can. + +There are also a few custom stylings I had to make, all located in [`prog.css`](https://github.com/Syndamia/devrix-job-board/blob/main/src/css/prog.css). These are mainly: +- a navigation bar +- form and input styling +- pages that have only a form inside them (for example, the [`create offer`](https://github.com/Syndamia/devrix-job-board/blob/main/src/views/create-offer.php) page) + +**Note**: on the landing page, job offers have a picture to the right side of them. This is by design, since the template originally had them and without them, the job offers look weird/bad. There is no functinality behind them, they're static and purely aesthetical. + ## Tools This repo contains some tools that could be useful during setup and development of the app. They're all located in the `tools` folder. @@ -29,3 +62,17 @@ This repo contains some tools that could be useful during setup and development 1. `move-to-www.sh` - moves the source code (located in `src`) to the `/var/www/devrix-job-board/` folder 2. `watch-move-to-www.sh` - does the same thing as `move-to-www.sh`, but does it automatically every time you update a file inside the `src` folder. Especially useful while developing the application. - Dependencies: [`inotify-tools`](https://pkgs.org/download/inotify-tools) + +## Issues and Future + +The project has the following issues, that the original task description didn't explicitly require to be fixed, but might be a good idea to explore: +- There is no "404 Not-found" page +- There is no system for user accounts (and by extension, no system for accepting/signing up to job offers) +- There is no job offer page (a page for viewing a job offer; currently it only makes sense for sharing, as the landing page shows all job offer information) +- There is no way to practical way to change the Dashboard page credentials or add multiple ones (e.g. they're hard coded) + +These are the following things that might be a good idea to explore, post exam evaluation: +- Actually using proper tools for the job (using an ORM for database queries, using a more fleshed out routing plugin, etc.) +- Adding search functionalities (by words and by tags, like company, date, salary, etc.) +- Either adding more info to job offers or updating the styling to better fit the current job offers +- Have a proper way to add and remove companies -- cgit v1.3.1-26-gb76a From 434fc21aac69e50634ce69a6131b0b9829cb3d26 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 3 Apr 2021 17:57:15 +0300 Subject: Fixed readme contents not having the back and front end sub section --- README.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index a06819e..eb9cf60 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ Password: admin ## Contents - [Getting started](#Getting%20started) - [Structure](#Structure) + - [Back-end](#Back-end) + - [Front-end](#Front-end) - [Tools](#Tools) - [Issues and Future](#Issues%20and%20Future) -- cgit v1.3.1-26-gb76a From cdffdc8bf0c52806b830ca796c49a6ffc1ab8e73 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 3 Apr 2021 18:00:08 +0300 Subject: Fixed wording in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index eb9cf60..62cc190 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Password: admin ## Structure -This section serves pretty much as a small documentatino of the overall project. +This section serves pretty much as the documentation of the overall project. ### Back-end -- cgit v1.3.1-26-gb76a From 56210f7fe7d1994a06a6e1a7e7d93670e937a954 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 3 Apr 2021 18:04:23 +0300 Subject: Added screenshots --- README.md | 9 +++++++++ screenshots/create-offer.png | Bin 0 -> 22385 bytes screenshots/dashboard-logged-in.png | Bin 0 -> 24299 bytes screenshots/dashboard-login.png | Bin 0 -> 15029 bytes screenshots/edit-offer.png | Bin 0 -> 24981 bytes screenshots/landing-page.png | Bin 0 -> 29352 bytes 6 files changed, 9 insertions(+) create mode 100644 screenshots/create-offer.png create mode 100644 screenshots/dashboard-logged-in.png create mode 100644 screenshots/dashboard-login.png create mode 100644 screenshots/edit-offer.png create mode 100644 screenshots/landing-page.png (limited to 'README.md') diff --git a/README.md b/README.md index 62cc190..9589156 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,15 @@ Username: admin Password: admin ``` +
+ Screenshorts of site + + + + + +
+ ## Contents - [Getting started](#Getting%20started) - [Structure](#Structure) diff --git a/screenshots/create-offer.png b/screenshots/create-offer.png new file mode 100644 index 0000000..31e07a4 Binary files /dev/null and b/screenshots/create-offer.png differ diff --git a/screenshots/dashboard-logged-in.png b/screenshots/dashboard-logged-in.png new file mode 100644 index 0000000..cf56610 Binary files /dev/null and b/screenshots/dashboard-logged-in.png differ diff --git a/screenshots/dashboard-login.png b/screenshots/dashboard-login.png new file mode 100644 index 0000000..fa0b16d Binary files /dev/null and b/screenshots/dashboard-login.png differ diff --git a/screenshots/edit-offer.png b/screenshots/edit-offer.png new file mode 100644 index 0000000..8d045c7 Binary files /dev/null and b/screenshots/edit-offer.png differ diff --git a/screenshots/landing-page.png b/screenshots/landing-page.png new file mode 100644 index 0000000..d42302f Binary files /dev/null and b/screenshots/landing-page.png differ -- cgit v1.3.1-26-gb76a From adf879d7d3a6b118117af2482c1545f6f72e0342 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 3 Apr 2021 18:05:24 +0300 Subject: Fixed screenshots summary in README --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 9589156..9813992 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,11 @@ Password: admin
Screenshorts of site - - - - - + + + + +
## Contents -- cgit v1.3.1-26-gb76a From 2e022c316ebf7f3846188a92d080cef07134e662 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 3 Apr 2021 18:10:46 +0300 Subject: Fixed typos and bad wording in README --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 9813992..b464099 100644 --- a/README.md +++ b/README.md @@ -33,21 +33,21 @@ Password: admin 2. You'll need to update the source code with your `MySQL` credentials. In the file `src/models/DB.php`, on lines 6 to 9 you'll find the connection information. You'll need to change the values of `$username` and `$password` with your own. - If you're connecting to a remote database or have your database at a non-standart port, you'll also need to change `$servername`. Changing the value of `$dbname` is completely up to preference. - - Don't worry if the database doesn't exist, when the app starts it automatically creates the database and tables if they don't exist. + - Don't worry if the database or tables don't exist, when the app starts it automatically create them. 3. Currently this repo provides an Apache configuration file (`configs/devrix-job-board.conf`) with the localhost domain `djb.local`. - - To use that domain, you'll also need to open your `/etc/hosts` file and add, on a new line, `127.0.0.1 djb.local`. **Be ware**, it will break any other localhost domains you've setup. - - If you wanna use it in a server-hosted environment, update the values of `ServerName` and `ServerAlias` with your desired domain and subdomain. + - To use that domain, you'll also need to open your `/etc/hosts` file and add, on a new line, `127.0.0.1 djb.local`. **Beware**, it will break any other localhost domains you've setup. + - If you wanna use it in a server environment, update the values of `ServerName` and `ServerAlias` with your desired domain and subdomain. 4. Finally, we'll need to move the source code to the `/var/www/devrix-job-board/` folder. - - This (and creating the folder if it doesn't exist) can be done automatically, just run with sudo the `move-to-www.sh`: + - This (and creating the folder if it doesn't exist) can be done automatically, just run with sudo the `move-to-www.sh` script: ``` sudo ./tools/move-to-www.sh ``` ## Structure -This section serves pretty much as the documentation of the overall project. +This section serves as a mini-documentation of the overall project. ### Back-end @@ -57,7 +57,7 @@ The database has two tables: `companies` and `job_offers`. Inside `companies` is ### Front-end -The front-end is a modified version of the given [template](https://github.com/xavortm/html-template-jobs). I took the CSS and the structure of the HTML files and applied it as closely to the original as I can. +The front-end is a modified version of the given [template](https://github.com/xavortm/html-template-jobs). I took the CSS and the structure of the HTML files and applied it to my structure, trying to leave behind as little as possible. There are also a few custom stylings I had to make, all located in [`prog.css`](https://github.com/Syndamia/devrix-job-board/blob/main/src/css/prog.css). These are mainly: - a navigation bar -- cgit v1.3.1-26-gb76a From 7828d17000f2af72e2602c0813844499cba4612f Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 3 Apr 2021 18:13:31 +0300 Subject: Removed static company image from landing page job offers --- README.md | 2 -- screenshots/landing-page.png | Bin 29352 -> 24583 bytes src/views/landing.php | 5 ----- 3 files changed, 7 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index b464099..6dfef59 100644 --- a/README.md +++ b/README.md @@ -64,8 +64,6 @@ There are also a few custom stylings I had to make, all located in [`prog.css`]( - form and input styling - pages that have only a form inside them (for example, the [`create offer`](https://github.com/Syndamia/devrix-job-board/blob/main/src/views/create-offer.php) page) -**Note**: on the landing page, job offers have a picture to the right side of them. This is by design, since the template originally had them and without them, the job offers look weird/bad. There is no functinality behind them, they're static and purely aesthetical. - ## Tools This repo contains some tools that could be useful during setup and development of the app. They're all located in the `tools` folder. diff --git a/screenshots/landing-page.png b/screenshots/landing-page.png index d42302f..0a76312 100644 Binary files a/screenshots/landing-page.png and b/screenshots/landing-page.png differ diff --git a/src/views/landing.php b/src/views/landing.php index 514e5a7..97b53f7 100644 --- a/src/views/landing.php +++ b/src/views/landing.php @@ -12,11 +12,6 @@ '. $job->description . ' - '; } ?> -- cgit v1.3.1-26-gb76a From 3b0cbc90e3046a8bb979c2b9a17fae5a94bb2707 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 3 Apr 2021 18:19:20 +0300 Subject: Added database exports --- README.md | 2 +- db-export/devrix_job_board.sql | 111 +++++++++++++++++++++++++++++++++++++++++ db-export/devrix_job_board.xml | 70 ++++++++++++++++++++++++++ 3 files changed, 182 insertions(+), 1 deletion(-) create mode 100644 db-export/devrix_job_board.sql create mode 100644 db-export/devrix_job_board.xml (limited to 'README.md') diff --git a/README.md b/README.md index 6dfef59..7003325 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ The repository for my solution of DevriX's exam for their internship program. -It's an oversimplified job offer website, (roughly) following the MVC design pattern and using the LAMP stack (with MySQL). +It's an oversimplified job offer website, (roughly) following the MVC design pattern and using the LAMP stack (with MySQL). In `src` you can find the source code and in `db-export` you can find the export of a very small demo database. **CREDENTIALS FOR DASHBOARD** ``` diff --git a/db-export/devrix_job_board.sql b/db-export/devrix_job_board.sql new file mode 100644 index 0000000..a65dbfd --- /dev/null +++ b/db-export/devrix_job_board.sql @@ -0,0 +1,111 @@ +-- phpMyAdmin SQL Dump +-- version 5.1.0 +-- https://www.phpmyadmin.net/ +-- +-- Host: localhost +-- Generation Time: Apr 03, 2021 at 03:15 PM +-- Server version: 8.0.23 +-- PHP Version: 7.4.16 + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +START TRANSACTION; +SET time_zone = "+00:00"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; + +-- +-- Database: `devrix_job_board` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `companies` +-- + +CREATE TABLE `companies` ( + `id` int NOT NULL, + `name` varchar(100) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- +-- Dumping data for table `companies` +-- + +INSERT INTO `companies` (`id`, `name`) VALUES +(1, 'MegaCorp'), +(2, 'Cool INC.'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `job_offers` +-- + +CREATE TABLE `job_offers` ( + `id` int NOT NULL, + `title` varchar(100) DEFAULT NULL, + `description` varchar(100) DEFAULT NULL, + `companyId` int DEFAULT NULL, + `salary` double(16,4) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- +-- Dumping data for table `job_offers` +-- + +INSERT INTO `job_offers` (`id`, `title`, `description`, `companyId`, `salary`) VALUES +(1, 'Programmer', 'Coding', 1, 2000.0000), +(7, 'Test Job', 'Testing', 2, 346.0000); + +-- +-- Indexes for dumped tables +-- + +-- +-- Indexes for table `companies` +-- +ALTER TABLE `companies` + ADD PRIMARY KEY (`id`); + +-- +-- Indexes for table `job_offers` +-- +ALTER TABLE `job_offers` + ADD PRIMARY KEY (`id`), + ADD KEY `fk_companyId_companies` (`companyId`); + +-- +-- AUTO_INCREMENT for dumped tables +-- + +-- +-- AUTO_INCREMENT for table `companies` +-- +ALTER TABLE `companies` + MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; + +-- +-- AUTO_INCREMENT for table `job_offers` +-- +ALTER TABLE `job_offers` + MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; + +-- +-- Constraints for dumped tables +-- + +-- +-- Constraints for table `job_offers` +-- +ALTER TABLE `job_offers` + ADD CONSTRAINT `fk_companyId_companies` FOREIGN KEY (`companyId`) REFERENCES `companies` (`id`); +COMMIT; + +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/db-export/devrix_job_board.xml b/db-export/devrix_job_board.xml new file mode 100644 index 0000000..5f8488a --- /dev/null +++ b/db-export/devrix_job_board.xml @@ -0,0 +1,70 @@ + + + + + + + + + CREATE TABLE `companies` ( + `id` int NOT NULL AUTO_INCREMENT, + `name` varchar(100) DEFAULT NULL, + PRIMARY KEY (`id`) + ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + + + CREATE TABLE `job_offers` ( + `id` int NOT NULL AUTO_INCREMENT, + `title` varchar(100) DEFAULT NULL, + `description` varchar(100) DEFAULT NULL, + `companyId` int DEFAULT NULL, + `salary` double(16,4) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `fk_companyId_companies` (`companyId`), + CONSTRAINT `fk_companyId_companies` FOREIGN KEY (`companyId`) REFERENCES `companies` (`id`) + ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + + + + + + + + + 1 + MegaCorp +
+ + 2 + Cool INC. +
+ + + 1 + Programmer + Coding + 1 + 2000.0000 +
+ + 7 + Test Job + Testing + 2 + 346.0000 +
+
+
\ No newline at end of file -- cgit v1.3.1-26-gb76a