Get the FREE Ultimate OpenClaw Setup Guide →

architecture

Scanned
npx machina-cli add skill DojoCodingLabs/code-sensei/architecture --openclaw
Files (1)
SKILL.md
2.8 KB

Architecture — CodeSensei Teaching Module

What is Architecture?

  • Analogy: Architecture is the floor plan of your application. Just like a building needs a plan before construction, your app needs a structure that determines how all the pieces connect.
  • Key insight: Bad architecture doesn't break your app today — it makes it painful to change tomorrow. Good architecture makes change easy.

Client-Server Architecture

  • The pattern: Frontend (client) ↔ API ↔ Backend (server) ↔ Database
  • Why this split: Separation of concerns. The frontend handles display, the backend handles logic and data. They can change independently.
  • When to teach: First time Claude creates both a frontend and backend file in the same project.

Monolith vs Microservices

  • Monolith: Everything in one codebase. Like a single restaurant where the kitchen, dining room, and bar are all one business.
  • Microservices: Each feature is its own mini-app. Like a food court where each stall is independent.
  • Key insight for vibecoders: Start monolith. Always. Microservices are for when you have scaling problems, not before.

MVC Pattern

  • Model — the data layer (what your app knows)
  • View — the display layer (what the user sees)
  • Controller — the logic layer (what happens when the user does something)
  • Analogy: A restaurant. The menu (model) has the dishes. The table presentation (view) is what the customer sees. The waiter (controller) takes orders and coordinates between kitchen and table.

State Management

  • The problem: As your app grows, keeping track of data that multiple components need becomes messy.
  • Analogy: In a small office, everyone shouts across the room. In a big company, you need an organized messaging system (Slack, email).
  • Solutions: React Context, Redux, Zustand — all solve the same problem differently.

Caching

  • Analogy: Instead of cooking every meal from scratch, you prep common ingredients in advance. Caching stores frequently-used data closer to where it's needed so you don't have to fetch it every time.

Authentication vs Authorization

  • Authentication: "Who are you?" (login)
  • Authorization: "What are you allowed to do?" (permissions)
  • Analogy: Authentication is the bouncer checking your ID. Authorization is the VIP list determining which areas you can access.

When to Teach Architecture

  • Only for Blue Belt and above — beginners should focus on making things work before worrying about structure
  • Introduce naturally when Claude makes an architectural choice the user might wonder about

Source

git clone https://github.com/DojoCodingLabs/code-sensei/blob/main/skills/architecture/SKILL.mdView on GitHub

Overview

Architecture defines the structure of an application, guiding how components connect and evolve. It emphasizes separation of concerns and how patterns like client-server, MVC, and caching support maintainability. This module activates for Claude Blue Belt and above when significant architectural decisions arise.

How This Skill Works

It teaches core concepts and concrete patterns. It covers how a client-server split decouples frontend, API, backend, and database. It also explains patterns like monolith vs microservices, MVC, state management, caching, and authentication vs authorization to show how decisions affect maintainability and scale.

When to Use It

  • When starting a project that includes both frontend and backend in the same repo (client-server pattern).
  • When evaluating monolith versus microservices for future scaling.
  • When teaching the MVC pattern and mapping model, view, and controller roles.
  • When state across many components becomes hard to coordinate (state management).
  • When security concerns arise and you need to distinguish authentication vs authorization.

Quick Start

  1. Step 1: Map your app into core components (Client, API, Backend, DB) and assign responsibilities.
  2. Step 2: Choose an architectural pattern (Monolith vs Microservices) and an organizing pattern (MVC) plus a state management approach.
  3. Step 3: Implement basic authentication/authorization checks and set up caching for common data.

Best Practices

  • Start with a simple client-server split to separate concerns.
  • Begin with a monolith; move to microservices only if scaling demands it.
  • Use MVC to separate data, UI, and logic; map to real-world roles.
  • Prefer explicit state management solutions (Context/Redux/Zustand) to reduce component coupling.
  • Introduce architecture only when there is a genuine decision to make on structure; avoid premature optimization.

Example Use Cases

  • Full-stack app with Frontend ↔ API ↔ Backend ↔ Database illustrating the client-server pattern.
  • Monolith evolving into microservices as traffic and feature teams grow.
  • MVC-based app with clear Model, View, and Controller responsibilities.
  • App using React Context or Redux/Zustand to coordinate shared state across components.
  • Caching frequently requested data to reduce fetches and implementing a simple authentication vs authorization flow.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers