Skip to content

Vertical Slices Explained ​

Time: ~5 minutes | Difficulty: Beginner

What You'll Learn ​

  • What vertical slices are
  • Why this approach works
  • How we'll build the app

The Big Idea ​

A vertical slice is a thin, complete feature that cuts through all layers of the application.

Instead of building all the UI, then all the logic, then all the database β€” we build one complete feature at a time.

Two Approaches Compared ​

Horizontal Layers (Not This) ​

Week 1: Build all the UI
Week 2: Build all the logic
Week 3: Connect to database
Week 4: Finally test it...

Problem: Nothing works until Week 4

Vertical Slices (This!) ​

Hour 1: Login works end-to-end
Hour 2: Registration works end-to-end
Hour 3: Create note works end-to-end
...

Benefit: Something works at every step

Visual Comparison ​

Horizontal Layers:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         UI (all pages)                β”‚ ← Build this first
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚         Logic (all features)          β”‚ ← Then this
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚         Database (all data)           β”‚ ← Then this
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Nothing works until all layers done.

Vertical Slices:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Login   β”‚ Notes   β”‚ Edit    β”‚ Delete  β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β” β”‚ β”Œβ”€β”€β”€β”€β”€β” β”‚ β”Œβ”€β”€β”€β”€β”€β” β”‚ β”Œβ”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ UI  β”‚ β”‚ β”‚ UI  β”‚ β”‚ β”‚ UI  β”‚ β”‚ β”‚ UI  β”‚ β”‚
β”‚ β”œβ”€β”€β”€β”€β”€β”€ β”‚ β”œβ”€β”€β”€β”€β”€β”€ β”‚ β”œβ”€β”€β”€β”€β”€β”€ β”‚ β”œβ”€β”€β”€β”€β”€β”€ β”‚
β”‚ β”‚Logicβ”‚ β”‚ β”‚Logicβ”‚ β”‚ β”‚Logicβ”‚ β”‚ β”‚Logicβ”‚ β”‚
β”‚ β”œβ”€β”€β”€β”€β”€β”€ β”‚ β”œβ”€β”€β”€β”€β”€β”€ β”‚ β”œβ”€β”€β”€β”€β”€β”€ β”‚ β”œβ”€β”€β”€β”€β”€β”€ β”‚
β”‚ β”‚ DB  β”‚ β”‚ β”‚ DB  β”‚ β”‚ β”‚ DB  β”‚ β”‚ β”‚ DB  β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”˜ β”‚
β”‚  Done!  β”‚  Done!  β”‚  Done!  β”‚  Done!  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Each slice works independently.

Why Vertical Slices for Learning ​

1. See Progress Immediately ​

Each slice produces something you can show and use.

2. Catch Problems Early ​

If login doesn't work, you find out in slice 1, not at the end.

3. Natural Commit Points ​

Each slice = one meaningful commit.

4. Motivation ​

Completing real features feels good and keeps you going.

5. Working Software Always ​

Never more than 20 minutes from a working state.

Our Slices ​

SliceWhat We BuildOutcome
1: SkeletonRoutes, navigation, page shellsApp structure works
2: AuthenticationRegister, login, logoutCan sign in and out
3: Protected FeatureYour CRUD featureCore functionality works
4: Security RulesFirestore protectionData is secure
5: PolishLoading states, error handlingFeels complete

Each slice builds on the previous one.

The Pattern for Each Slice ​

1. UNDERSTAND what we're building
   - Read the goals
   - Check acceptance criteria

2. BUILD with AI assistance
   - Use provided prompts
   - Modify as needed

3. VERIFY it works
   - Test manually
   - Check all criteria

4. COMMIT the working code
   - Meaningful commit message
   - Push to GitHub

What "Done" Looks Like for Each Slice ​

Slice 1: Skeleton ​

  • [ ] App loads without errors
  • [ ] Navigation between pages works
  • [ ] Basic layout visible

Slice 2: Authentication ​

  • [ ] Can create account
  • [ ] Can log in
  • [ ] Can log out
  • [ ] Protected pages require login

Slice 3: Protected Feature ​

  • [ ] Can create items
  • [ ] Can view item list
  • [ ] Can edit items
  • [ ] Can delete items
  • [ ] Data persists after refresh

Slice 4: Security Rules ​

  • [ ] Rules deployed
  • [ ] Only owner can access their data
  • [ ] Tested with different scenarios

Slice 5: Polish ​

  • [ ] Loading spinners visible
  • [ ] Error messages helpful
  • [ ] Success feedback shown
  • [ ] UI looks clean

Check Your Understanding ​

  • [ ] Vertical slices are complete features, not layers
  • [ ] Each slice produces working functionality
  • [ ] We build one slice at a time
  • [ ] Each slice ends with a commit

Ready to Build! ​

Let's start with Slice 1: the app skeleton.

Start Slice 1: Skeleton β†’

Built for learning | Open source on GitHub