This project was made for the vacancy of a web-developer at Magebit.
I have made and run this project on OpenServer. It worked fine for me.
Download OpenServer
Modules:
- PHP 7.1
- Apache 2.4
- MySQL 8.0 (Windows 10)
- A preprocessor SASS for CSS and Vue.js 3 for JavaScript are used in this project.
- Basic page (homepage / first-page) is
/html/index.php
- If JavaScript is disabled it automatically switches to
/html/if-js-disabled.php
- The site connects to a MySQL database always via
/src/db.php
file. Please check it before running an instance- To connect to the database's control panel you have to type in address bar
<domain>/admin.php
- User can access only /html folder, so important code is hidden for user in folder
/src
It's up to you what server you choose
I used OpenServer as mentioned.
To make site working run 3 commands to MySQL database before, to create essential database and tables
(for example using PhpMyAdmin, which is already installed in OpenServer):
CREATE DATABASE `subscriptions`;
CREATE TABLE `subscriptions`.`emails` ( `id` INT(11) NOT NULL AUTO_INCREMENT , `user_email` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , `email_domain_id` INT(11) NOT NULL , `email_domain` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , `sub_date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP , PRIMARY KEY (`id`)) ENGINE = InnoDB;
CREATE TABLE `subscriptions`.`domains` ( `domain_id` INT(11) NOT NULL AUTO_INCREMENT , `domain_name` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , PRIMARY KEY (`domain_id`)) ENGINE = InnoDB;
Download the repository.
If you want just copy-paste and run:
As an example C:\OpenServer\domains\test.com