Red Thread Project — Build and deploy a complete PHP web application, from A to Z
- Goal: design a real web application (for example a blog, a mini-CMS, a simple shop, a task manager) and take it to production: dynamic pages, database, user accounts, cleanly structured (MVC, ideally a framework), secured, backed by tests, then deployed.
- Materials: the PHP cheat sheet below (reflexes, concepts, watch points) to keep at hand.
- Method: one step per level. Get to grips with the environment, learn the language basics, handle the web (forms, sessions), add database and OOP, structure with a framework and an API, then go professional (patterns, performance, Docker) and deploy.
⬇️ Download the PHP cheat sheet (TXT)
Step 0 · Level 0 — Getting started (L0)
Install a local environment (XAMPP/Laragon), understand the request → PHP → HTML cycle, and write your first scripts (tags, echo, comments) — mixing PHP and HTML.
Step 1 · Level 1 — Language basics (L1)
Master variables/types/operators (===!), conditions, loops (especially foreach), functions (parameters, scope, typing), arrays and strings. The foundation of all logic.
Step 2 · Level 2 — PHP & the Web (L2)
Handle forms ($_GET/$_POST) with SERVER-SIDE validation (never trust input), manage sessions/cookies (simple authentication, hashed passwords), includes and files (secure uploads), dates/regex/emails.
Step 3 · Level 3 — Databases & OOP (L3)
Persist with MySQL and PDO (PREPARED STATEMENTS — security), move to OOP (classes, encapsulation, inheritance, interfaces), organize with namespaces/autoloading/Composer, and secure (SQL injection, XSS, CSRF, hashing).
Step 4 · Level 4 — Frameworks & APIs (L4)
Understand MVC, then build with a FRAMEWORK (Laravel: routing, Blade, Eloquent, migrations — or Symfony). Expose a secure REST API (JWT) if needed. Harden with tests (PHPUnit).
Step 5 · Level 5 — Going professional & deploying (L5)
Improve design (design patterns, SOLID — with judgment), optimize (OPcache, cache/Redis, database). Containerize with Docker (+ Compose). Deploy (shared/PaaS/VPS via Git), manage production secrets/HTTPS/config, and automate with CI/CD.
Success criteria
- Real hands-on basics: a working local environment, the request → PHP → HTML cycle understood, language fundamentals mastered (===, foreach, typed functions).
- A dynamic and SAFE web application: server-side validated forms, sessions/authentication (hashed passwords), database via PDO with PREPARED STATEMENTS, and protection against flaws (SQL injection, XSS, CSRF).
- STRUCTURED code: OOP (classes, encapsulation), modern organization (namespaces, Composer), MVC architecture — ideally via a framework (Laravel/Symfony) — and backed by tests (PHPUnit).
- Professional production release: application deployed and accessible online (via Git), secrets outside the code (environment variables), HTTPS, production configuration (hidden errors, OPcache), ideally with a CI/CD pipeline — the full cycle, from idea to reliable online service.