← Back to Documentation Home

Database & Domain Setup

A visual, step-by-step walkthrough for creating your MySQL 8.0+ database, granting full user privileges, importing the complete schema file (foodfeast_db.sql), and configuring your web server document roots in cPanel, Plesk, or VPS.

Database & Domain Setup

A visual, step-by-step walkthrough for creating your MySQL 8.0+ database, granting full user privileges, importing the complete schema file (foodfeast_db.sql), and configuring your web server document roots in cPanel, Plesk, or VPS.

Table of Contents
  1. Overview & Architecture
  2. Step 1: Create Database & User in cPanel
  3. Step 2: Grant User Privileges
  4. Step 3: Import SQL Schema (foodfeast_db.sql)
  5. Step 4: Domain & Document Root Mapping
  6. Step 5: Verify PHP 8.2+ Extensions
  7. Step 6: Update Laravel .env Configuration
  8. Step 7: Verify Database Connection & Next Steps
1 Architecture Overview

Overview & Architecture#

FoodFeast utilizes a unified, single-database architecture where one relational MySQL schema serves all three core interfaces simultaneously:

Interface Entry Point Role in Ecosystem
Customer Web Storefront https://yourdomain.com/home Browse menus, search restaurants, manage cart, place orders online
Admin & Restaurant Portal https://yourdomain.com/login Order dispatching, restaurant onboarding, earnings, menu management
Mobile REST API https://yourdomain.com/api/ Serves Flutter iOS & Android mobile customer applications
Unified Database Advantage

You only need one database. Orders placed through the mobile app immediately appear on the admin dashboard, restaurant tablet, and customer web portal in real time.


2 Database Creation

Step 1: Create Database & User in cPanel#

1

Open MySQL® Databases in cPanel

Log in to your hosting cPanel, scroll down to the Databases section, and click on MySQL® Databases.

cPanel dashboard with MySQL Databases highlighted
cPanel Databases category — select MySQL® Databases
2

Create a New Database

Under Create New Database, enter a database name such as foodfeast_db, then click Create Database.

cPanel Create New Database form
Enter database name and click Create Database
cPanel Username Prefix

Note that most shared hosting providers prefix the database name with your cPanel account username (for example: username_foodfeast_db). Be sure to record the full prefixed name.

3

Create a New MySQL User

On the same page, scroll down to MySQL Users → Add New User. Enter a dedicated username (e.g. foodfeast_user) and generate a strong password. Click Create User.

cPanel Add New User form
Create dedicated MySQL user with high-entropy password
Special Characters in Passwords

