SharedLedger Journey Part 1: From Zero to Phoenix

posted by donghyun

last updated

9 min read

ํƒœ๊ทธ

๐ŸŒ The Context: Berlin, New Life, New Needs

2025๋…„ 9์›”, ๋ฒ ๋ฅผ๋ฆฐ์œผ๋กœ ์ด์‚ฌ๋ฅผ ์™”๋‹ค. ์ƒˆ๋กœ์šด ๋„์‹œ, ์ƒˆ๋กœ์šด ์ƒํ™œ, ๊ทธ๋ฆฌ๊ณ  ํŒŒํŠธ๋„ˆ์™€ ํ•จ๊ป˜ ๊ด€๋ฆฌํ•ด์•ผ ํ•  ์ƒˆ๋กœ์šด ์žฌ์ •. EUR(์œ ๋กœ)์™€ KRW(์›ํ™”)๋ฅผ ๋™์‹œ ์‚ฌ์šฉํ•˜๊ฒŒ ๋˜๋ฉด์„œ, ๊ธฐ์กด์˜ ๊ฐ€๊ณ„๋ถ€ ์•ฑ๋“ค์€ ์šฐ๋ฆฌ์˜ ๋‹ˆ์ฆˆ๋ฅผ ์ถฉ์กฑ์‹œํ‚ค์ง€ ๋ชปํ–ˆ๋‹ค:

  • ๋‹ค์ค‘ ํ†ตํ™” ์ง€์› (EUR โ†” KRW real-time conversion)
  • ๊ณต์œ  ๊ณ„์ขŒ ๊ฐœ๋… (shared ledger for couples)
  • ๊ฑฐ๋ž˜๋ณ„ ์นดํ…Œ๊ณ ๋ฆฌ ๋ถ„๋ฅ˜
  • ์›”๊ฐ„/์—ฐ๊ฐ„ ์š”์•ฝ ๋ฐ ๋ถ„์„

๊ทธ๋ฆฌ๊ณ  ๋™์‹œ์—, ๋‚˜๋Š” AI ์ฝ”๋”ฉ ๋„๊ตฌ ๋ถ„์•ผ๋ฅผ ๊นŠ์ด ํƒ๊ตฌํ•˜๊ณ  ์‹ถ์—ˆ๋‹ค.

โ€œ๊ทธ๋ ‡๋‹ค๋ฉด, ์ง์ ‘ ๋งŒ๋“ค์–ด๋ณด๋ฉด ์–ด๋–จ๊นŒ? AI ๋„๊ตฌ์™€ ํ•จ๊ป˜.โ€

๐Ÿค– Why AI-Assisted Development?

์ด ํ”„๋กœ์ ํŠธ๋Š” ์ฒ˜์Œ๋ถ€ํ„ฐ AI ์ฝ”๋”ฉ ๋„๊ตฌ ์‹คํ—˜์„ ์—ผ๋‘์— ๋‘๊ณ  ์‹œ์ž‘ํ–ˆ๋‹ค:

  • Claude Code์˜ ์‹ค์ œ ํ”„๋กœ์ ํŠธ ์ ์šฉ ๋Šฅ๋ ฅ ํ…Œ์ŠคํŠธ
  • AI ๋„๊ตฌ์˜ ๊ฐ•์ ๊ณผ ํ•œ๊ณ„ ํŒŒ์•…
  • ํšจ๊ณผ์ ์ธ AI ํ™œ์šฉ ํŒจํ„ด ํ•™์Šต
  • Elixir/Phoenix ์ƒํƒœ๊ณ„์—์„œ์˜ AI ๋„๊ตฌ ํ™œ์šฉ ๊ฐ€๋Šฅ์„ฑ ๊ฒ€์ฆ

๐Ÿ’ก Honest Expectations Setup

์‹œ์ž‘ํ•˜๊ธฐ ์ „ ์•Œ์•„์•ผ ํ•  ๊ฒƒ๋“ค:

์ด ํ”„๋กœ์ ํŠธ๋Š” โ€œAI๊ฐ€ ๋ชจ๋“  ๊ฑธ ์™„๋ฒฝํ•˜๊ฒŒ ๋งŒ๋“ค์–ด์ค€โ€œ ์ด์•ผ๊ธฐ๊ฐ€ ์•„๋‹ˆ๋‹ค. ํ˜„์‹ค์€:

  • โœ… My Role: Architecture design, planning, decision making, extensive refactoring, fixing broken implementations
  • ๐Ÿค– Claude Codeโ€™s Role: Code generation, boilerplate creation, initial feature implementation
  • โฐ Time Reality: ~30% planning, ~40% AI-assisted coding, ~30% refactoring/fixing what AI messed up

