Bakery Management System

Complete Installation & User Guide

Follow this step-by-step guide to get your bakery system up and running smoothly. Perfect for small bakeries, cafes, and pastry shops.


Introduction

The Bakery Management System is a comprehensive solution built with PHP and MySQL, designed to help you digitize and streamline your daily operations. It simplifies everything from managing your product catalog to tracking orders and inventory, ultimately reducing manual effort and improving business efficiency.

This guide will walk you through:

  • Setting up a local development environment.
  • Creating the database and importing the necessary data.
  • Configuring and running the application.
  • Using the system's core features.
  • Troubleshooting common issues and deploying the system online.

Prerequisites

Before you begin, make sure you have the following software installed on your computer. Don't worry, we'll guide you through setting up the main component.

  • Local Server Stack: We recommend XAMPP, which bundles everything you need: Apache, PHP, and MySQL. Alternatives include WAMP (for Windows) or MAMP (for macOS).
  • Web Browser: A modern browser like Chrome, Firefox, or Edge.
  • Code Editor: A text editor like VS Code, Sublime Text, or Notepad++ is helpful for editing configuration files.

Part 1: Local Server Setup (XAMPP)

To run a PHP application on your computer, you need a web server (Apache), a database server (MySQL), and PHP itself. XAMPP is a free and easy-to-install package that contains all three.

  1. Download the latest version of XAMPP from the official website for your operating system (Windows, macOS, or Linux).
  2. Run the installer. Accept the default components, which should include Apache, MySQL, PHP, and phpMyAdmin.
  3. Complete the installation and launch the XAMPP Control Panel.
  4. Click the "Start" button for both the Apache and MySQL modules. They should turn green, indicating they are running correctly.
What are these? Apache acts as the webserver that delivers the application to your browser. MySQL is the database that stores all your data (products, orders, etc.).

Watch this video for a detailed walkthrough on installing and using XAMPP:


Part 2: Project Installation & Database Setup

With the local server running, it's time to set up the project files and the database.

Step 1: Place Project Files

First, download and unzip the project files. Then, move the entire bakery-system folder into the web server's root directory. For XAMPP, this is the htdocs folder.

C:\xampp\htdocs\bakery-system

For MAMP on macOS, it would be:

/Applications/MAMP/htdocs/bakery-system

Step 2: Create the Database

Next, you need to create an empty database where the system will store its information.

  1. Open your web browser and go to http://localhost/phpmyadmin.
  2. Click on the "New" button on the left sidebar.
  3. Enter the database name as bakery_pos_db.
  4. Set the collation to utf8mb4_general_ci for best compatibility.
  5. Click "Create".

Step 3: Import the SQL File

Now, import the pre-built table structure and sample data into your new database.

  1. With the bakery_pos_db database selected in phpMyAdmin, click on the "Import" tab at the top.
  2. Click "Choose File" and locate the database.sql file inside your project folder (bakery-system/database.sql).
  3. Scroll down and click the "Go" button. This will create all the necessary tables (products, orders, etc.) and fill them with some initial data.

This video demonstrates how to create a database and import an SQL file using phpMyAdmin:


Part 3: Database Configuration

The final step is to tell the application how to connect to the database you just created.

  1. Navigate to the project folder and open the file named db_connect.php in a code editor.
  2. Verify that the database credentials match your local setup. For a default XAMPP installation, they should look like this:
<?php
$servername = "localhost";
$username = "root";
$password = ""; // Default XAMPP password is empty
$dbname = "bakery_pos_db";

$conn = new mysqli($servername, $username, $password, $dbname);

if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
?>
Important: If you ever set a password for your MySQL database in XAMPP, you must enter it in the $password field.

Part 4: Running & Using the System

Congratulations, the installation is complete! To access the system, open your web browser and navigate to:

http://localhost/bakery-system

Default Login Credentials

Use the following credentials to log in to the admin panel:

  • Username: admin
  • Password: admin123

We highly recommend changing the password after your first login!

Key Features Overview:

  • Dashboard: Get a quick overview of sales, orders, and popular products.
  • Product Management: Navigate to the "Products" section to add new items, set prices, upload images, and update stock levels.
  • Order Processing: The main screen is a Point-of-Sale (POS) interface. Cashiers can select products, add them to a cart, and complete transactions. The system automatically calculates totals and taxes.
  • Inventory Tracking: When an order is completed, the stock levels for the sold products are automatically deducted. You can monitor stock from the product management page.
  • Reporting: Access the "Reports" section to generate sales summaries for different periods (daily, weekly, monthly) to track your business performance.

Troubleshooting Common Issues

Blank White Page
This is often a fatal PHP error. Check the error_log file inside your XAMPP/Apache folder for clues. Ensure all files were copied correctly and your PHP version meets the requirements.
"Database Connection Failed"
This means the credentials in db_connect.php are incorrect. Double-check the $servername, $username, $password, and $dbname to ensure they match your database setup exactly.
Images Not Uploading/Showing
This is usually a file permissions issue. Ensure the web server has permission to write to the uploads/ or images/ directory within your project folder.
404 Not Found Error
Ensure Apache is running in the XAMPP Control Panel. Also, verify that the project folder name (bakery-system) is spelled correctly in the URL and that it is placed directly inside the htdocs folder.

Bonus: Deploying to a Live Server

Ready to go live? Here's a summary of the steps to deploy your application on a web hosting service (like Hostinger, Bluehost, etc.):

  1. Get Hosting: Purchase a web hosting plan that supports PHP and MySQL.
  2. Upload Files: Use the hosting provider's File Manager or an FTP client (like FileZilla) to upload the entire bakery-system folder to the public_html directory on your server.
  3. Create Live Database: Use your hosting control panel (cPanel) to create a new MySQL database and a database user. Be sure to note down the database name, username, and password.
  4. Import Database: Open phpMyAdmin from your cPanel and import your database.sql file into the newly created live database.
  5. Update Connection File: Edit the db_connect.php file on the live server and replace the local credentials (localhost, root, "") with the live database credentials you just created.
  6. Visit Your Domain: You should now be able to access your system by visiting your domain name (e.g., https://www.yourbakery.com).

Conclusion & Support

You have successfully installed and configured the Bakery Management System! This tool is designed to save you time and provide valuable insights into your business. Explore its features and adapt it to your workflow.

If you encounter any issues or have questions, feel free to contact us at +94 778543475 or visit our website at Egotechworld.com.