Technical Environment Document: Shoe Choo

Language & Version

Framework & UI

Build System

Key Dependencies (Candidates)

Library Purpose Notes
swift-markdown (Apple) Markdown parsing to AST Official Apple library, maintained
Highlightr Code block syntax highlighting Wraps highlight.js
SwiftUI-Introspect Access underlying AppKit views For TextKit 2 integration

Prohibited Libraries

Library Reason Alternative
Electron / WebView-based editors Not native, high memory Native TextKit 2
Realm / Core Data Overkill for a text editor File-based storage
RxSwift / Combine (heavy use) Unnecessary with Swift Concurrency async/await, @Observable

Distribution

Testing Framework

Code Style & Conventions

File Structure (Target)

shoechoo/
├── shoechoo.xcodeproj
├── shoechoo/
│   ├── App/
│   │   └── ShoechooApp.swift        # @main entry point
│   ├── Models/
│   │   ├── Document.swift            # Markdown document model
│   │   └── EditorState.swift         # Editor state management
│   ├── Views/
│   │   ├── EditorView.swift          # Main WYSIWYG editor
│   │   ├── SidebarView.swift         # File browser sidebar
│   │   └── ToolbarView.swift         # Toolbar configuration
│   ├── ViewModels/
│   │   └── EditorViewModel.swift     # Editor business logic
│   ├── Services/
│   │   ├── MarkdownParser.swift      # Markdown parsing service
│   │   ├── FileService.swift         # File I/O operations
│   │   └── ExportService.swift       # HTML/PDF export
│   ├── Editor/
│   │   ├── WYSIWYGTextView.swift     # Core WYSIWYG rendering
│   │   ├── MarkdownRenderer.swift    # Inline Markdown renderer
│   │   └── FocusMode.swift           # Focus mode overlay
│   ├── Extensions/
│   │   └── ...
│   ├── Resources/
│   │   └── Assets.xcassets
│   └── Info.plist
├── shoechooTests/
│   └── ...
├── shoechooUITests/
│   └── ...
├── docs/                              # GitHub Pages site
├── aidlc-docs/                        # AI-DLC documentation
└── README.md

Naming Conventions

Example — Typical View

import SwiftUI

struct EditorView: View {
    @State private var viewModel = EditorViewModel()

    var body: some View {
        WYSIWYGTextView(
            text: $viewModel.content,
            focusMode: viewModel.isFocusModeEnabled
        )
        .toolbar {
            ToolbarItem(placement: .primaryAction) {
                Button("Focus", systemImage: "eye") {
                    viewModel.toggleFocusMode()
                }
            }
        }
    }
}

Example — Typical Service

import Foundation

actor FileService {
    func load(from url: URL) async throws -> String {
        let data = try Data(contentsOf: url)
        guard let content = String(data: data, encoding: .utf8) else {
            throw FileServiceError.invalidEncoding
        }
        return content
    }

    func save(_ content: String, to url: URL) async throws {
        let data = Data(content.utf8)
        try data.write(to: url, options: .atomic)
    }
}

Example — Typical Test

import Testing
@testable import shoechoo

struct MarkdownParserTests {
    @Test func parsesHeading() {
        let parser = MarkdownParser()
        let result = parser.parse("# Hello")
        #expect(result.first?.type == .heading(level: 1))
        #expect(result.first?.text == "Hello")
    }
}

Security Basics