File manager - Edit - /home/webapp69.cm.in.th/u69319090048/shop69319090048/website_blueprint_dfd.txt
Back
================================================================================ MINIMALIST T-SHIRT STORE - DFD SPECIFICATION ================================================================================ This document outlines the Data Flow Diagram (DFD) blueprint of the e-commerce application across three hierarchical levels (Level 0, Level 1, and Level 2) along with a comprehensive Data Dictionary. ================================================================================ 1. SYSTEM CONTEXT & EXTERNAL ENTITIES ================================================================================ The system interfaces with three distinct external entities: 1. Guest / Customer (Public User) - Views homepage showcases, selects configuration details, builds shopping bags, provides delivery details, and places simulated orders. 2. Administrator (Privileged User) - Performs credential authentication, views shop analytics/daily visitor counts, and manages the product catalog (add, update, delete products). 3. Browser Local Storage (Theme Engine) - Persists theme preferences (light/dark mode configuration) across requests without relying on DB queries. ================================================================================ 2. LEVEL 0 DFD (CONTEXT DIAGRAM) ================================================================================ The Context Diagram displays the boundary of the application (single central process) and the data streams flowing between it and external entities. +--------------------------------+ | GUEST / CUSTOMER (ENTITY) | +--------------------------------+ | ^ | [A] | [B] v | +------------------------------------------------------+ | | | 1.0 MINIMALIST T-SHIRT STORE | | (CENTRAL SYSTEM) | | | +------------------------------------------------------+ ^ | | [C] | [D] v v +--------------------------------+ | ADMINISTRATOR (ENTITY) | +--------------------------------+ Incoming & Outgoing Flows: ------------------------- * [A] Inputs from Customer: - Catalog Browsing/Configuration Selections (product tier, size, trade-in, warranty) - Bag updates (quantity, items to delete) - Delivery details (email, phone, name, address, payment method selection) * [B] Outputs to Customer: - Tailored UI View (Light/Dark themes, dynamic prices) - Shopping Bag configuration overview and subtotal costs - Simulated purchase confirmation/text-only order receipt * [C] Inputs & Queries from Administrator: - Authentication credentials (username, password) - Dashboard analytics queries - Product Catalog CRUD data (title, translation names, prices, features, specifications) * [D] Outputs to Administrator: - Access validation status & active session tokens - Analytics visual reports (Total revenue, order count, visitor sparklines) - Catalog modification status (success/error messages) ================================================================================ 3. LEVEL 1 DFD (DECOMPOSED MAJOR PROCESSES) ================================================================================ The Level 1 diagram breaks the system down into its core functional sub-systems and details their access to the primary database stores. +--------------------------------+ | GUEST / CUSTOMER (ENTITY) | +--------------------------------+ | | ^ [Config Request] | | [Checkout] | [HTML View/Receipt] v v | +-----------------+ +----------------------------------+ | 1.0 CONFIGURATOR| | 3.0 TRANSACTION PROCESSING | | & CATALOG VIEW | | (Bag, Checkout, Success) | +-----------------+ +----------------------------------+ | | | Reads | Reads | Writes | Logs v v | +---------------+ +---------------+ | | D1 PRODUCTS | | D2 SESSION | | | (TABLE) | | (BAG STATE) | | +---------------+ +---------------+ v ^ ^ +---------------+ Writes| Reads| | D3 ANALYTICS | | | | (TABLE) | +-----------------+ | +---------------+ | 2.0 CATALOG CRUD| | ^ | (ADMIN) | | | Reads +-----------------+ | | ^ | | | [CRUD Data] | | +-----------------------+--------------------+ ^ [Dashboard] | [Admin Credentials] | +--------------------------------+ | ADMINISTRATOR (ENTITY) | +--------------------------------+ | v +-----------------+ | 4.0 ADMIN | | AUTHENTICATION | +-----------------+ Major Processes: - Process 1.0 (Configurator & Catalog View): Handles querying D1 (Products) to display active items on index.php and calculate pricing configuration in real time. - Process 2.0 (Catalog CRUD): Privileged database management for adding, editing, and deleting product records from D1 (Products). - Process 3.0 (Transaction Processing): Orchestrates session bag memory (D2), subtotal accumulation, contact/shipping validation, order success, and logging items sold & order requests to D3 (Analytics). - Process 4.0 (Admin Authentication): Validates login attempts against static definitions in config.php. ================================================================================ 4. LEVEL 2 DFD (GRANULAR SUB-PROCESS BREAKDOWN) ================================================================================ Below is the detailed flow for Process 3.0 (Transaction Processing), detailing the progression from a customized product choices configuration to order finalization. GUEST ENTITY | | (Size, Trade-In, Warranty) v +--------+ | 3.1 | | CONFIG |-----> [Calculates Single Price] | PRODUCT| (Base Price + Warranty Cost - Trade-in Discount) +--------+ | | (Product ID, Size, Trade-In, Warranty, Single Price) v +--------+ +------------------------+ | 3.2 |------>| D2 SESSION (BAG STATE) | | MANAGE | +------------------------+ | BAG |<------ [Calculates Subtotal] +--------+ | | (Checkout Initiated) ----> [Triggers track_order_request()] ----> (D3 Analytics) v +--------+ | 3.3 | | CAPTURE|-----> [Validates Contact & Shipping details] | SHIPPING| [Validates Payment Method Selected] +--------+ | | (Order Submitted) v +--------+ +---------------+ | 3.4 |------>| D3 ANALYTICS | (Logs: items_sold, amount_sold) |FINALIZE| +---------------+ | ORDER |------> [Resets D2 Session Bag State to Empty] +--------+ | | (Simulated Text Receipt HTML) v GUEST ENTITY Attribute Level Data Flows: - 3.1 to 3.2: `product_id` (string), `size` (string), `trade_in` (string), `warranty` (string), `single_price` (decimal), `quantity` (int) - 3.2 to 3.3: `unique_key` (md5 hash string), `subtotal` (decimal) - 3.3 to 3.4: `email` (string), `phone` (string), `fullname` (string), `address` (string), `city` (string), `zipcode` (string), `payment_method` (string) - 3.4 to D3: `date` (date), `items` (int count), `amount` (decimal order sum) ================================================================================ 5. DATA DICTIONARY ================================================================================ -------------------------------------------------------------------------------- A. DATA STORES -------------------------------------------------------------------------------- 1. D1: `products` (Database Table) Keeps records of the catalog items available for configurations. - `id` (VARCHAR(50), Primary Key): URL friendly product slug or ID. - `name` (VARCHAR(255)): Product label (English). - `thai_name` (VARCHAR(255)): Product label (Thai). - `tier` (VARCHAR(50)): Product category (Basic, Pro, Luxury). - `price` (DECIMAL(10,2)): Base price before discounts or care adjustments. - `tagline` (TEXT): Subtitle slogan (English). - `thai_tagline` (TEXT): Subtitle slogan (Thai). - `description` (TEXT): Core product copy (English). - `thai_description` (TEXT): Core product copy (Thai). - `image_url` (VARCHAR(500)): Local upload location path or remote image URL. - `specs` (TEXT): JSON encoded string containing array of specifications. - `thai_specs` (TEXT): JSON encoded string containing array of specifications (Thai). 2. D2: `$_SESSION['bag']` (PHP Session Array Store) Temporary memory containing items currently in the cart. Keyed by an MD5 hash of the unique selection: md5(product_id + '_' + size + '_' + trade_in + '_' + warranty). - `product_id` (string) - `size` (string) - `trade_in` (string) - `warranty` (string) - `single_price` (float) - `quantity` (integer) - `discount` (float) - `warranty_cost` (float) 3. D3: `analytics` (Database Table) Aggregates administrative and storefront conversion parameters per calendar day. - `date` (DATE, Primary Key): Date in YYYY-MM-DD format. - `visitors` (INT): Unique session hits during the calendar day. - `order_requests` (INT): Number of visitors moving to checkout.php page. - `items_sold` (INT): Cumulative counts of physical items purchased. - `amount_sold` (DECIMAL(10,2)): Total sales revenue accumulated on success.php. -------------------------------------------------------------------------------- B. DATA ELEMENTS (CORE FLOW ATTRIBUTES) -------------------------------------------------------------------------------- - `trade_in` (Status Selection): * "No Trade-in" (Discount: $0.00) * "Recycle Condition" (Discount: $3.00) * "Good Condition" (Discount: $7.00) * "Excellent Condition" (Discount: $12.00) - `warranty` (Tee Care+ Selection): * "No Tee Care+" (Cost: $0.00) * "1-Year Tee Care+" (Cost: $9.00) * "2-Year Tee Care+" (Cost: $19.00) - `payment_method` (Choice values): "card", "apple", "google", "paypal" - `session_id` (String): Default PHP session cookie used to map unique visitors. ================================================================================
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.5 |
proxy
|
phpinfo
|
Settings