Cheat sheet · Build products
Backend development cheat sheet (PHP)
Opens with creditsA quick-revision companion to the backend roadmap, for anyone building the server side of real products. Read a chapter before a project, an exam or a technical conversation, and use the glossary to refresh a term you half remember.
Chapters
9 chapters · 76 concepts
1Modern PHP and Laravel essentialsHow PHP serves requests, the modern language features worth using, and how Laravel wires services and models together.7 concepts
- 1The PHP request lifecycleClassic PHP is share-nothing: PHP-FPM boots the app for each request and throws all state away at the end.
- 2Modern PHP types, enums and readonlyPHP 8 has typed properties, union types, backed enums,
readonlyproperties and classes,matchand constructor property promotion. - 3Composer and autoloadingComposer installs packages from Packagist and generates a PSR-4 autoloader that maps namespaces to folders.
- 4Laravel service containerLaravel builds your classes and resolves their constructor dependencies automatically.
- 5Eloquent models and relationshipsEloquent is Laravel's Active Record ORM: each model maps to a table, and methods like
belongsToandhasManydefine relationships you can query and eager… - 6PHP arrays and collectionsA PHP array is both an ordered list and a key-value map.
- 7PHP errors and exceptionsModern PHP throws exceptions for most failures, handled with try, catch and finally.
7 in this chapterOpen this chapter2Terminal and GitThe two tools every backend task starts with: moving around a machine in a shell, and keeping every change in version control.3 concepts
- 1Terminal essentialsA shell runs commands such as
cd,ls,cat,grepandcurl, and pipes (|) feed one command's output into the next. - 2Git commits and branchesGit records snapshots of your project as commits.
- 3Pull requestsA pull request proposes merging a branch into main and shows the diff, CI results and review comments in one place.
3 in this chapterOpen this chapter- 1Terminal essentialsA shell runs commands such as
- How HTTP worksWhat happens between a client and your server: finding it, connecting securely and exchanging requests and responses.6 conceptsOpens with credits
- Relational databases and SQLModel data, query it by hand, index it for real queries, keep it consistent with transactions and understand what the ORM does for you.10 conceptsOpens with credits
- Designing and building APIsTurn the database into a contract other programs rely on: resources, validation, errors, pagination, safe retries, versioning and documentation.10 conceptsOpens with credits
- Authentication and API securityDecide who is calling and what they may do, store secrets safely and close the holes attackers try first.10 conceptsOpens with credits
- Caching, queues and performanceMeasure first, then make the service fast: cache the right things, keep slow work out of the request path and use database connections wisely.10 conceptsOpens with credits
- Testing, CI/CD and deploymentBuild the safety net that lets you change code without fear: tests against a real database, a pipeline on every push and a container you can deploy and roll back.10 conceptsOpens with credits
- Architecture and reliabilityHow services are split, how they talk and how they fail, and the patterns that keep a system up and traceable when a dependency is slow or down.10 conceptsOpens with credits
- 10Glossary, A to ZEvery concept in the sheet and the smaller terms it uses, in one list.181 terms
About this sheet
APIs, databases, auth, deploys.
Related on Sefism
Picked from the other libraries by shared topics.
Roadmaps
See allBest practices
See all- REST API Design Best PracticesDesign HTTP APIs clients enjoy using: resources and URLs, methods, status codes, problem details errors, pagination, idempotency keys, ETags, versioning and OpenAPI.
- TypeScript Best PracticesModern TypeScript best practices for 2026: strict settings, TypeScript 7, modeling data with unions, safe narrowing, runtime validation, generics and typed linting.
- Authentication Best PracticesBuild sign-in that holds up: password rules from NIST, Argon2id hashing, login throttling, MFA and passkeys, secure sessions and safe account recovery.
Checklists
See all- Production Readiness ChecklistCheck a service before it takes real traffic: ownership, SLOs, capacity, timeouts and retries, alerts, rollout and rollback, backups, security and on-call.
- API Security ChecklistCheck your REST or GraphQL API against the OWASP API Security Top 10: authentication, object authorization, rate limits, input validation, SSRF, CORS and logging.
- Database Migration ChecklistCheck a schema or data migration before it ships: expand and contract, lock behaviour, online indexes, batched backfills, rehearsal on real data, backups, rollback, deploy order and monitoring.
Project structures
See all- Express with TypeScript project structureFor students who know a bit of JavaScript and want a backend that looks like the ones teams actually run. Express gives you almost no structure, so this layout supplies it: one folder per feature under src/modules, each split into routes, controller, service and repository, with Zod at the edge and Vitest plus Supertest for tests.
- NestJS project structureFor people who want a structured TypeScript backend with clear rules about where code goes. Every feature is a Nest module that owns its controller, service, DTOs, entities and tests, so the app grows by adding folders, not by stretching old ones. The tree follows one orders API from nest new to a codebase a whole team can run for years.
- FastAPI project structureA typed Python API for an orders app, built the way the FastAPI docs and the official full stack template lay it out: one
apppackage, a router per feature, Pydantic schemas at the edges, services in the middle and SQLAlchemy models with Alembic migrations underneath. For students who have finished the FastAPI tutorial and want to know where the second, tenth and fiftieth file go.
Career questions
See all- How do I choose between frontend, backend, mobile, cloud, cybersecurity, data and AI without trying them all for years?Do not try to pick the best field; pick the one whose daily problems you can tolerate on a bad day. Run a short, cheap experiment in two or three candidates, compare what you enjoyed doing rather than what sounded exciting, check the local job market, and commit for six to nine months.
- Should I use Firebase or Supabase for my app?Both let you ship an app fast with auth, a database, storage and hosting-style services. Supabase is built on PostgreSQL, so it suits relational data and SQL skills you will reuse anywhere. Firebase is a mature Google platform with a document database and strong mobile tooling. Choose by your data shape, your platform, and how much you want to learn transferable database skills.
- What should I learn to become a web developer, and in what order?Learn the web platform first (HTML, CSS, JavaScript, how HTTP works), then one frontend framework, then a backend with a database, and build a real project at each stage. If you already know WordPress, you are not starting over: your HTML, CSS and PHP experience transfers.
Work with me
Stuck on something specific?
Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.
- 1:1 Mentorship
- Fresh Graduate Mentorship
- Career Guidance
Brand deals, promos and partnerships: tauseeffayyaz@gmail.com