Every day, tons of perfectly edible food goes to waste simply because itβs close to its expiry date. Grocery stores and restaurants often struggle to manage this inventory, while people in the community are searching for affordable meals.
Food Clearance was born from that challenge:
π A platform where businesses can upload their soon-to-expire food,
π Customers can discover discounts, and
π Admins can oversee the entire ecosystem to make sure itβs fair and transparent.
Itβs more than just software β itβs an effort to reduce waste, cut costs, and make food accessible.
- Customers: browse discounted food, search by expiry/category, add to cart
- Companies: upload food items, manage inventory, track transactions
- Admins: manage users, foods, companies, transactions, reports
- Reports: track expired vs sold items, generate audits
Food-Clearance-Ecom-MySQL-database/
ββ app/ # Controllers, Models, Middleware
ββ bootstrap/ # Laravel bootstrap files
ββ config/ # Configuration (auth, DB, mail, etc.)
ββ database/ # Migrations & Seeders
ββ public/ # Frontend entry (index.php, assets)
ββ resources/ # Views (Blade templates), JS, CSS
ββ routes/ # Web & API routes
ββ storage/ # Logs, cache, uploads
ββ tests/ # PHPUnit tests
ββ artisan # Laravel CLI
ββ composer.json # PHP dependencies
ββ package.json # JS dependencies
ββ .env.example # Example environment variables
/β Home page/homeβ Authenticated landing- Admin:
/admin/users,/admin/foods,/admin/companies,/admin/transactions,/admin/reports - Company:
/company/foods,/company/transactions,/company/companies - Customer:
/cart,/search
- Backend: Laravel (PHP 8+)
- Frontend: Blade, Bootstrap, Mix (Webpack)
- Database: MySQL
- Auth: Multi-role (Admin, Company, Customer)
- Testing: PHPUnit
- Packages: Composer, NPM
- Schema Design: Users, Foods, Companies, Transactions, Reports
- Joins & Queries: insights on discounts, sales, waste
- Stored Procedures / Views: reusable logic for reporting
- Transaction Logs: ensure atomic sales
Example SQL:
SELECT c.name AS company_name,
COUNT(CASE WHEN f.status = 'expired' THEN 1 END) * 100.0 / COUNT(*) AS expired_pct
FROM foods f
JOIN companies c ON f.company_id = c.id
GROUP BY c.name;
- ETL: extract sales data, transform discounts/expiry, load into warehouse
- Warehouse: fact (transactions), dimensions (company, food, time, location)
- Analytics: dashboards for saved vs wasted food, revenue recovery, adoption rate
- Predictive: forecast unsold categories, recommend discounts by expiry
git clone https://github.com//Food-Clearance-Ecom-MySQL-database.git
cd Food-Clearance-Ecom-MySQL-database
composer install
npm install && npm run dev
cp .env.example .env
php artisan key:generate
php artisan migrate --seed
php artisan serve
Visit: http://localhost:8000
- Admin sets up companies
- Companies upload expiring food
- Customers browse & buy
- Transactions logged β Reports generated
- ETL β Warehouse β Analytics dashboards
- Mobile app (Flutter/React Native)
- AI-powered discount engine
- Notifications for new deals
- Multi-language & multi-currency
- Delivery service integration
- Automated pipelines (Airflow/dbt)
This project isnβt just about code β itβs about impact.
By making food redistribution efficient and accessible, we aim to cut waste, feed more people, and support businesses.
"Save food, save money, save the planet." πβ¨