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
- Overview & Architecture
- Step 1: Create Database & User in cPanel
- Step 2: Grant User Privileges
- Step 3: Import SQL Schema (foodfeast_db.sql)
- Step 4: Domain & Document Root Mapping
- Step 5: Verify PHP 8.2+ Extensions
- Step 6: Update Laravel .env Configuration
- Step 7: Verify Database Connection & Next Steps
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 |
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.
Step 1: Create Database & User in cPanel#
Open MySQL® Databases in cPanel
Log in to your hosting cPanel, scroll down to the Databases section, and click on MySQL® Databases.
Create a New Database
Under Create New Database, enter a database name such as foodfeast_db, then click Create Database.
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.
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.
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.
Step 2: Grant User Privileges#
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.
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.
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)
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.
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
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.
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 |
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.
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:
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 |
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:
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
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
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 | Password | |
|---|---|---|
| Super Administrator (Demo) | superadmin@foodfeast.com |
12345678 |
| Customer App Demo | demo.user@foodfeast.com |
12345678 |
| Restaurant Partner Demo | burgerbistro@foodfeast.com |
12345678 |
Now that your database and web server are operational, proceed to connect your Flutter mobile app and integrate external third-party services: