How rajeshekambaramm/shipyard works
What this project is (type + purpose)
From the file tree and README, this is a classic server-rendered PHP website (no obvious framework) backed by a MySQL database.
Signals:
• Many top-level *.php pages (index.php, about.php, contact.php, rooms.php, hotels.php, etc.) → page-per-route style PHP app.
• db.php → central DB connection/utility include.
• cwmsdb.sql → database schema + seed data dump.
• login.php, logout.php, signup.php → authentication flows.
• tender.php, submit_tender.php → tender listing + tender submission workflow.
• README only provides admin credentials → implies an admin role exists, likely gated by login and DB roles/flags.
How to read the file structure into architecture
• common DB access via db.php
• session/auth state via PHP sessions (implied by login/logout)
• shared schema in cwmsdb.sql
Suggested functional groupings (to turn flat files into components)
Public site / informational pages
• index.php, about.php, contact.php, location.php
• possibly one.php…five.php, two.php, three.php, four.php (these look like static sections or feature pages)
Domain feature pages (shipyard content)
• drydocks.php, vigilence.php, sr-expertise.php, sr-facilities.php, sb-facility.php, sb-technology.php, sp.php
• hotels.php, rooms.php (may be ancillary or reused template content; still represent as “Content/Services pages”)
Identity & access
• login.php, logout.php, signup.php
• Admin account exists (README), so there is likely an “admin-only” branch of pages/behaviors.
Tender workflow
• tender.php (view tenders / tender portal)
• submit_tender.php (POST handler / form processing)
• storage.php (if used to store tender documents or manage uploads)
Infrastructure / integration
• db.php → DB connector (and possibly shared query helpers)
• cwmsdb.sql → DB schema (tables for users/admin, tenders, maybe messages/contact forms, content)
• Dummy.pdf, Readmore.pdf → static assets (served by web server)
Filesystem storage (if storage.php/tenders store documents)
Relationships:
• Browser → Web Server/PHP (HTTP requests to *.php)
• PHP runtime → MySQL (queries via credentials defined in/through db.php)
• PHP runtime → Filesystem (uploads/downloads)
• “PHP Sessions” (for auth)
• “Server-rendered HTML” (response type)
• “Form POSTs” (for login/signup/tender submission)
Goal: separate “as many components as possible” even though it’s not structured—do it conceptually.
Components as:
• Auth Pages: login.php, signup.php, logout.php
• Tender Pages: tender.php, submit_tender.php
• Content Pages: index.php, about.php, contact.php, etc.
• Specialized service pages: drydocks.php, sr-*, sb-*, vigilence.php, etc.
• Shared DB layer:
• db.php as “DB Connection / Query Helper”
• Domain services (conceptual):
• “User Service” (register/auth/session)
• “Tender Service” (create/view tenders, validate, store docs)
• “Content/Pages” (static/dynamic content)
• “File Storage Service” (if files are uploaded/downloaded via storage.php)
Data flows to show:
• Login: Browser → login.php → db.php → MySQL → session set → response/redirect
• Signup: Browser → signup.php → db.php → MySQL
• Tender submit: Browser → submit_tender.php → validation → (MySQL insert) + (optional file write) → redirect to tender.php
• Admin: Browser(Admin) → admin-only actions (identify which pages once confirmed) → MySQL updates
Architectural patterns/design principles to highlight (what matters here)
Even without frameworks, the architecture typically follows:
• Server-side rendered pages (PHP generates HTML)
• Shared include for database connectivity (db.php) → single point of DB configuration
• Session-based authentication (login/logout)
• Monolithic deployment (all PHP pages deployed together)
• Direct DB access from page controllers (common in simple PHP sites)
• Trust boundaries: Internet ↔ Web server; internal network ↔ DB
• State: Sessions stored server-side (file-based or in-memory depending on PHP config; note as “PHP session storage (default filesystem)” unless you confirm otherwise)
• Validation/security choke points: login, signup, tender submission, file handling
• Visitor / User / Admin → Shipyard PHP Web App → MySQL (+ optional filesystem)
• Browser
• Web Server (Apache/Nginx) + PHP runtime (sessions)
• MySQL (cwmsdb)
• Filesystem (uploads/static PDFs)
• Auth module (login/signup/logout)
• Tender module (tender/submit_tender/storage)
• Content module (index/about/contact/location + service pages)
• DB connection (db.php)
• Data store (MySQL tables; annotate once confirmed by reading cwmsdb.sql)