AI ๋„๊ตฌ๋Š” ๊ฐ•๋ ฅํ•˜์ง€๋งŒ, ํŠนํžˆ Ash Framework ๊ฐ™์€ ํŠน์ˆ˜ํ•œ ํ”„๋ ˆ์ž„์›Œํฌ์—์„œ๋Š” ๋งŽ์€ ์ˆ˜์ •๊ณผ ๊ฐœ์„ ์ด ํ•„์š”ํ–ˆ๋‹ค. ์ด ์‹œ๋ฆฌ์ฆˆ๋Š” ๊ทธ ํ˜„์‹ค์ ์ธ ์—ฌ์ •์„ ๋‹ค๋ฃฌ๋‹ค.

๐Ÿ”ง Technology Choices

Why Elixir?

์ด๋Ÿฌ๋‚˜ ์ €๋Ÿฌ๋‚˜ Elixir๋Š” ๋‚˜์˜ favorite language์ด๊ณ , ์ตœ๊ทผ์—๋Š” ์—…๋ฌด์—์„œ ๋‹ค๋ฅธ ์–ธ์–ด๋“ค์„ ์“ฐ๊ณ  ์žˆ๋‹ค๋ณด๋‹ˆ, Elixir ํ”„๋กœ์ ํŠธ๋ฅผ ํ•˜๊ณ  ์‹ถ์€ ์š•๊ตฌ๊ฐ€ ๋” ๋งŽ์ด ์ƒ๊ธฐ๋”๋ผ. ์Šค์Šค๋กœ Elixir ์ „๋ฌธ๊ฐ€๋ผ๊ณ  ์ƒ๊ฐํ•˜๊ณ  ์žˆ๊ธฐ ๋•Œ๋ฌธ์—, Claude Code๊ฐ€ ๋งŒ๋“œ๋Š” Elixir ์ฝ”๋“œ๋ฅผ ๋‚ด๊ฐ€ ์–ผ๋งˆ๋‚˜ ์ž˜ ๊ฒ€์ฆํ•  ์ˆ˜ ์žˆ์„์ง€๋„ ๊ถ๊ธˆํ–ˆ๋‹ค.

Why Phoenix LiveView?

์‚ฌ์‹ค ์•„์ง๋„ ๋ณต์žกํ•œ SPA ์ˆ˜์ค€์˜ ์„œ๋น„์Šค๋ฅผ Phoenix LiveView๋กœ ๋งŒ๋“ค ์ˆ˜ ์žˆ์„์ง€ ์ž˜ ๋ชจ๋ฅด๊ฒ ๋‹ค. ๋ถˆํŽธํ•œ ๋ถ€๋ถ„์ด ๋งŽ๊ณ , ๊ทธ๋งŒํผ ํ™œ๋ฐœํ•˜๊ฒŒ ๋ณ€ํ™”๊ฐ€ ์ด๋ค„์ง€๊ณ  ์žˆ์–ด์„œ, ๊ณ„์† ์ซ“์•„๊ฐ€๋Š” ์ž…์žฅ์ด๋‹ค. ์–ธ์  ๊ฐ€ LiveView๊ฐ€ ์™„๋ฒฝํ•˜๊ฒŒ ํ”„๋ก ํŠธ์—”๋“œ๋ฅผ ๋Œ€์ฒดํ•  ๋‚ ์ด ์˜ฌ์ง€ ์ •๋ง ๊ถ๊ธˆํ•˜๋‹ค.

Why Ash Framework?

