RingiFlow

March 10, 2026 · View on GitHub

日本語版はこちら

CI Rust Elm License

An enterprise workflow management system (SaaS) that unifies approval flows, task management, and document management.

Learning & Experimentation Project: An experiment in building production-quality software driven primarily by an AI agent (Claude Code).

Demo

https://demo.ka2kama.com

The login page is not yet implemented; DevAuth (development authentication bypass) provides an authenticated state.

Tech Stack

LayerTechnologyRationale
BackendRust + axumType safety, memory safety, high performance
FrontendElmPure functional, zero runtime errors, The Elm Architecture
Data storesPostgreSQL, Redis, DynamoDBWorkflow & user management, session management, audit logs
InfrastructureAWS Lightsail, CloudflareDemo environment (low-cost setup for solo development)

Architecture

flowchart LR
    subgraph Client
        Browser["Browser<br/>(Elm SPA)"]
    end

    subgraph Backend
        BFF["BFF<br/>(Rust/axum)"]
        Core["Core Service<br/>(Rust/axum)"]
        Auth["Auth Service<br/>(Rust/axum)"]
    end

    subgraph Data
        PG["PostgreSQL"]
        Redis["Redis<br/>(Session)"]
        DynamoDB["DynamoDB<br/>(Audit Log)"]
    end

    Browser --> BFF
    BFF --> Core
    BFF --> Auth
    BFF --> Redis
    BFF --> DynamoDB
    Core --> PG
    Auth --> PG

Design Patterns

PatternPurpose
BFF (Backend for Frontend)Security hardening (token concealment), frontend-optimized API
Multi-tenant (tenant_id)Application-level tenant data isolation
Layered architectureSeparation of concerns across domain / infra / apps

Development Status

Phase 3 (Enterprise Features) planning — Phase 2 complete

PhaseStatusDescription
Phase 0✅ CompleteDevelopment foundation (CI/CD, project structure, documentation system)
Phase 1✅ CompleteMinimum viable workflow system
Phase 2✅ CompleteFeature expansion (multi-tenant, notifications, document management)
Phase 3📋 PlanningEnterprise features (SSO/MFA, complex workflows)
Phase 4📋 PlanningAdvanced features (CQRS/ES, real-time)

Details: Implementation Roadmap


Getting Started

Development environment setup: Procedures

For working on multiple tasks simultaneously: Parallel development (Worktree)

# Initial setup (install dependencies, start DB, run migrations)
just setup

# Start dev servers (BFF, Core Service, Auth Service, Web — all at once)
just dev-all

# Pre-commit check (lint + test + API test)
just check-all

Development Flow

