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 4Vertical 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 stepVisual 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 β
| Slice | What We Build | Outcome |
|---|---|---|
| 1: Skeleton | Routes, navigation, page shells | App structure works |
| 2: Authentication | Register, login, logout | Can sign in and out |
| 3: Protected Feature | Your CRUD feature | Core functionality works |
| 4: Security Rules | Firestore protection | Data is secure |
| 5: Polish | Loading states, error handling | Feels 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 GitHubWhat "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.