Ash Framework๋„ ์ตœ๊ทผ ์ •๋ง ํ•ซํ•˜๋‹ค๊ณ  ๋А๊ผˆ๋Š”๋ฐ, ๊ทธ๋งŒํผ ๋Ÿฌ๋‹์ปค๋ธŒ๋„ ํฌ๋‹ค๊ณ  ๋А๋ผ๊ณ  ์žˆ๋‹ค. ์–ธ์ œ๋‚˜ ๋А๋ผ๋Š” ๊ฑฐ์ง€๋งŒ ๊ฐ•๋ ฅํ•œ ํ”„๋ ˆ์ž„์›Œํฌ๋ฅผ ์“ด๋‹ค๋Š” ๊ฒƒ์€ ๊ทธ๋งŒํผ ์ž์œ ๋ฅผ ํฌ๊ธฐํ•œ๋‹ค๋Š” ๋œป์ด๋‹ค. ์ด ํ”„๋กœ์ ํŠธ์—์„œ๋Š” ํŠนํžˆ ์ด Ash๋ฅผ Claude Code๊ฐ€ ์–ผ๋งˆ๋‚˜ ์ž˜ ๋‹ค๋ฃฐ์ˆ˜ ์žˆ์„์ง€๊ฐ€ ๊ถ๊ธˆํ–ˆ๋‹ค.

Key Decision: PostgreSQL (not ETS/SQLite)

  • Initial plan: SQLite for MVP
  • Reality: Switched to PostgreSQL early
  • Reason: Production-ready from day one

๐Ÿš€ Project Initialization

Day 1: Setting Up

  1. Documentation phase with Claude (17+ files, ~5,500 lines):

    Architecture Documents (in docs/architecture/):

    • DOMAIN_MODEL.md (1,066 lines) - 4๊ฐœ domain ์ •์˜ (Identity, Accounts, Ledger, Currency)
    • UI_COMPONENTS.md (1,026 lines) - Atomic Design ๊ธฐ๋ฐ˜ ์™„์ „ํ•œ UI ์ŠคํŽ™
    • API_SPECIFICATION.md (645 lines) - LiveView event contracts
    • DATABASE_DESIGN.md (489 lines) - ์ „์ฒด ์Šคํ‚ค๋งˆ ๊ตฌ์กฐ
    • ASH_FRAMEWORK_ANALYSIS.md (355 lines) - Ash ํ”„๋ ˆ์ž„์›Œํฌ ํ‰๊ฐ€ ๋ฐ ์‚ฌ์šฉ ์ „๋žต
    • SYSTEM_ARCHITECTURE.md (292 lines) - ๋ ˆ์ด์–ด ์•„ํ‚คํ…์ฒ˜ ๋ฐ ํŒจํ„ด

    Project Documents (in docs/):

    • REQUIREMENTS_SPECIFICATION.md (815 lines) - ๊ธฐ๋Šฅ/๋น„๊ธฐ๋Šฅ ์š”๊ตฌ์‚ฌํ•ญ
    • PROJECT_PLAN.md (572 lines) - MVP โ†’ Phase 2 โ†’ Phase 3 ๋กœ๋“œ๋งต
    • TECHNICAL_SPECIFICATION.md - ๊ตฌํ˜„ ์„ธ๋ถ€์‚ฌํ•ญ
    • CLAUDE.md (229 lines) - AI ์–ด์‹œ์Šคํ„ดํŠธ ๊ฐ€์ด๋“œ
    • Plus: PROJECT_STATUS, DEPLOYMENT_OPERATIONS_GUIDE, DATA_FLOW_INTEGRATION
  2. Project initialization:

    • mix phx.new shared_ledger
    • mix igniter.install for Ash Framework and dependencies

๐Ÿ“ First Lesson with Claude Code

Day 1: ์™„๋ฒฝํ•œ ๊ณ„ํš

์‹ค์ œ mix new ๋ช…๋ น์„ ์‹คํ–‰ํ•ด ์ฝ”๋“œ๋ฅผ ์ƒ์„ฑํ•˜๊ธฐ ์ „์—, ๋ฌธ์„œ๋ฅผ ์ œ๋Œ€๋กœ ๋งŒ๋“œ๋Š” ๊ฒƒ์— ์ง‘์ค‘ํ–ˆ๋‹ค. ํšŒ์‚ฌ ํ”„๋กœ์ ํŠธ๋ฅผ ํ•˜๋ฉฐ ์Œ“์€ ๋…ธํ•˜์šฐ๋กœ ํ•„์š”ํ•œ ํ•ต์‹ฌ ๋ฌธ์„œ๋“ค์„ ์—ญ์‹œ Claude๋ฅผ ์ด์šฉํ•ด ๋งŒ๋“ค๊ธฐ ์‹œ์ž‘ํ–ˆ๋‹ค. ์—ฌ๊ธฐ์„œ ์ œ๋Œ€๋กœ ํ• ์ˆ˜๋ก, ๋’ค์— ๋“ค์–ด๊ฐ€๋Š” ๋ถˆํ•„์š”ํ•œ ๋…ธ๋ ฅ์ด ์ค„์–ด๋“ ๋‹ค.

