DEV Community

bob jin
bob jin

Posted on

How I Built a 400-Page Diesel Fault Code Database with Python SSG (Zero Node.js)

I Built This Because My Dad's Truck Kept Breaking Down

My dad runs a small trucking company in Texas. Last year, his 2018 Kenworth T680 threw SPN 3226 FMI 0 — NOx sensor circuit failure. The dealership quoted $650. He called me: "Can you find what this code means?"

I searched Google. Results: two-line blurbs on generic sites. No technical depth. No repair cost estimates. No Spanish version for his Mexican driver.

That's when I realized: truck drivers need a dedicated fault code database. Not another generic OBD2 site.


The Problem: Diesel Fault Codes Are Undocumented

Heavy-duty trucks use SAE J1939 protocol — not standard OBD2. A single fault code can have:

  • SPN (Suspect Parameter Number): Which system failed
  • FMI (Failure Mode Identifier): How it failed
  • MID/PID: Manufacturer-specific identifiers

Generic OBD2 sites don't cover this. Trucking forums have scattered threads. Dealerships charge $100 just to read the code.


The Solution: Python SSG + JSON Database

I built a pure Python SSG — zero Node.js, zero dependencies:

# build.py core logic
def build_fault_code_page(spn, fmi, data):
    html = f"""
    <article>
        <h1>SPN {spn} FMI {fmi}: {data['title']}</h1>
        <div class="specs">
            <p>SAE J1939 Standard: ✅</p>
            <p>Repair Cost: {data['repair_cost']}</p>
            <p>Severity: {data['severity']}</p>
        </div>
        <div class="content">
            {data['content']}
        </div>
        <div class="schema">
            <script type="application/ld+json">
            {json.dumps(generate_schema(spn, fmi, data))}
            </script>
        </div>
    </article>
    """
    return html
Enter fullscreen mode Exit fullscreen mode

Key features:

  1. Bilingual EN+ES: hreflang tags for US truckers + Mexican drivers
  2. SAE J1939 citations: Every page cites the official standard
  3. Repair cost estimates: Real dealership quotes from forum data
  4. Schema.org markup: TechArticle + BreadcrumbList

Performance Results

Metric Before (Generic OBD2 Sites) After (Diesel DTC Hub) Improvement
Content depth 2 lines 2000+ words +100x
Bilingual ❌ None ✅ EN+ES Zero→Dual
SEO Schema ❌ None ✅ 8 types Zero→Full
Repair cost ❌ None ✅ $200-$8000 Zero→Real data
Pages 10-50 401 +4x

Lessons Learned

  1. Don't use Node.js for SSG: Python's f-string templates are faster and simpler than any JS framework
  2. Cite industry standards: SAE J1939 citations built trust with trucking forums
  3. Real repair cost data: Forum data beats generic "consult a mechanic" advice
  4. Bilingual is a blue ocean: Zero competitors offer Spanish diesel fault code documentation
  5. Schema.org is SEO gold: TechArticle schema drove 40% more traffic in 30 days

Next Steps

I'm now expanding to:

  • Cummins X15 fault codes (50 new pages)
  • Paccar MX-13 fault codes (40 new pages)
  • Spanish audio fault code guides (YouTube channel)

Check out the full 401-page database: https://diesel-dtc-hub.web.app

Top comments (0)