Skip to content

HongYang01/tmf2234-web-hosting-service

Repository files navigation

Visitors GitHub contributors

TMN2234 (G03) Web Based System Development Assignment

Project: Web Hosting Service

🏆 Developed By Team: Semicolon

  • 79880 LIM HONG YANG
  • 79065 CHIN TECK YUNG
  • 78855 ANNASTASHA CHANG SEE MAY
  • 79260 EE CHEE FAT
  • 79027 CHAI CHENG KANG

This project is intended strictly for educational purposes. It is important to note that no tangible costs will be accrued. We wish to emphasize that any potential loss or damage to assets cannot be attributed to our accountability. We advise exercising caution and assuming full responsibility when opting to download and install this software.


⚠️ Important Pre-requisite!

This web application must be develop ONLINE, because the belows are implemented:

  1. PayPal Subscription
    • Ask credentials from developer or; use your own client ID & secret
  2. Chart.js

🌐 Deploying Website To Local Machine

Click to expand!

Option 1

  1. Empty your xampp/htdocs/ directory and replace it with all the project files

Option 2

  1. Open XAMPP
  2. Click config (Apache)
  3. Select Apache (httpd.conf)
  4. Search for DocumentRoot, change the directory to your project folder

You will see this (by default):

DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">

Change to:

DocumentRoot "path/to/your/project/folder"
<Directory "path/to/your/project/folder">
  1. Save it, restart XAMPP and start Apache and MySQL
  2. Import id20654951_semicolonix.sql to database (assuming no error)
  3. Done, try localhost/index.php

🔑 Setup Composer for dotenv Environment

Click to expand!
  1. Download Composer.exe (v2.5.8 as of 08-Aug-2023) Video Tutorial
  2. Install as default setting

If missing dotenv folder

  1. Create a dotenv folder
  2. Open vsCode terminal, cd dotenv
  3. type in composer require vlucas/phpdotenv
  4. Will see the package installed: composer.json & composer.lock

☁️ How To Host Website Temporarily Using ngrok (FREE)

Click to expand!
  1. Register ngrok account
  2. Login ngrok aacount
  3. Download ngrok (please remember the download directory)
  4. Run cmd
  5. cd /absolute/path/to/your/ngrok-v3-stable-windows-amd64 (ngrok.exe should be inside)
  6. type ngrok & hit ENTER - check if is correctly install (assuming no error)
  7. Run your XAMPP/WampServer (Start Apache & MySQL)
  8. Goto ngrok Dashboard to get your AuthToken
  9. Go back to cmd
  10. type ngrok config add-authtoken PUT_YOUR_AuthToken_HERE & hit ENTER (only need to do this ONCE)
  11. type ngrok http 80 & hit ENTER (listening port 80, may vary depends on your local server)
  12. You will now see beautiful interface in cmd
  13. Copy the Forwarding link
  14. Paste the link to any browser
  15. to QUIT/Close tunnel: Ctrl + C in cmd

Extra

🔁 Repeat Step [4], [5], [11-15] if you wish to re-open a tunnel
✒️ Note: The link will be expired if you choose to close the tunnel (Ctrl + C)
✒️ How to update ngrok: ngrok udpate

🧾 Generate PDF Receipt using FPDF

Click to expand!
  1. Download the latest fpdf as zip file (v1.85 as of 18-6-2023)
  2. Extract and put in the project directory

📒 Dummy Data

Click to expand!
hashing method : password_hash("YOUR_PASSWORD", PASSWORD_BCRYPT);
verify method  : password_verify("YOUR_PASSWORD", $hash);
Role Email PWD
ADMIN admin1@semicolonix.com 12356
----- ---------------------- -----------
USER cynthia@gmail.com 123
USER name1@gmail.com 123
USER name2@gmail.com 123
USER name3@gmail.com 123
USER alex@gmail.com alex456@
USER alice@outlook.com Alicepass
USER bob@hotmail.com qwerty789
USER emily@hotmail.com emily123
USER james@gmail.com brown123
USER jane@yahoo.com secret456
USER john@gmail.com password123
USER laura@gamil.com laura524
USER michael@yahoo.com mike78900
USER sarah@gmail.com sarah456

💳 PayPal Subscription Integration

Click to expand!

Types of payment

  1. One-time payment/checkout
  2. Recurring Payment (we use this)

Note

Paypal Credentials

Ask from developer

Folder Hierarchy

project/
├── admin/
├── assets/
│   ├── font/
│   ├── icon/
│   └── image/
├── auth/
├── config/
├── css/
├── dotenv/
│   └── vendor/
├── Error/
├── handlers/
├── includes/
├── js/
├── pages/
├── vendor/
└── index.php

Tips on SQL

  1. Reset auto increment using ALTER TABLE table_name AUTO_INCREMENT = desired_value