惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

AI
AI
博客园 - 叶小钗
Blog — PlanetScale
Blog — PlanetScale
Microsoft Azure Blog
Microsoft Azure Blog
Vercel News
Vercel News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
A
About on SuperTechFans
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
阮一峰的网络日志
阮一峰的网络日志
D
Docker
Jina AI
Jina AI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The Register - Security
The Register - Security
J
Java Code Geeks
S
SegmentFault 最新的问题
月光博客
月光博客
G
Google Developers Blog
美团技术团队
Last Week in AI
Last Week in AI
L
LangChain Blog
Apple Machine Learning Research
Apple Machine Learning Research
T
The Blog of Author Tim Ferriss
腾讯CDC
Recent Announcements
Recent Announcements
Recorded Future
Recorded Future
The Cloudflare Blog
有赞技术团队
有赞技术团队
博客园_首页
博客园 - 聂微东
人人都是产品经理
人人都是产品经理
B
Blog
I
InfoQ
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
F
Fortinet All Blogs
B
Blog RSS Feed
Engineering at Meta
Engineering at Meta
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Microsoft Security Blog
Microsoft Security Blog
MongoDB | Blog
MongoDB | Blog
爱范儿
爱范儿
D
DataBreaches.Net
F
Full Disclosure
M
MIT News - Artificial intelligence
博客园 - 司徒正美
H
Help Net Security

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Building EDIFlow - Lessons Learned: What Worked, What Didn't, What's Next (Part 6)
hello-ediflo · 2026-05-14 · via DEV Community

Series: Building EDIFlow - A Clean Architecture Journey in TypeScript (Part 6/6 — Final)
Reading Time: ~10 minutes


The Journey So Far

Over five articles, we built an entire EDI parsing library layer by layer:

Part Layer Key Insight
Part 1 Why? Honest motivation — learning by building
Part 2 Domain Entities, Value Objects, business rules
Part 3 Application Use Cases, Ports, DTOs, Factories
Part 4 Infrastructure Parsers, Repositories, Data Packages
Part 5 Presentation CLI, DI Container, Wiring
Part 6 Lessons What worked, what didn't

Now it's time for honesty. Not "Clean Architecture is amazing" — but what actually happened when one person built a real library with it.


The Numbers (May 2026)

Metric Value
Packages on NPM 13
Tests 711 passing
Code Coverage ≥ 90% (core)
EDIFACT message types 728 (D.96A: 126, D.01B: 211, D.12A: 196, D.20B: 195)
X12 transaction sets 612 (004010: 293, 006040: 319)
HIPAA transaction sets 14
EANCOM messages 49
Total message definitions 1.403
NPM downloads (since Jan 2026) 7.500+
TypeScript errors 0
Time to build ~4 months (solo)

What Worked — And Why I'd Do It Again

✅ Clean Architecture made multi-standard possible

This is the single biggest win. When I started in January 2026 with EDIFACT, I defined IMessageParser, IMessageBuilder, IValidationService in the Application Layer. Three months later, when I added X12 support, zero code changed in the Domain or Application layers. The X12 parser just implemented the same interfaces.

HIPAA? Same interfaces. EANCOM? Same interfaces. The architecture literally paid for itself.

✅ TypeScript strict mode caught real bugs

strict: true in tsconfig.json was non-negotiable from day one. It caught:

  • Missing null checks on optional segment elements
  • Wrong discriminated union narrowing in DTOs
  • Type mismatches between EDIFACT and X12 parser outputs

Estimated bugs prevented: dozens. Worth every extra type annotation.

✅ Test-Driven Development — but not dogmatically

I wrote tests first for domain entities, value objects, and use cases. But for parsers? I wrote the parser first, then added tests — because EDIFACT tokenization logic is discovery work. You don't know the edge cases until you try real messages.

Rule of thumb that worked: TDD for known interfaces (Use Cases, Services). Tests-after for discovery work (Parsers, Tokenizers).

711 tests give me confidence to refactor aggressively.

✅ Data packages as separate npm packages