Avoid using quote characters (" or ') or hash (#) directly in the password string, as these can disrupt the Laravel .env parser unless wrapped in double quotes.


3 Permissions

Step 2: Grant User Privileges#

1

Add User to Database

Scroll down to the Add User To Database section. In the User dropdown, select your newly created user. In the Database dropdown, select your new database. Click Add.

cPanel Add User To Database dropdown selection
Link the MySQL user to the FoodFeast database
2

Assign ALL PRIVILEGES

On the Manage User Privileges screen, check the ALL PRIVILEGES checkbox at the top. This selects every permission required by Laravel migrations, indexes, triggers, and foreign key constraints. Click Make Changes.

cPanel Manage User Privileges screen with ALL PRIVILEGES checked
Select ALL PRIVILEGES and save changes

4 Data Import

Step 3: Import SQL Schema (foodfeast_db.sql)#

FoodFeast includes a complete pre-configured database schema file with starter data, business settings, sample menus, and demo credentials located at:

Source_Code/database/foodfeast_db.sql

Method A: phpMyAdmin Import (Recommended for cPanel / Plesk)

1

In cPanel, click phpMyAdmin under the Databases section.

In the left sidebar, click on your newly created database (e.g. username_foodfeast_db).

Click on the Import tab in the top navigation bar.

Under File to import, click Choose File and select Source_Code/database/foodfeast_db.sql from your extracted download package.

Leave all other settings at their default values (UTF-8, SQL) and click Go (or Import) at the bottom.

Import Success

phpMyAdmin will display a green success notification: "Import has been successfully finished, XXX queries executed." All 40+ system tables are now seeded!

Method B: Artisan Migration & Seed (For VPS / Terminal Users)

If you are deploying via SSH or command line on Ubuntu/Debian/CentOS, you can alternatively initialize the schema via Artisan:

cd /var/www/foodfeast/Source_Code/Foodfeast-Laravel-Dashboard-v1
php artisan migrate --seed

5 Web Server Mapping

Step 4: Domain & Document Root Mapping#

In modern Laravel applications, web server document roots must point directly to the /public directory — never to the project root folder.

cPanel Domains list showing domain and document root mappings
cPanel Domains interface — ensuring document roots point to Laravel public directory

Standard Single-Domain Setup (Recommended)

If your entire FoodFeast platform runs on one primary domain (e.g. https://yourdomain.com):

URL Route Physical Document Root Served Content
https://yourdomain.com/ public_html/public Customer Web Storefront & Online Ordering
https://yourdomain.com/login public_html/public Admin & Restaurant Partner Management Portal
https://yourdomain.com/api/ public_html/public Flutter Mobile App REST API Endpoints
https://yourdomain.com/storage/ public_html/public/storage Uploaded media, food item photos, restaurant banners
Critical Security Warning

Never set the document root to the project root folder (above /public). Exposing the project root makes your .env file publicly downloadable over HTTP, which leaks your database password and API secrets.


6 PHP Compatibility

Step 5: Verify PHP 8.2+ Extensions#

Confirm that your hosting environment is running PHP 8.2 or 8.3 with all necessary extensions enabled:

phpinfo verification page
Verify active PHP version in MultiPHP Manager or phpinfo()

Required PHP extensions:

Extension Purpose Status
BCMath & Ctype High-precision currency calculations and character verification Required
cURL & OpenSSL Secure HTTP communication with Stripe, PayPal, Firebase APIs Required
GD or Imagick Automatic image resizing for dishes, avatars, restaurant logos Required
Mbstring & Tokenizer Multilingual UTF-8 string processing and Laravel blade compilation Required
PDO_MySQL High-performance database connectivity Required

7 Environment Configuration

Step 6: Update Laravel .env Configuration#

Open the .env file in your Laravel backend folder (Source_Code/Foodfeast-Laravel-Dashboard-v1/.env) and update the database parameters with your cPanel database details:

.env
APP_NAME=FoodFeast
APP_ENV=production
APP_KEY=base64:YOUR_GENERATED_APP_KEY
APP_DEBUG=false
APP_URL=https://yourdomain.com

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=username_foodfeast_db
DB_USERNAME=username_foodfeast_user
DB_PASSWORD="YourStrongPasswordHere"

# Session & Cache Drivers
SESSION_DRIVER=file
QUEUE_CONNECTION=sync
FILESYSTEM_DISK=public

After saving your .env file, clear Laravel configuration caches so the updated database credentials take immediate effect:

php artisan config:clear
php artisan cache:clear
Storage Symlink Required

Ensure you run the storage link command once so uploaded dish photos and restaurant banners are viewable in the web portal and mobile app:

php artisan storage:link

8 Verification

Step 7: Verify Database Connection & Next Steps#

Open your browser and navigate to https://yourdomain.com/login.

If the login screen loads smoothly without any database connection errors, your database and domain setup is 100% complete!

Log in with the default administrator credentials:

Role Email Password
Super Administrator (Demo) superadmin@foodfeast.com 12345678
Customer App Demo demo.user@foodfeast.com 12345678
Restaurant Partner Demo burgerbistro@foodfeast.com 12345678
Ready for Next Steps

Now that your database and web server are operational, proceed to connect your Flutter mobile app and integrate external third-party services:

FoodFeast · cPanel Database & Domain Setup Guide v1.0 · © ZainClouds FoodFeast Commercial Release