# Harry Blaze Concepts - System Manual

Welcome to the **Harry Blaze Concepts** system manual. This document provides a comprehensive guide for customers, administrators, and developers on how to use, manage, and maintain the platform.

---

## 1. System Overview
Harry Blaze Concepts is a high-end Print-On-Demand (POD) and content-rich platform built specifically for the Abuja market. It combines a professional e-commerce experience for custom printing services with an extensive blog system tailored to the professional and cultural landscape of Nigeria's capital.

### Key Features
- **Professional Product Catalog**: Custom T-shirts, business cards, flyers, mugs, banners, and more.
- **Dynamic Shopping Cart**: Session-based cart with variation support (size, material, finish).
- **Streamlined Checkout**: Secure guest and user checkout with delivery zone calculation.
- **Order Tracking**: Real-time status tracking via unique tracking codes.
- **Content-Rich Blog**: SEO-optimized articles with deep Abuja-specific context.
- **Admin Dashboard**: Comprehensive management of orders, products, blog posts, and system settings.

---

## 2. Getting Started

### Requirements
- **PHP**: 8.0 or higher
- **Database**: SQLite3
- **Web Server**: Apache or Nginx (with URL rewriting enabled)
- **Extensions**: `pdo_sqlite`, `mbstring`, `gd`

### Installation
1. **Setup Files**: Upload the project directory to your web server.
2. **Initialize Database**: Run the following command in your terminal to create the database and default admin account:
   ```bash
   php database/init.php
   ```
3. **Set Permissions**: Ensure the following directories are writable by the web server:
   - `/database`
   - `/uploads` (including subdirectories `designs` and `proofs`)
4. **Configuration**: Edit `config/config.php` to set your `APP_URL` and other environment-specific settings.

---

## 3. Customer Guide

### Browsing & Ordering
1. **Products**: Navigate to `/products` to see available printing services.
2. **Variations**: Select specific options (e.g., Business Card finish: Spot UV, Matte, or Gloss).
3. **Cart**: Add items to your cart. You can update quantities or remove items before proceeding.
4. **Checkout**: Provide your delivery details and notes for your design.
5. **Payment**: Follow the instructions on the checkout success page to make a manual payment (Bank Transfer).

### Tracking Orders
1. Go to the **Track Order** page.
2. Enter your unique **Tracking Code** (e.g., HB-XXXXXXXX).
3. View your order's current status:
   - `Pending Payment`: Awaiting your bank transfer verification.
   - `Payment Verified`: Payment confirmed; production starting soon.
   - `Printing`: Your order is currently in production.
   - `Quality Assurance`: Final checks being performed.
   - `Shipped`: Your order is with the delivery team.
   - `Delivered`: Order has reached your destination.

---

## 4. Admin Guide

### Login
Access the admin panel at `/admin/login`. 
*Default credentials are provided during installation (`admin` / `admin123`). Change these immediately.*

### Dashboard
The main admin screen provides a snapshot of:
- Total orders and revenue.
- Recent order activity.
- Quick links to manage products and blog posts.

### Managing Orders
- **View Orders**: See a list of all orders with their current status.
- **Update Status**: Move orders through the workflow (e.g., from `Printing` to `Shipped`).
- **Verify Payment**: Manually confirm receipt of bank transfers to trigger the production workflow.

### Product Management
- **Add Product**: Create new printing services with descriptions and images.
- **Variations**: Add specific price points for different sizes, materials, or finishes.
- **Control**: Toggle products as "Active" or "Inactive" to show/hide them from customers.

### Blog Management
- **Drafting**: Create SEO-rich articles using the built-in editor.
- **Categories**: Organize posts into relevant sections (e.g., Business, Events, Technology).
- **SEO Tools**: Set custom meta titles, descriptions, and keywords for each post to maximize search engine visibility in the Abuja market.

---

## 5. Technical Architecture

### Directory Structure
- `/public`: The only directory that should be web-accessible. Contains `index.php` (entry point).
- `/app`: MVC components.
  - `/controllers`: Request handling logic.
  - `/models`: Database interaction logic.
- `/core`: Base system classes (Database, Router, Auth, Helpers).
- `/views`: HTML templates organized by layout and role (Public vs. Admin).
- `/config`: System-wide constants and configuration.
- `/database`: SQLite database file and schema definitions.
- `/uploads`: Storage for customer designs and admin proofs.

### Routing
The system uses a custom RESTful router defined in `public/index.php`. Routes map URLs to specific controller methods.

### Database Schema
The system uses a relational SQLite structure:
- `users`: Customer account data.
- `admins`: Administrative account data.
- `products` & `product_variations`: Catalog data.
- `orders` & `order_items`: Transactional data.
- `blog_posts`: Content and SEO data.
- `settings`: Key-value store for application settings (Bank details, Store name, etc.).

---

## 6. Maintenance & Security

### Security Best Practices
- **CSRF Protection**: All forms include a CSRF token to prevent cross-site request forgery.
- **SQL Injection**: All database queries use PDO prepared statements.
- **XSS Prevention**: User input is sanitized and escaped before being rendered in views.
- **Password Hashing**: Admin and User passwords are encrypted using `password_hash()` (bcrypt).

### Updates
- **Settings**: Update your bank account details and support information in **Admin > Settings**.
- **Delivery Zones**: Configure delivery fees for different areas of Abuja in the **Delivery Settings** section.

---

## 7. Support
For technical issues or feature requests, contact the development team or refer to the `README.md` for advanced deployment instructions.

**Harry Blaze Concepts - Premium Printing for the Capital.**
