フルスタック2025注目

FabWorks

鉄骨加工プラットフォーム

fab-works.vercel.app
FabWorks – 鉄骨加工プラットフォーム screenshot 1 of 1
01

課題

鉄骨加工会社がリード管理、見積もり、顧客フォローを電話と紙で行っており、一貫した見積作成や進捗共有ができなかった。

02

アプローチ

公開サイトとバックオフィスを兼ねたNext.js 16アプリを構築:Cloudflare Turnstile保護付きリード受付、原価計算ベースの見積エンジン、7段階の見積ライフサイクルと活動ログ、PDF見積書生成、MongoDB永続化、OCI Object Storage、顧客向け進捗ポータル。

03

成果

リードが原価計算済みのPDF見積書になり、顧客は安全なワンタイムリンクから承認・却下・修正依頼が可能。期限切れ見積は日次ジョブで自動処理。

システム設計

FabWorks の構成

技術アーキテクチャの説明は英語です。

A Next.js Pages Router application that is both the public website and the business back office: lead and quotation intake, a client project-tracking portal, and an admin panel with a costed fabrication-estimate engine and a quotation lifecycle that ends in a customer accepting or rejecting a PDF quote by secure link.

quotation states, enforced transitions
7
single-use quote links, stored hashed
256-bit
MongoDB models
16
function budget the PDF design fits
1 GB / 10 s

01 · Clients

client

Visitors & customers

client

Admin staff

02 · Next.js app

gateway

Middleware

per-route cache policy

service

Public site

services, gallery, quotes, tracking · i18n

service

Admin panel

content, leads, estimates

03 · API

service

API routes

Zod DTOs, JWT cookie, rate limits

service

Quotation engine

calc engine, state machine, audit log

worker

Vercel Cron

expire quotations daily

04 · Data

database

MongoDB

Mongoose

16 models

object store

OCI Object Storage

drawings, attachments

05 · Third-party

third-party

PDF render API

hosted browser · Chrome fallback

third-party

SMTP

Nodemailer

third-party

Cloudflare Turnstile

bot check on public forms

clientgatewayserviceworkerdatabaseobject storethird-party

14 connections

  • Visitors & customers→MiddlewareHTTPS
  • Admin staff→MiddlewareHTTPS
  • Middleware→Public site
  • Middleware→Admin panel
  • Public site→API routesleads · quotes · respond
  • Admin panel→API routesCRUD · estimates
  • API routes→Cloudflare Turnstileverify
  • API routes→Quotation engine
  • Quotation engine→MongoDB
  • API routes→MongoDB
  • API routes→OCI Object Storageupload
  • Quotation engine→PDF render APIHTML → PDF
  • Quotation engine→SMTPquote email · async
  • Vercel Cron→Quotation engineexpire stale · async

Request flow · From lead to accepted quotation

  1. 1A visitor requests a quote by materials, an uploaded drawing or a gallery design; Turnstile and a rate limit screen the form and the API stores an intake record.
  2. 2Staff build a costed quotation from line items, templates and material rates; the engine computes subtotals, charges, tax and margin.
  3. 3Sending renders the quote to PDF and emails it with a link carrying a random 256-bit token, of which only the hash is stored.
  4. 4The customer accepts, rejects or requests changes through that link; the state machine allows only legal transitions and a daily cron expires what was never answered.

Design decisions

An explicit state machine
draft → sent → viewed → accepted / rejected / expired, with cancellation from any open state; every transition is checked and written to an activity log.
Links as hashed bearer tokens
A quote link carries a random token; only its hash is stored, so a database read never yields a working link, and expired or revoked links answer 410 or 404.
PDF rendering off the function
Vercel Hobby limits (1 GB, 10 s) are too tight for in-process Chromium, so PDFs render through a hosted browser API behind one htmlToPdfBuffer() entry point.
Intake and estimate stay separate
A public request is a lead; a costed fabrication quotation is a bill of materials. Keeping them apart stops marketing forms from shaping estimating data.
Cache policy at the edge
Middleware marks forms and admin as no-store, catalog APIs as cacheable and static assets as immutable.

Trade-offs & known limits

  • The client tracking portal is gated by order id and phone with a sessionStorage marker: convenient, but not a full authenticated session.
  • WhatsApp sending is a pre-filled wa.me link the admin opens, not automated delivery.

同じようなプロジェクトをお考えですか?

フリーランス・業務委託のご依頼を受け付けています。お気軽にご相談ください。