๋ฌธ์„œ๋ฅผ ์ž˜ ๋งŒ๋“ค๋ฉด:

  • โœ… AI๊ฐ€ ๋‚ด ์•„ํ‚คํ…์ฒ˜ ์˜๋„๋ฅผ ์ดํ•ดํ•œ๋‹ค
  • โœ… ์ผ๊ด€๋œ ํŒจํ„ด์œผ๋กœ ์ฝ”๋“œ๋ฅผ ์ƒ์„ฑํ•œ๋‹ค
  • โœ… ๊ฐ™์€ ์‹ค์ˆ˜๋ฅผ ๋ฐ˜๋ณตํ•˜์ง€ ์•Š๋Š”๋‹ค

ํ•˜์ง€๋งŒ ํ•จ์ •์ด ์žˆ์—ˆ๋‹คโ€ฆ

Day 2: ํ˜„์‹ค๊ณผ์˜ ์ถฉ๋Œ

# Day 1์— ์™„๋ฒฝํ•˜๊ฒŒ ๊ณ„ํšํ•œ ์ฝ”๋“œ
changeset = Ash.Changeset.for_action(User, :create, %{})
form = to_form(changeset)  # ๐Ÿ”ฅ Protocol error!

์—๋Ÿฌ ๋ฉ”์‹œ์ง€: Protocol Phoenix.HTML.FormData not implemented for Ash.Changeset

์™„๋ฒฝํ•œ ๋ฌธ์„œ๊ฐ€ ์žˆ์–ด๋„, Ash Framework์˜ ํŠน์ˆ˜ํ•œ integration ์ด์Šˆ๋Š” ๋ง‰์„ ์ˆ˜ ์—†์—ˆ๋‹ค. ์ด๋‚  ์ƒˆ๋กœ์šด ๋ฌธ์„œ๋“ค์ด ์ƒ๊ฒผ๋‹ค:

  • DEVELOPMENT_CONVENTIONS.md - Ash+Phoenix ํŒจํ„ด
  • ADR-005: Ash-Phoenix Form Integration - ์™œ ์ด๋ ‡๊ฒŒ ํ–ˆ๋Š”์ง€

๋‘ ์ข…๋ฅ˜์˜ ๋ฌธ์„œ:

  1. Proactive (Day 1) - ๋ฌธ์ œ๋ฅผ ์˜ˆ๋ฐฉํ•˜๋Š” ๋ฌธ์„œ
  2. Reactive (Day 2) - ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ณ  ๊ธฐ๋กํ•˜๋Š” ๋ฌธ์„œ

AI Agent๋Š” ๋Š์ž„์—†์ด ๋‚ด๊ฐ€ ์›ํ•˜๋Š” ๋ฐฉํ–ฅ๊ณผ ๋‹ค๋ฅธ ์ •๋ณด๋ฅผ ์˜๋„์น˜ ์•Š๊ฒŒ ์‹ฌ๊ธฐ ๋•Œ๋ฌธ์—, ๋ฌธ์„œ๋ฅผ ๋ฉด๋ฐ€ํžˆ ๊ฒ€ํ† ํ•˜๊ณ  ๊ณ„์† ์—…๋ฐ์ดํŠธํ•  ํ•„์š”๊ฐ€ ์žˆ์—ˆ๋‹ค.

๊ตํ›ˆ: ๋ฌธ์„œ๋Š” one-and-done์ด ์•„๋‹ˆ๋‹ค. ์‚ด์•„์žˆ๋Š” ๋ฌธ์„œ์—ฌ์•ผ ํ•œ๋‹ค.

๐Ÿ—๏ธ Architecture Planning

Domain Contexts