Each EDIFACT version, each X12 version is its own npm package. Benefits:

  • Users install only what they need
  • Bundle sizes stay small (a D.96A user doesn't download D.20B)
  • Independent versioning — fix a typo in D.96A without releasing all packages
  • 13 packages sounds like a lot, but npm workspaces + tsup make publishing painless

✅ Monorepo with npm workspaces

One repository, 13 packages, shared tooling:

  • One vitest.workspace.ts for all tests
  • One tsup config pattern
  • Cross-package imports via package names (import { X } from '@ediflow/core')
  • npm run build and npm test at root level — CI is simple

✅ Business Object Mapping — the killer feature

This is what no other Node.js EDI library does. Instead of navigating message.segments[3].elements[1].components[0], you get:

const order = mappingService.map(message, structure, 'name');
// order["Beginning of message"]["Document identifier"] === "ORDER-001"

Enter fullscreen mode Exit fullscreen mode

Round-trip: map() converts EDI → JSON, unmap() converts JSON → EDI. Same structure definition drives both directions. This feature alone justifies the entire project.


What Didn't Work — Honest Mistakes

⚠️ I over-engineered the validation architecture early on

The first version had IValidationRule, IValidationService, ComposableValidationService, ValidationResult, ValidationError, StructuralValidationService, StructuralValidationContext... all before I had a second standard to validate.

Lesson: Build the simplest validation first. Extract abstractions when you actually need them (when adding X12). Some of this complexity would have emerged naturally instead of being designed upfront.

⚠️ Data package JSON format evolved 3 times

Version 1: flat JSON with segment references. Version 2: nested with composites. Version 3: with syntax rules and code lists. Each migration touched all 8+ data packages.

Lesson: Prototype the data format with 2-3 message types before generating 195. Schema changes to hundreds of files are painful.

⚠️ README took too long to get right

The first README was a technical spec. Nobody understood what the project does. I rewrote it 4 times before landing on: problem → solution → code example → install.

Lesson: Write the README before writing code. If you can't explain it simply, you don't understand the problem well enough.

⚠️ CLI shipped too early, too buggy

I wanted to publish fast — so the CLI went out with v0.1.0 before it was properly tested end-to-end. The commands looked right on paper, but in practice: wrong output formats, missing edge cases, flags that didn't work as documented.

It wasn't until v0.3.0 — when I wrote real examples for every standard (EDIFACT, X12, HIPAA, EANCOM) and actually ran them — that the CLI became reliable. Generating examples forced me to use the CLI the way a real user would. Every bug surfaced immediately.

Lesson: Unit tests prove your code works in isolation. But nothing replaces running real EDI files through the full pipeline end-to-end. Write examples first — they're the best integration tests you'll ever have.


What I'd Change If Starting Over

1. Start with 2 standards from day one

I built EDIFACT first, then added X12. The interfaces were mostly right — but "mostly right" means small refactors in 50+ files when adding the second standard. If I'd built EDIFACT and X12 in parallel from the start, the abstractions would have been better immediately.

2. Schema-first data package design

Define the JSON schema for message definitions first, validate it, then generate data. I did it backwards: generate data, then realize the schema isn't quite right, refactor.

3. Fewer abstraction layers in core

Some classes in @ediflow/core exist for architectural purity rather than practical need. EDIMessageFactory.create() is a wrapper around a constructor. EDIMessageValidationService is a thin wrapper around ComposableValidationService. If it adds indirection without value, remove it.


The Architecture in One Diagram

┌─────────────────────────────────────────┐
│  CLI (commander.js)                     │  Presentation
│  ┌───────────────────────────────────┐  │
│  │  DI Container                     │  │  Wiring
│  │  ┌─────────────────────────────┐  │  │
│  │  │  EDIFACT Parser · X12 Parser│  │  │  Infrastructure
│  │  │  File Repository · Builders │  │  │
│  │  │  ┌───────────────────────┐  │  │  │
│  │  │  │  Use Cases · Services │  │  │  │  Application
│  │  │  │  Ports · DTOs · Factory│ │  │  │
│  │  │  │  ┌─────────────────┐  │  │  │  │
│  │  │  │  │ EDIMessage      │  │  │  │  │  Domain
│  │  │  │  │ Segment · Element│ │  │  │  │
│  │  │  │  │ Standard · Delim│  │  │  │  │
│  │  │  │  └─────────────────┘  │  │  │  │
│  │  │  └───────────────────────┘  │  │  │
│  │  └─────────────────────────────┘  │  │
│  └───────────────────────────────────┘  │
└─────────────────────────────────────────┘

Enter fullscreen mode Exit fullscreen mode

Dependencies point inward. Always. No exceptions.


What's Next for EDIFlow

Feature Timeline Status
Platform / Web UI Q4 2026 Planned
REST API Q3 2026 Planned
IDOC / SAP 2027 Vision
VDA (automotive) 2027 Vision
More HIPAA sets Q3 2026 Planned

The architecture makes all of this possible. Adding a REST API? Another Presentation Layer → same Use Cases → same Infrastructure. Adding IDOC? Another Infrastructure implementation → same Application Layer interfaces.

That's the promise of Clean Architecture. And after 4 months and 711 tests, I can say: it delivers.


Thank You

If you've read all 6 parts — thank you. Writing this series forced me to think clearly about every decision. I hope it helps you build better TypeScript applications, whether that's an EDI library or something completely different.

The core principles are universal:

  • Dependencies point inward
  • Interfaces before implementations
  • Test what matters, not what's easy to test
  • Ship early, tell people, iterate

Full series: Parts 1-6
GitHub: @ediflow/core
NPM: @ediflow

⭐ If EDIFlow or this series helped you — a GitHub Star means the world to a solo open-source developer: github.com/ediflow-lib/core


"Water doesn't fight obstacles. It flows."

Thank you for flowing through this series with me. 🌊