How mohit-ql/tgoms works
Project type and purpose
• From the file tree and the minimal README (“# tgoms”), we see this is a legacy, full-stack PHP web application—likely an Order Management System (OMS) given file names like neworderform.php, orderGoods.php, oms.js, and Templates/OMS.dwt.php.
• Key indicators:
• A suite of .php pages at the root handling forms and workflows (findClient.php, orderUpdate.php, printAll.php, etc.)
• A database.php file (model/DB adapter).
• config.php for configuration (DB credentials, site settings).
• A Templates folder with .dwt.php Dreamweaver templates (view layer).
• JavaScript (CalendarPopup.js, oms.js) and multiple CSS files for layout and print styling (printStyles*.css, style.css).
File structure
• Top-level PHP files each implement a “screen” or controller action—e.g., neworderform.php, search.php, viewOrder.php.
• control.php may serve as a front-controller or shared request dispatcher.
• database.php encapsulates all database calls.
• Templates/OMS.dwt.php provides HTML skeletons; header.php/footer.txt act as includes.
• Static assets: JavaScript in root and calendar popup, CSS in root, an image (hli906l3.bmp), a CSV (statecityUSonly.csv).
• No distinct “frontend” directory; this is a monolithic PHP app. No visible microservices or Node/modern framework.
README
• README has only the project name. No explicit architecture section. All architectural insight must come from file names and conventions.
a. Main components:
• Client Browser (UI layer)
• Web Server (Apache/IIS with .htaccess configuration)
• PHP Application Layer
– Front Controller (control.php)
– Individual Controllers/Pages (neworderform.php, search.php, etc.)
– View Templates (Templates/OMS.dwt.php, header.php, footer.txt)
– Model/DB Layer (database.php)
• Data Storage
– Relational Database (MySQL, PostgreSQL, etc.)
– Flat files (statecityUSonly.csv)
– Static assets (CSS, JS, images)
• External Services (if any): e-mail service, calendar popup JS library
b. Relationships & Interactions:
1. Browser sends HTTP requests to Web Server.
2. Web Server routes requests (via .htaccess) to PHP front controller or directly to page scripts.
3. PHP controller invokes database.php for CRUD operations.
4. database.php communicates with Database.
5. Controllers load Templates and include header/footer, produce HTML.
6. Response sent back to Browser.
7. Browser fetches CSS/JS assets and renders interactive UI.
c. Architectural patterns/design principles:
• MVC-style separation (Controllers in .php pages, Models in database.php, Views in Templates/*.dwt.php).
• Front-Controller pattern (control.php may centralize routing).
• Template Inclusion (Dreamweaver templates + PHP includes).
• Layered architecture (Presentation → Application → Persistence).
d. Key technologies/frameworks/libraries:
• PHP 5.x or 7.x on Apache (with .htaccess rules).
• MySQL or similar RDBMS (invoked via database.php).
• JavaScript libraries: CalendarPopup.js, custom oms.js.
• CSS for screen & print (style.css, printStyles.css variants).
Essential elements
• Don’t overcomplicate: focus on the layered separation and main data flows.
• Every .php file type as “Controller” to illustrate how each HTTP action is handled.
• Template folder and the database abstraction layer.
• Static file serving so reviewers understand where CSS/JS/CSV reside.