Initial planning led to 4 main contexts:

  1. Identity - Users, authentication, sessions
  2. Accounts - Shared accounts, memberships, roles
  3. Ledger - Transactions, categories, summaries
  4. Currency - Exchange rates, conversions
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   Phoenix UI                     โ”‚
โ”‚              (LiveView Components)               โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                        โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                Domain Layer                      โ”‚
โ”‚  Identity  โ”‚  Accounts  โ”‚  Ledger  โ”‚  Currency  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                        โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              Ash Resources Layer                 โ”‚
โ”‚    (Declarative definitions + Actions)          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                        โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  PostgreSQL                      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿค” Architecture Decision Challenges

์ดˆ๊ธฐ ์ƒํƒœ: Elixir๋Š” ์ž์‹  ์žˆ์—ˆ์ง€๋งŒ, domain modeling๊ณผ relationship ์„ค๊ณ„๋Š” ๊ณ ๋ฏผ์ด ๋งŽ์€ ๋ถ€๋ถ„์ด๋ผ, ์ด๋ฒˆ์—” Claude์˜ ๊ตฌ์ฒด์ ์ด๊ณ  ์ข…ํ•ฉ์ ์ธ ์„ค๊ณ„๋ฅผ ๋”ฐ๋ผ๋ณด๊ธฐ๋กœ ํ–ˆ๋‹ค.

ํ•ต์‹ฌ ์‹ค์ˆ˜: โ€œ์„ค๋ช…์ด ๋…ผ๋ฆฌ์ ์ด๋‹ˆ๊นŒ ๋งž๊ฒ ์ง€โ€œ ํ•˜๋ฉฐ ๋น„ํŒ ์—†์ด ์ˆ˜์šฉ.

์ฃผ์š” ์‚ฌ๋ก€๋“ค:

  • 4-domain structure โ†’ Week 5์— domain boundary refactoring
  • Many-to-many + RBAC โ†’ manage_relationship ์ดํ•ด ์—†์ด ๊ตฌํ˜„ โ†’ 2์ฃผ ๋””๋ฒ„๊น…
  • SQLite โ†’ PostgreSQL ๊ฐ•์ œ migration (Day 7)
  • 403 Forbidden โ†’ 404 NotFound (security ์ด์Šˆ)

ํŒจํ„ด: Claude ์ œ์•ˆ โ†’ โ€œ๊ทธ๋Ÿด๋“ฏโ€ โ†’ ๊ตฌํ˜„ โ†’ ๋ฌธ์ œ ๋ฐœ๊ฒฌ โ†’ refactoring

Time Cost: Architecture review 10์‹œ๊ฐ„ vs. ๋‚˜์ค‘์— ๊ณ ์น˜๊ธฐ 3-4์ฃผ (1:20~30 ratio)

๊ตํ›ˆ: AI๋Š” ํŒจํ„ด์„ ์•ˆ๋‹ค. ํ•˜์ง€๋งŒ ๋‚ด ๋ฌธ์ œ, trade-offs, security implications๋Š” ๋ชจ๋ฅธ๋‹ค. โ€œAI๋Š” ์˜ต์…˜ ์ œ์‹œ. ๊ฒฐ์ •์€ ๋‚ด๊ฐ€.โ€

โ†’ Part 2์—์„œ domain ์„ค๊ณ„ ์„ธ๋ถ€ ์‚ฌํ•ญ ๋‹ค๋ฃธ

๐Ÿ“‹ Initial Feature Planning

MVP Scope (Week 1 Planning)

Must Have:

  • โœ… User authentication (email/password)
  • โœ… Create/join shared accounts
  • โœ… Add transactions (amount, category, date, note)
  • โœ… Multi-currency support (EUR, KRW)
  • โœ… Basic transaction list view
  • โœ… Monthly summary

Nice to Have (Later):

  • โŒ Budget tracking
  • โŒ Recurring transactions
  • โŒ Advanced analytics
  • โŒ Mobile app (PWA instead)

๐Ÿ’ก Lesson: Pattern Pollution

AI์™€ ์ž‘์—…ํ•˜๋ฉด์„œ ๊ฐ€์žฅ ์œ„ํ—˜ํ–ˆ๋˜ ํŒจํ„ด: ๋‚˜์œ ์ฝ”๋“œ๊ฐ€ ๋ˆˆ๋ฉ์ด์ฒ˜๋Ÿผ ์ปค์ง€๋Š” ๊ฒƒ