Tasks are managed with GitHub Projects + Issues.

  1. Create or review an Issue
  2. Create a branch in the feature/123-feature-name format
  3. Implement → Create PR (link with Closes #123)
  4. CI + AI review → Merge

Project Board / Issues

Directory Structure

ringiflow/
├── backend/           # Rust backend
│   ├── apps/          # BFF, Core Service, Auth Service
│   └── crates/        # Shared libraries (domain, infra, shared)
├── frontend/          # Elm frontend
├── infra/             # Terraform, Docker
├── openapi/           # OpenAPI specs
├── scripts/           # Shell scripts (checks, env setup, tests, tools, worktree)
├── tests/             # API tests, E2E tests
├── process/           # Improvement records, diagnostic reports
├── prompts/           # AI operations (session logs, plans, recipes)
└── docs/              # Documentation
    ├── 10_要件定義書/   # Requirements
    ├── 20_機能仕様書/   # Functional specifications
    ├── 30_基本設計書/   # High-level design
    ├── 40_詳細設計書/   # Detailed design
    ├── 50_テスト/      # Test specifications
    ├── 60_手順書/      # Procedures
    ├── 70_ADR/        # Architecture Decision Records
    ├── 80_ナレッジベース/ # Knowledge base
    └── 90_実装解説/    # Implementation guides

Project Philosophy

Maximize Learning

Articulate and record the reasoning behind every design decision.

  • Why was this technology or pattern chosen?
  • What alternatives were considered, and why were they rejected?
  • What are the trade-offs?

Key learning themes:

  • CQRS + Event Sourcing
  • Concurrent updates and state consistency (optimistic locking, conflict resolution, UI synchronization)
  • Multi-tenant architecture

Pursue Quality

Systematically pursue software quality based on the ISO/IEC 25010 product quality model, currently focusing on maintainability, functional suitability, and security.

The quality strategy consists of two layers — V&V (Validation & Verification):

LayerQuestionMechanism
ValidationAre we solving the right problem?Problem-solving framework, Issue triage
VerificationAre we building it correctly?Defense & Offense (below)

The Verification layer has two complementary directions:

DirectionFocusMechanism
Defense (defect removal)Negative → Zero: detect and fix problemsDesign review, quality checklists
Offense (design improvement)Zero → Positive: discover and integrate better structuresDesign review, design-principle lenses in TDD Refactor

Design principles:

  • Keep it simple (KISS)
  • Separate concerns clearly
  • Localize the impact of changes

Leverage the type system:

  • Make invalid states unrepresentable
  • Prefer compile-time errors over runtime errors

Common Approach: Start from Best Practices

Start from industry best practices and adjust to fit the project's context.

  • Set the bar high (start from best practices, then adapt)
  • Apply to every domain (code design, UI/UX, security, testing, development process — no exceptions)
  • Adjust consciously (document the reason when deviating)

AI-Driven Development

Development is led by an AI agent (Claude Code), with guardrails to ensure quality.

RoleActorResponsibilities
OwnerHumanDirection setting, review, final decisions
ImplementerClaude CodeDesign, implementation, testing, documentation
ReviewerClaude Code ActionAutomated PR review

AI Behavioral Rules

CLAUDE.md (~400 lines) and 27 rule files structurally govern the AI's behavior. The AI doesn't write freely — it follows rules.

Key rules:

Improvement Feedback Loop

flowchart LR
    A["AI makes a mistake"] --> B["Root cause analysis"]
    B --> C["Record in improvement log"]
    C --> D["Revise CLAUDE.md / rules"]
    D --> E["AI behavior changes"]
    E -.->|Next session| A

Currently 115 improvement records exist. Examples:

CaseProblemCountermeasure
YAGNI/KISS misapplicationAI used YAGNI to justify compromising design qualityAdded rule to distinguish feature scope from design quality
Missing E2E perspectiveAPI works but unusable from UIAdded E2E perspective to completion criteria
Self-verification not executedInstructions to "verify" were ignoredShifted from behavioral norms to deliverable requirements for structural enforcement

Operational Cycle: Diagnose → Reflect → Act

In addition to improvement records, the project regularly diagnoses and reflects on overall health.

flowchart LR
    A["/assess (monthly)<br/>Health diagnosis"] --> B["/retro (weekly)<br/>Improvement cycle review"]
    B --> C["Create Issues"]
    C --> D["/next<br/>Pick next task"]
    D --> E["Implement"]
    E -.-> A
  • /assess: Diagnose across 3 axes — Discovery (unstarted features) / Delivery (backlog) / Sustainability (technical health)
  • /retro: Evaluate improvement effectiveness, recurrence rate & MTTR analysis, Toil analysis, error-budget thinking
  • /next: Select next work item, including actions created from diagnosis results

Quality Strategy: Validation & Verification

Quality is ensured through two layers: Validation (solving the right problem?) and Verification (building it correctly?).

flowchart LR
    A["Issue triage<br/>Validation"] --> B["Design"] --> C["Design review<br/>Defense + Offense"]
    C --> D["Implementation<br/>Design-principle lenses (Offense)"]
    D --> E["Pre-submit check<br/>Defense"]
    E --> F["PR review<br/>Merge"]

→ Details: CLAUDE.md

Technical Highlights

Documentation System

All knowledge is documented — aiming for zero tacit knowledge.

What you want to knowWhere to look
What to build (WHAT)Requirements
What users see (USER)Functional specifications
How to build it (HOW)High-level design / Detailed design
How to operate (HOW TO)Procedures
Why that decision (WHY)ADRs (e.g., ID format / Data deletion / Newtype wrapping)
Technical knowledgeKnowledge base
Implementation walkthroughsImplementation guides (e.g., Authentication)
TestsTests (API test matrices, test specifications)
Development historySession logs

CI/CD & Code Quality

  • GitHub Actions: Efficient parallel CI with change detection
  • Claude Code Action: AI-powered automated PR review
  • Linting: clippy (Rust), elm-review (Elm)
  • Formatting: rustfmt, elm-format

Development Environment

  • Parallel development: git worktree + Docker Compose with persistent slot system for running multiple tasks in isolated environments simultaneously
    • Deterministic port mapping: Predictable port assignments based on slot numbers