A full-stack e-commerce platform for nutrition supplements featuring integrated payment processing, automated email/SMS notifications, PDF invoice generation, and comprehensive admin dashboard.
Nutrition Lab is a production-ready online store that handles the complete e-commerce workflow: product browsing, shopping cart management, secure payments via Flouci gateway, order fulfillment, and automated customer communication.
- Complete Shopping Cart System with session management
- Product Catalog with 6 categories (Endurance, Proteins, Aminos, Vitamins, Snacks, Accessories)
- User Authentication and account management
- Flouci Payment Gateway Integration (Tunisian payment processor)
- Automated Email Notifications with PDF invoices (PHPMailer)
- SMS Notifications for order updates (Twilio)
- PDF Invoice Generation with company branding (DomPDF)
- Admin Dashboard with sales analytics and reporting
- Order Management System with status tracking
- Responsive Design (mobile, tablet, desktop)
- PHP (procedural programming)
- MySQL (database with normalized schema)
- Composer (dependency management)
- HTML5 / CSS3
- JavaScript (ES6+)
- Bootstrap 5 (responsive framework)
- PHPMailer - Email automation
- Twilio PHP SDK - SMS notifications
- DomPDF - PDF invoice generation
- Flouci API - Payment processing
projetfinsemestre2/
├── backend/
│ ├── admin/ # Admin panel
│ │ └── page/ # Admin management pages
│ ├── api/ # API endpoints
│ ├── config/ # Database configuration
│ ├── functions/ # Helper functions
│ ├── img/ # Images and assets
│ ├── uploads/ # Uploaded product images
│ ├── index.php # Homepage
│ ├── cart.php # Shopping cart
│ ├── checkout.php # Checkout process
│ ├── flouci.php # Payment gateway
│ ├── confirmation.php # Order confirmation
│ └── ... # Other pages
├── vendor/ # Composer dependencies
├── PHPMailer-master/ # Email library
├── twilio-php-main/ # SMS library
├── composer.json # Dependency configuration
└── nutritionlab-2.sql # Database schema
- XAMPP / WAMP / MAMP (or any local server with PHP & MySQL)
- PHP 7.4+
- MySQL 5.7+
- Composer (for dependency management)
git clone https://github.com/bahadhay/NutritionLab.git
cd NutritionLabcomposer install- Start your local server (Apache & MySQL)
- Open phpMyAdmin at
http://localhost/phpmyadmin - Create a new database named
nutritionlab - Import the SQL file:
- Click on the
nutritionlabdatabase - Go to Import tab
- Choose
nutritionlab-2.sqlfrom the project root - Click Go
- Click on the
Edit backend/config/dbcon.php with your database credentials:
<?php
$host = 'localhost';
$username = 'root';
$password = '';
$database = 'nutritionlab';
$conn = mysqli_connect($host, $username, $password, $database);
?>Edit email settings in backend/mail.php:
$mail->Username = 'your-email@gmail.com';
$mail->Password = 'your-app-password';Add your Twilio credentials in the SMS configuration file.
Configure Flouci API credentials in backend/flouci.php.
- Copy the project folder to your
htdocsdirectory (XAMPP) or equivalent - Start Apache and MySQL services
- Open your browser and navigate to:
http://localhost/projetfinsemestre2/backend/index.php
- Email: nutritionlab.tn@gmail.com
- Password: adeladel1234
- Email: baha@gmail.com
- Password: baha
Important: Change these credentials after first login for security.
- Browse Products - Customer views product catalog by category
- Add to Cart - Products added with quantity selection
- Checkout - Customer enters shipping information
- Payment - Secure payment via Flouci gateway
- Confirmation - Order confirmation page displayed
- Email Notification - Automated email with PDF invoice sent
- SMS Notification - SMS sent to customer's phone
- Admin Management - Admin updates order status
- Fulfillment - Customer receives shipping confirmation
- Sales overview and revenue charts
- Recent orders dashboard
- Product management (CRUD operations)
- Order status updates (Pending → Processing → Shipped → Delivered)
- Customer database management
- Sales reports (daily/monthly/yearly)
- Low stock alerts
- Category management
- Password hashing with
bcrypt - Prepared statements for SQL injection prevention
- Input sanitization and validation
- Session security with regeneration
- HTTPS recommended for production
- PCI-compliant payment gateway (Flouci)
users- Customer accountsproducts- Product catalogcategories- Product categoriesorders- Order recordsorder_items- Order detailscart- Shopping cart sessions
Coming soon - Add screenshots of your application
- Login to admin panel
- Navigate to Products → Add Product
- Fill in product details (name, price, category, image)
- Submit
- Admin panel → Orders
- View order details
- Update order status
- Customer receives automated notifications
For production deployment:
- Use a production server (not localhost)
- Enable HTTPS/SSL
- Change default credentials
- Configure production database
- Set up email/SMS services
- Test payment gateway in production mode
- Enable error logging (disable display_errors)
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
Developer: Baha Dhay Email: bahadhay7@gmail.com GitHub: @bahadhay
Built with PHP & MySQL | Full-Stack E-Commerce Solution