์‹œ๋‚˜๋ฆฌ์˜ค: ํฐ feature ์š”์ฒญ (500์ค„) โ†’ ๋Œ€๋ถ€๋ถ„ ์ž˜ ์ž‘๋™ โ†’ ๊ท€์ฐฎ์•„์„œ ์„ธ๋ถ€ ๋ฆฌ๋ทฐ ์ƒ๋žต โ†’ 10์ค„์˜ ์ž˜๋ชป๋œ ์ฝ”๋“œ ์ˆจ์–ด์žˆ์Œ โ†’ Claude๊ฐ€ ๊ทธ๊ฑธ ํ•™์Šต โ†’ ๋‹ค์Œ feature์—์„œ ๋ฐ˜๋ณต.

Real Example:

  • Week 1: Transaction LiveView์—์„œ Ash.Query ์ง์ ‘ ์‚ฌ์šฉ (๋ฆฌ๋ทฐ ์•ˆ ํ•จ)
  • Week 2-3: Category, Summary LiveView โ†’ ๊ฐ™์€ ํŒจํ„ด ๋ณต์‚ฌ
  • Week 5: git grep "Ash.Query" โ†’ 12๊ฐœ ํŒŒ์ผ ๋ฐœ๊ฒฌ โ†’ 2์ฃผ refactoring

๋˜ ๋‹ค๋ฅธ ์˜ˆ: Money ๋Œ€์‹  Decimal ์‚ฌ์šฉ โ†’ ๋ชจ๋“  calculation์— ํ™•์‚ฐ โ†’ Currency ์ •๋ณด ์†์‹ค.

ํ•ต์‹ฌ:

  • โ€œ์ž‘๋™ โ‰  ์˜ณ์Œโ€
  • ํ•œ ๋ฒˆ์˜ ์‹ค์ˆ˜ = 12๋ฒˆ์˜ ๋ฒ„๊ทธ
  • Review 30๋ถ„ vs. Refactoring 2์ฃผ (1:40 ratio)

ํ•ด๊ฒฐ:

  1. ํฐ feature๋„ ์„ธ๋ถ€ ๋ฆฌ๋ทฐ ํ•„์ˆ˜
  2. ์ž˜๋ชป๋œ ํŒจํ„ด ์ฆ‰์‹œ ์ˆ˜์ • (๋‚˜์ค‘์— โœ—)
  3. Anti-patterns๋ฅผ CLAUDE.md์— ๊ธฐ๋ก
  4. ์ฃผ๊ธฐ์  audit (git grep ๊ธˆ์ง€ ํŒจํ„ด)

โ†’ Part 4์—์„œ refactoring ์ƒ์„ธํžˆ ๋‹ค๋ฃธ

๐ŸŽฏ Documentation-Driven Development

One of the best decisions: Creating comprehensive documentation for Claude Code.

Files created:

  • CLAUDE.md - Project-specific guidelines
  • AGENTS.md - Phoenix/LiveView/Elixir rules (later)
  • ASH_DEVELOPMENT_GUIDE.md - Ash framework patterns
  • ASH_LIVEVIEW_STRICT_RULES.md - Quick checklist

๐Ÿ“ Why This Mattered

ROI: ๋ฌธ์„œ ์ž‘์„ฑ 12-16์‹œ๊ฐ„ vs. ์ ˆ์•ฝ 30-40์‹œ๊ฐ„ (์•ฝ 2-3๋ฐฐ)

ํšจ๊ณผ:

  • Claude๊ฐ€ ์ผ๊ด€๋œ ํŒจํ„ด ๋”ฐ๋ฆ„
  • ๊ฐ™์€ ์‹ค์ˆ˜ ๋ฐ˜๋ณต ์ค„์–ด๋“ฆ
  • ๋ฉ€ํ‹ฐํƒœ์Šคํ‚น ๊ฐ€๋Šฅ (๋ฌธ์„œ๊ฐ€ ๋‚˜๋ฅผ ๋Œ€์‹ )

Trade-offs:

  • ๋ฌธ์„œ ์ž‘์„ฑ ์‹œ๊ฐ„ ๋งŽ์ด ๋“ฆ
  • ๊ณ„์† ์—…๋ฐ์ดํŠธ ํ•„์š”
  • Claude๊ฐ€ ๊ฐ€๋” ๋ฌธ์„œ ๋ฌด์‹œํ•จ

