Module 1: Introduction & Setup

Welcome to the first step! Here, we'll set up your local development environment to start building our Bakery Management System.

Welcome to the Course!

Before we can start writing any code, it's crucial to have the right tools in place. A local development environment allows you to build and test your application on your own computer without needing a live web server. In this module, we will install all the necessary software and create a clean structure for our project files.

By the end of this module, you will have:

  • A fully functional local server running Apache and MySQL.
  • A professional code editor installed and ready to go.
  • A well-organized folder structure for your project.

Step 1: Setting Up the Local Server with XAMPP

What is XAMPP? XAMPP is a completely free, easy-to-install Apache distribution containing MariaDB, PHP, and Perl. It provides a simple, lightweight local server environment that is perfect for developing PHP-based applications. The 'X' stands for cross-platform (it works on Windows, Mac, and Linux), 'A' for Apache, 'M' for MariaDB (a community-developed fork of MySQL), 'P' for PHP, and 'P' for Perl.

Installation Steps:
  1. Download XAMPP: Head over to the official Apache Friends website and download the installer for your operating system (Windows, macOS, or Linux). We recommend downloading the latest version that includes PHP 8 or higher.
  2. Run the Installer: Once the download is complete, run the installer. You can generally accept the default settings. The most important components to install are Apache, MySQL, and PHP.
  3. Launch the XAMPP Control Panel: After installation, open the XAMPP Control Panel. This is your command center for managing the local server.
  4. Start Apache and MySQL: In the control panel, click the "Start" button next to both the Apache and MySQL modules. They should turn green, indicating that they are running successfully.
  5. Verify the Installation: Open your web browser and navigate to http://localhost. You should see the XAMPP dashboard, confirming that your local server is working!

Step 2: Installing a Code Editor

While you can write code in a simple text editor, a dedicated code editor provides features like syntax highlighting, code completion, and debugging tools that will make your life much easier. For this course, we highly recommend using Visual Studio Code (VS Code).

VS Code is free, open-source, and has a massive library of extensions that can enhance your PHP and web development workflow.

Download Visual Studio Code

Step 3: Creating the Project Folder Structure

A well-organized project is easier to manage, debug, and scale. We'll create our project inside the htdocs folder of your XAMPP installation (usually located at C:\xampp\htdocs on Windows).

Navigate to your htdocs directory and create a new folder named bakery-management-system. Inside this folder, create the following sub-folders:

bakery-management-system/
├── admin/            # Admin panel files
├── assets/           # CSS, JS, images
│   ├── css/
│   ├── js/
│   ├── images/
├── includes/         # Reusable components (header, footer, db connection)
├── modules/          # Core feature files (products, orders, users)
└── index.php         # Main entry point of the application
                            

This structure separates our concerns: the admin area is distinct, shared assets are grouped together, and reusable code snippets are kept in one place. This will be our foundation for the entire project.