A laptop, a phone and a hand writing in a notebook on a wooden desk, banner image on the CRUD App Scaffolder page

ツール/ Buildスイート

CRUD App Scaffolder

エンティティとフィールドに名前を付けると、スキーマ、RESTルート、動作する一覧/フォームUIがコピー可能なファイルとして手に入ります。

作るものの名前(エンティティ、フィールド、タイプ)を入れると、どのCRUDアプリも最初に必要とする3つのファイルが手に入ります。SQLスキーマ、RESTルートのハンドラー、動作する一覧+フォームのページで、互いに整合しています。

ツールを開く
Screenshot of the CRUD App Scaffolder tool

できること

退屈な6割を、一貫した形で。

1つの定義、3つのファイル

スキーマ、ルート、UIは同じフィールド一覧から生成されるため、ずれることがありません。

型付きフィールド

テキスト、数値、真偽値、日付、enumは、適切なSQL型と入力コントロールに対応付けられます。

正直な範囲

出発点を生成するもので、本番用アプリではありません。認証と検証は、追加する場所に印が付いています。

ファイルごとにコピー

各ファイルは個別にプロジェクトへコピーできます。

5つのフィールドタイプ、1つの文法

text、number、boolean、date、enum(値はインラインで指定):plan: enum:free,pro,team。1行に1フィールド、覚えることはそれだけです。

行を示すエラー

形式が正しくないフィールドには、無言で失敗する代わりに、文法を添えた "line 3: use name: type" が返されます。

本物のSQL型

数値はNUMERIC、日付はDATEになり、真偽値の既定はFALSE、enumはCHECK制約になります。どのテーブルにもidとcreated_atの列が付きます。

検証するハンドラー

ルートファイルはすべてのペイロードを整えます。数値は有限、日付はISO形式、enumはあなたの値に一致する必要があります。不正な入力には、各エラーを示す422が返されます。

パラメーター化されたクエリのみ

INSERTは文字列の組み立てではなく $1、$2 のプレースホルダーを使い、一覧ルートは新しい順に最大200行までです。

フィールドに合ったUI

テキスト入力、数値入力、チェックボックス、日付ピッカー、selectがフィールドごとに生成され、ハンドラーファイルが定義するものと同じルートに接続されます。

使い方の流れ

フィールドを入れて、雛形を出す。

手順1

エンティティに名前を付け、フィールドをタイプ付きで並べます。

手順2

スキーマ、ルート、UIのタブを確認します。

手順3

各ファイルをプロジェクトにコピーし、データベースを接続します。

よくある質問

どのスタック?

SQLスキーマ(Postgres風)、fetchベースのルートハンドラー、フレームワーク不要のページ。お使いの環境にそのまま移せます。

リレーションは?

まだ対応していません。フィールドはスカラー値にとどめ、SQLコメントが示す場所に外部キーを追加してください。

SQLには何が含まれますか?

CREATE TABLE IF NOT EXISTS に、シリアルの主キー、あなたの列、created_atタイムスタンプが付きます。リレーションがある場所に外部キーを足すよう促すコメントも入ります。

コードは本番で使えますか?

ルートファイル自身がそう明記しています。本番の前にデータベース層へ接続し、認証を追加してください。検証とパラメーター化されたクエリはすでに組み込まれています。

名前はどのように正規化されますか?

エンティティ名とフィールド名はsnake_caseに変換されるため、PlanType、plan type、plan-type はどれも3つのファイルすべてで plan_type になります。

UIはどのルートを想定していますか?

/api/your-entities への GET と POST、/api/your-entities/:id への DELETE。ハンドラーファイルがエクスポートするルートとまったく同じです。

CRUD App Scaffolderを開く

実例

ツールそのものからの実際の出力。

これはCRUD App Scaffolderが示した入力例に対して返したもので、ツール自体からキャプチャーした実際の出力です。モックアップではありません。

あなたが入力

エンティティ名(内蔵サンプル)

Subscriber

フィールド(内蔵サンプル)

email: text
name: text
plan: enum:free,pro,team
mrr: number
active: boolean
joined: date

タブ

SQL schema

ツールが返す