๊ฒฐ๋ก : ๋ณต์žกํ•œ ํ”„๋ ˆ์ž„์›Œํฌ (Ash, LiveView)๋Š” ๋ฌธ์„œ ํ•„์ˆ˜. ๊ฐ„๋‹จํ•œ ํ”„๋กœ์ ํŠธ๋Š” ๋ถˆํ•„์š”.

๐Ÿ”„ Development Workflow Setup

Tools & Environment

# Docker for PostgreSQL
docker-compose up -d postgres

# Development commands (Makefile)
make dev-setup  # First time
make dev        # Daily use
make test       # Run tests
make format     # Code formatting

๐Ÿค” Workflow with Claude Code

ํ™•๋ฆฝ๋œ ํŒจํ„ด:

  1. Feature ์‹œ์ž‘: ๋ธŒ๋žœ์น˜ ์ƒ์„ฑ โ†’ Claude์—๊ฒŒ context ์ œ๊ณต (DOMAIN_MODEL.md ๋“ฑ)
  2. ์ž‘์—… ์ค‘: ์ฆ‰์‹œ ๋ฆฌ๋ทฐ, ํŒจํ„ด ์œ„๋ฐ˜ ์‹œ ์ค‘๋‹จ, ๊ฐ ๋‹จ๊ณ„ compile ํ™•์ธ
  3. Iteration: ํ‰๊ท  3-4๋ฒˆ (Ash ์ง์ ‘ ์‚ฌ์šฉ โ†’ Domain ํ•จ์ˆ˜ โ†’ Authorization โ†’ Error handling)
  4. Commit: Claude ์ œ์•ˆ message ๊ฑฐ๋ถ€, ์ง์ ‘ ์ž‘์„ฑ

์—ญํ•  ๋ถ„๋‹ด:

  • Claude: Boilerplate, ๋ฐ˜๋ณต CRUD, test ์ดˆ์•ˆ
  • ๋‚˜: Architecture ๊ฒฐ์ •, ๋ณต์žกํ•œ ๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง

ํ•ต์‹ฌ: Pair programmer๋กœ ์“ฐ๋˜, final decision์€ ๋‚ด๊ฐ€.

๐Ÿ“Š First Week Results

By the end of first week (Sep 11-18):

โœ… Project initialized
โœ… Ash framework integrated
โœ… Basic domain structure defined
โœ… SQLite setup (later migrated to PostgreSQL)
โœ… Initial documentation written
โœ… Core features implemented (but needed fixes)
โš ๏ธ  Many compilation errors to resolve

Git commits tell the story:

dd3de03 - docs: Add comprehensive Ash framework implementation
4377a84 - docs: Add complete Ash framework architecture
b010fc3 - feat: Implement core MVP features with Ash
394878a - feat: Implement Phoenix LiveView UI

๐Ÿ’ก Key Insight

Planning์ด ์‹œ๊ฐ„์„ ์ ˆ์•ฝํ–ˆ๋‹ค:

  • ๋ฌธ์„œ ๋จผ์ €: 48์‹œ๊ฐ„ ์ด ํˆฌ์ž
  • ๋ฌธ์„œ ์—†์ด (์ถ”์ •): 60์‹œ๊ฐ„+ (architecture ๋ฆฌํŒฉํ† ๋ง, ๋ฐ˜๋ณต ์‹ค์ˆ˜)
  • ์ ˆ์•ฝ: ~20%

๋” ์ค‘์š”ํ•œ ๊ฒƒ: ์˜ฌ๋ฐ”๋ฅธ ๊ตฌ์กฐ, ์ผ๊ด€๋œ ํŒจํ„ด, ์ ์€ technical debt.

ํ•˜์ง€๋งŒ: ๋ฌธ์„œ๊ฐ€ ์™„๋ฒฝํ•˜๊ฒŒ ๋ง‰์ง„ ๋ชปํ•จ. Week 5-6์— 26๊ฐœ refactoring commits ํ•„์š”. AI ์ƒ์„ฑ ์ฝ”๋“œ๋Š” ์—ฌ์ „ํžˆ ๋ฆฌ๋ทฐ์™€ refactoring ํ•„์ˆ˜.

๐ŸŽฌ Whatโ€™s Next?

In Part 2, weโ€™ll dive into:

  • Implementing the four domain contexts with Ash
  • Resource definitions and relationships
  • Authorization setup (RBAC)
  • Testing in IEx before touching LiveView
  • Lessons learned about guiding Claude with Ash patterns