DayOneFood - Documentation

version 1.0.0


Introduction

Welcome to DayOneFood, the ultimate Single Vendor food delivery solution. Built with Laravel 12 and Vue 3, it offers a high-performance, scalable, and secure platform for your business.

System Architecture

DayOneFood follows the Monolith with Modern Frontend architecture using Inertia.js. This allows us to build a classic server-driven web app but with the modern, single-page application (SPA) feel of Vue.js.

  • Backend: Laravel 12 (MVC Pattern)
  • Frontend: Vue 3 (Composition API)
  • Communication: Inertia.js (No API required for internal frontend)
  • Styling: Tailwind CSS 4 (Utility-first)

Folder Structure

Understanding the structure is key to customization:

/app            # Core application logic (Models, Controllers)
/bootstrap      # Framework bootstrap files
/config         # App configuration files (database, mail, services)
/database       # Migrations and Seeders
/public         # Web root (images, build assets) - POINT DOMAIN HERE
/resources
  /css          # Tailwind CSS entry points
  /js           # Vue components and Inertia pages
    /Pages      # Main views corresponding to Routes
    /Components # Reusable Vue components
/routes         # Web and API routes
/storage        # Logs, compiled templates, file uploads
.env            # Environment variables (DB, API Keys)
                                            

Prerequisites

Ensure your hosting environment meets these requirements to avoid runtime errors.

Server Requirements

  • PHP: >= 8.2 (Strict requirement)
  • Composer: >= 2.5
  • Node.js: >= 18.x (LTS)
  • Database: MySQL 8.0+ / MariaDB 10.5+

PHP Extensions

These extensions must be enabled in your `php.ini`:

BCMath PHP Extension
Ctype PHP Extension
Fileinfo PHP Extension
JSON PHP Extension
Mbstring PHP Extension
OpenSSL PHP Extension
PDO PHP Extension
Tokenizer PHP Extension
XML PHP Extension
                                
Tip: You can check your PHP version and extensions by running php -v and php -m in your terminal.

Quick Start Guide

Database Setup

Create a new database for the application. You can use phpMyAdmin or the command line.

CREATE DATABASE dayonefood_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
                                

Env Configuration

Copy the example environment file and configure your database credentials.

cp .env.example .env
                                

Edit `.env` and update these lines:

APP_NAME="DayOneFood"
APP_URL=http://your-domain.com

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=dayonefood_db
DB_USERNAME=root
DB_PASSWORD=
                                

Installation Process

Important: You will receive a install.zip file. Do not try to clone via Git.

Extraction & Setup

  1. Unzip: Extract the contents of `install.zip` to your server's root directory.
  2. Domain Setup: Point your domain or subdomain to the /public folder. This is critical for security and functionality.
  3. Dependencies: Open your terminal in the extracted directory and run:
# 1. Install PHP dependencies
composer install

# 2. Generate App Key
php artisan key:generate

# 3. Run Database Migrations & Seeders
php artisan migrate --seed

# 4. Create Storage Link (for images)
php artisan storage:link
                                

Asset Building

Install and build the frontend assets (Vue/Tailwind):

# Install Node dependencies
npm install

# Build for production
npm run build
                                

Configuration

Mail Setup

Configure your SMTP server for emails (Forgot Password, Order Notifications).

MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=your_username
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS="hello@dayonefood.com"
MAIL_FROM_NAME="${APP_NAME}"
                                

Payment Gateways

Add your API keys for Stripe or other providers in `.env`:

STRIPE_KEY=pk_test_...
STRIPE_SECRET=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
                                

Push Notifications

We use Push Notifications for real-time order updates. You need to configure your Firebase Cloud Messaging (FCM) keys in the `.env` file.

FCM_SERVER_KEY=your_firebase_server_key_here
FCM_SENDER_ID=your_sender_id
                                
Note: You can obtain these keys from the Firebase Console under Project Settings > Cloud Messaging.

Deployment

Local Setup

For local testing, you can use the built-in PHP server:

php artisan serve
                                

Access the site at http://localhost:8000.

VPS / Server (Ubuntu/Nginx)

For production, we recommend Nginx. Ensure the root directive points to the /public folder:

server {
    listen 80;
    server_name example.com;
    
    # CRITICAL: Point to public directory
    root /var/www/dayonefood/public;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-Content-Type-Options "nosniff";

    index index.php;

    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }
}
                                

SSL & Security

Always run your production site over HTTPS. You can use Certbot (Let's Encrypt):

sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d example.com
                                

Troubleshooting

Common issues and how to fix them.

500 Server Error?

Check storage/logs/laravel.log. Also ensure storage/ and bootstrap/cache/ are writable.

chmod -R 775 storage bootstrap/cache
                                    

"Vite manifest not found"?

You forgot to build the frontend assets. Run:

npm run build

Database Connection Refused?

Check your .env DB credentials and ensure your MySQL server is running.

Help & Support

Thank you for purchasing DayOneFood. We strive to provide the best support experience for our customers on CodeCanyon.

Support Policy

As per Envato's Item Support Policy, your purchase includes 6 months of support. You can extend this to 12 months at the time of purchase or anytime later.

What's Included:
  • Answering technical questions about the item's features
  • Assistance with reported bugs and issues
  • Help with included 3rd party assets
What's NOT Included:
  • Customization services
  • Installation services (unless purchased separately)
  • Server setup or hosting issues

How to Get Support

If you encounter any issues, please follow these steps before contacting us:

  1. Check the Docs: Read this documentation thoroughly.
  2. Search Comments: Check the item's comments section on CodeCanyon for similar issues.
  3. Open a Ticket: If the issue persists, contact us via our CodeCanyon Profile Page using the contact form.
Support Hours: Monday to Friday, 09:00 AM - 06:00 PM (GMT). We usually respond within 24-48 business hours.

Rate Us

If you like DayOneFood, please leave us a 5-star rating on CodeCanyon! It helps us release more updates and features.

Rate on CodeCanyon