-- TODO: add foreign keys where relationships exist
CREATE TABLE IF NOT EXISTS subscribers (
  id SERIAL PRIMARY KEY,
  email TEXT NOT NULL DEFAULT '',
  name TEXT NOT NULL DEFAULT '',
  plan TEXT CHECK (plan IN ('free', 'pro', 'team')),
  mrr NUMERIC,
  active BOOLEAN NOT NULL DEFAULT FALSE,
  joined DATE,
  created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
自分の入力で試す

Buildスイートのその他のツール

Font Pairing LabWebhook TesterPricing Page BuilderLanding Page MakerStatus Page Starter
A laptop, headphones, a camera, a phone and a plant on a white desk, seen from above, banner image on the CRUD App Scaffolder page

今すぐ試す。

CRUD App Scaffolderはブラウザー内で動きます。アカウントは不要です。

入力から出力へ

エンティティを入れて、3つのファイルを出す

Entity nameOne field perlineSQL schemaRoute handlersList and formUICRUD AppScaffolderInOut
InEntity nameOne field per lineCRUD AppScaffolderSQL schemaRoute handlersList and form UIOut
名前とフィールドが、スキーマ、ルート、ページになります。

パイプライン

3つのタブ

SQL schemaRoute handlersList and form UIこのファイルをコピー
SQL schemaRoute handlersList and form UIこのファイルをコピー
ファイルごとにタブがある1つの出力ボックス。

仕様シート

初期サンプル

EntitySubscriberFields6Coversall five types
EntitySubscriberFields6Coversall five types
ボックスは動作するエンティティが入った状態で開きます。

仕様シート

フィールド行の文法

図形name: typeTypestext, number, boolean, date,enum:a,bBad linesbecome -- error commentsCaseignored
図形name: typeTypestext, number, boolean, date, enum:a,bBad linesbecome -- error commentsCaseignored
1行に1フィールド。

ビフォー アフター

タイプからSQL列へ

TypeColumntextnumberbooleandateenum:free,pro,teamTEXT NOT NULL DEFAULT emptyNUMERICBOOLEAN NOT NULL DEFAULTFALSEDATETEXT with a CHECK on thevalues
Type to ColumntextTEXT NOT NULL DEFAULT emptynumberNUMERICbooleanBOOLEAN NOT NULL DEFAULT FALSEdateDATEenum:free,pro,teamTEXT with a CHECK on the values
各タイプに対応する列の型があります。

ビフォー アフター

タイプからフォームコントロールへ

TypeControltextnumberbooleandateenumText boxNumber box with any stepCheckboxDate pickerDrop-down with the values
Type to ControltextText boxnumberNumber box with any stepbooleanCheckboxdateDate pickerenumDrop-down with the values
UIは各タイプに合った入力欄を選びます。

ビフォー アフター

名前を整える

You typeColumnMonthly RevenuejoinedAtmonthly_revenuejoined_at
You type to ColumnMonthly Revenuemonthly_revenuejoinedAtjoined_at
名前は小文字とアンダースコアに変換されます。

仕様シート

どのテーブルにも付くもの

idSERIAL PRIMARY KEYcreated_atTIMESTAMPTZ default now()Table nameyour entity, snake case,plus sNotea TODO for foreign keys
idSERIAL PRIMARY KEYcreated_atTIMESTAMPTZ default now()Table nameyour entity, snake case, plus sNotea TODO for foreign keys
フィールド行の周りに。

仕様シート

3つのルートハンドラー

listnewest first, LIMIT 200createvalidate, INSERT, RETURNINGdeleteby id, no body backAuthadd-auth comment included
listnewest first, LIMIT 200createvalidate, INSERT, RETURNINGdeleteby id, no body backAuthadd-auth comment included
一覧、作成、削除。

パイプライン

作成ルート

Read the JSON bodyClean each fieldReturn 422 if anyerrorInsert only thegiven columnsReturn the rowwith 201
Read the JSON bodyClean each fieldReturn 422 if any errorInsert only the given columnsReturn the row with 201
チェックしてから挿入。

仕様シート

クリーン処理でのチェック

numbermust be finitebooleantrue, on, 1 count as truedatemust be YYYY-MM-DDenummust be one of the valuestextkept as a string
numbermust be finitebooleantrue, on, 1 count as truedatemust be YYYY-MM-DDenummust be one of the valuestextkept as a string
各タイプはそれぞれの方法で検証されます。

ビフォー アフター

エラーメッセージの例

InputErrormrr: abcjoined: 5 Mayplan: goldmrr must be a numberjoined must be YYYY-MM-DDplan must be one of free,pro, team
Input to Errormrr: abcmrr must be a numberjoined: 5 Mayjoined must be YYYY-MM-DDplan: goldplan must be one of free, pro, team
フィールドごとに記述されます。

仕様シート

ステータスコード

list200 with rowscreate201 with the new rowbad input422 with the error listdelete204, empty body
list200 with rowscreate201 with the new rowbad input422 with the error listdelete204, empty body
各レスポンスの意味。

仕様シート

省略されたフィールド

Missing, null or emptyskipped in the insertThenthe column default appliesAll omittedINSERT DEFAULT VALUES
Missing, null or emptyskipped in the insertThenthe column default appliesAll omittedINSERT DEFAULT VALUES
一部の項目だけのペイロードでも問題ありません。

仕様シート

データベース結果の形式

Array of rowshandled{ rows } objecthandledHelperrowsOf picks whichever
Array of rowshandled{ rows } objecthandledHelperrowsOf picks whichever
2つのドライバー規約に対応します。

仕様シート

UIファイル

Showsa table plus an add formTalks tothe entity API, GET POSTDELETEEscapesevery cell it rendersEmpty inputsomitted from the POST
Showsa table plus an add formTalks tothe entity API, GET POST DELETEEscapesevery cell it rendersEmpty inputsomitted from the POST
小さな管理ページ。

入力から出力へ

このファイルをコピー

The open tabSQL, routes orUI textReady to pasteinto yourprojectCopyInOut
InThe open tabCopySQL, routes or UI textReady to paste into your projectOut
表示中のタブをコピーします。

パイプライン

入力するとすぐ反映

Name or fieldschangeThe open tabregeneratesErrors list abovethe outputCopy grabs thecurrent tab
Name or fields changeThe open tab regeneratesErrors list above the outputCopy grabs the current tab
生成ボタンはありません。

パイプライン

すべてローカルで動きます

All three filesgenerated in thebrowserNo network callsanywhereCopy is the onlyexport
All three files generated in thebrowserNo network calls anywhereCopy is the only export
スキーマがページの外に出ることはありません。