Project Documentation

Set up RecipeHub on a different server, explore the file structure, and learn about the database schema.

1. Requirements

RecipeHub was built with HTML for front-end, CSS for UI styling, PHP and JS for back-end, and uses a MySQL database.
To build and host RecipeHub, you would need:

2. Installation Steps

  1. Start Apache and MySQL.
  2. Clone or download the project into your `htdocs/` folder (XAMPP) or your web host's public directory.
  3. Create your RecipeHub database in phpMyAdmin.
  4. Open your browser and run the PHP script: /config/db_setup.php to create the necessary tables.
  5. Update DB credentials in /config/db_config.php.
  6. Edit /config/constants.php to match your server's URL and folder paths.
  7. Include your Spoonacular API key in the PHP script: /assets/scripts/php/fetch_api_recipes.php.
  8. Open your browser and open /assets/scripts/php/fetch_api_recipes.php to populate the resipes table with Spoonacular recipes.
  9. Access http://localhost/your-folder/public/index.php in your browser.

3. Folder Structure

The RecipeHub folder structure is organized for modularity, scalability, and ease of development. Assets, configurations, and public-facing scripts are clearly separated to support team collaboration, maintain clean code practices, and simplify deployment.


/root │ ├── /assets → Static files (media, scripts, styles) │ ├── /img → Image assets │ │ ├── /profiles → User profile pictures │ │ ├── /thumbnails → Recipe thumbnails │ │ └── /wiki → Wiki-related images │ ├── /includes → PHP snippet files (navbar, footer, etc.) │ ├── /scripts │ │ ├── /js → JavaScript script │ │ └── /php → Reusable backend PHP scripts │ └── /styles │ ├── /templates → Shared CSS templates (e.g., header, sidebar) │ └── /themes → Theme-specific stylesheets │ ├── /config → Site and database configuration │ ├── constants.php → URL paths and global constants │ ├── db_config.php → Database connection settings │ └── db_setup.php → Auto-create database schema │ ├── /docs → Project documentation │ └── /wiki → All wiki/help pages │ ├── /public → Public-facing entry points │ ├── /admin → Admin-only tools and dashboard │ ├── /recipe → Add/view/edit recipes │ ├── /user → Profile, settings, and user pages │ ├── about.php → About the website │ ├── contact.php → Contact website creator │ ├── index.php → Homepage │ ├── login.php → Login form │ └── register.php → Registration form └──

4. Database Schema (Simplified)

Table: users
Stores all user account information including login credentials, profile details, and admin status.


Table: recipes
Contains all user-submitted and API-sourced recipes, including dietary filters, metadata, and ownership.


Table: favourites
Tracks which users have favorited which recipes to enable personalized recipe collections.


Table: comments
Stores user comments on recipes to support community feedback and discussion.

5. User Features

6. Admin Features

7. API Integration

This app uses the Spoonacular API to fetch recipes for the Explore page.

Your API key should be saved in your fetch_api_recipes.php script and referenced when needed. Avoid exposing it in public repositories.

8. Customization