Search

Lessons (40)

  • Frontend Testing Strategy

    What to test and how. The testing trophy, unit tests with Vitest, component tests with Testing Library, API …

  • Hexagonal Architecture (Ports & Adapters)

    … Driving vs driven sides, a complete TypeScript example, testing with fake adapters, and how to structure the folders …

  • Code Smells & Refactoring

    … nothing leaves, it just ends up in the right place. mermaid flowchart LR T1["βœ… Tests pass"] -- S["Make …

  • D β€” Dependency Inversion Principle

    … new SesMailer(awsConfig), }); // Tests: plain fakes, no network const sent = []; const testService = new OrderService({ orderRepository: { save: async () = {} }, mailer …

  • Deploying & Operating Microservices

    … own tests and its own pipeline. mermaid flowchart LR C[πŸ’» Commit] -- B["πŸ”¨ Build<br/ + unit tests"] -- I["🐳 Docker …

  • Onion Architecture & Clean vs Hexagonal vs Onion

    … infrastructure, UI, tests Implementations of the interfaces, web framework, DB, external APIs SqlOrderRepository , controllers, EF Core / Prisma mermaid …

  • Clean Architecture

    … No database, no network, milliseconds per test. js test("rejects duplicate emails", async () = { const userRepository = new InMemoryUserRepository([{ id …

  • Clean Architecture in Depth

    … Entities, use cases, input and output ports, presenters, crossing boundaries with DTOs, "screaming" folder structure, testing, and common …

  • MVC, MVP & MVVM

    … Keeping these three apart means you can redesign the screen without rewriting the news, and test the producer …

  • YAGNI: You Aren't Gonna Need It

    … Clean, tested code is what lets you change safely later. - Do think ahead for decisions that are expensive …

  • DRY: Don't Repeat Yourself

    … s]+\.[^@\s]+$/.test(email)) throw new Error("Invalid email"); // profile.js if (!/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(email)) throw …

  • O β€” Open/Closed Principle

    … is risky Every time you open a working, tested function to add an else if , you risk breaking …

  • DSA Interview Patterns Cheat Sheet

    … Interviews test whether you can recognise the pattern from the wording, then apply its template. Pick a technique …

  • What Is Software Architecture?

    … in under a week Testability Can we verify it quickly? Business rules testable without a database Security Is …

  • Design a File Storage Service

    … Metadata-owned ACL/capability Device sync Versioned change feed/conflict policy Object-store durability still needs recovery testing.

  • Capacity, Availability, Latency and CAP

    … A 99.9% monthly target allows about 43 minutes of downtime; redundancy and tested recovery make the target …

  • Creational Patterns: How to Make Objects

    … they make testing harder (tests share state) and hide dependencies. Prefer creating one instance in your composition root …

  • I β€” Interface Segregation Principle

    … Any change to User can affect it, // and it is hard to reuse or test. function Avatar({ user …

  • Debug Latency Like an Investigator

    … img/system-design-l6/latency-investigation.svg) Symptom Test first --- --- p50 and p99 rise Broad capacity, network, deploy …

  • Transactions, Indexes & Concurrency

    … Restore-tested independent backups remain necessary.

  • KISS: Keep It Simple, Stupid

    … C -- O[Slower onboarding] C -- T[Harder to test] B & R & O & T -- Cost["πŸ’Έ Every change costs more …

  • Storage Engines & Database Operations

    … Keep independent backups, define retention, encrypt them, and test restoring a realistic dataset into an isolated environment. Know …

  • Layered (N-Tier) Architecture

    … So business rules end up shaped by database tables, and testing a service needs a real (or heavily …

  • ACID, Transactions & Locks

    … constraints and short-lived locks. The bank-transfer test A transfer moves 100 from A to B. If …

  • Choosing an Architecture

    … and driven sides Many entry points, swappable integrations, testability Ports for things that never change Onion Rings around …

  • Behavioral Patterns II: Chain, Template, Iterator, Mediator, Memento, Visitor

    … ve used it: React class lifecycle methods, test frameworks ( beforeEach β†’ test β†’ afterEach ), NestJS lifecycle hooks. πŸ’‘ Modern alternative: pass …

  • SOLID at a Glance

    Five design principles that keep object-oriented and modular code easy to extend, test and change. One picture …

  • S β€” Single Responsibility Principle

    … since {formatMemberSince(user.createdAt)}</p </div ; } How to test for SRP Ask these questions about any class or …

  • What Is Clean Code?

    … Does each function or class do one thing? Tested Can I change it and quickly know if I …

  • Which Pattern Do I Need?

    … function first Singleton abuse Global state everywhere, flaky tests Dependency injection God object One class that knows and …

  • Comments & Formatting

    … Code is executed and tested; comments are not. Comments that help Type Example --- --- Why (a decision) // Use insertion …

  • React vs Vue vs Angular

    … everything built in (router, forms, HTTP, DI, testing), with strong conventions. Great for large enterprise teams. ![React, Vue …

  • Small Functions That Do One Thing

    Short, focused functions are easy to name, test and reuse. Learn how to spot a function doing too …

  • Binary Search

    … overflows on huge ints lo + (hi - lo) / 2 πŸ’‘ Test with tiny arrays: [] , [1] , [1, 2] , and a target …

  • Monolith vs Microservices

    … Transactions βœ… One ACID database transaction ❌ Sagas, eventual consistency Testing end to end βœ… Easy ❌ Hard Ops cost βœ… Low ❌ High …

  • Docker & Containers

    … shop } volumes: [pgdata:/var/lib/postgresql/data] healthcheck: test: ["CMD-SHELL", "pg isready -U app"] interval: 5s cache …

  • API Gateway, BFF & Service Discovery

    … in YAML 🚦 Traffic splitting Canary releases, A/B tests πŸ“Š Telemetry Golden-signal metrics and traces for every call …

  • Microkernel (Plugin) Architecture

    … the ecosystem Plug-ins are small, focused and testable in isolation Plug-in interactions can be hard to …

  • REST API Design

    … From it you get interactive docs, client SDK generation, request validation and contract tests. yaml paths: /users/{id …

  • Services & Ingress

    … pod… wget -qO- http://shop-api/health …to test from inside the cluster kubectl port-forward svc/shop …