Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ドキュメントからコードを生成したい on Rails 開発
Search
Seiya Miyata
August 01, 2023
Programming
1
610
ドキュメントからコードを生成したい on Rails 開発
めぐろ LT #5 で発表した「ドキュメントからコードを生成したい on Rails 開発 」の資料です。
Seiya Miyata
August 01, 2023
Tweet
Share
More Decks by Seiya Miyata
See All by Seiya Miyata
「攻め」のリプレース --- ナレッジワークのユーザー体験を支えるコンテンツ処理システムについて
38tter
0
720
Other Decks in Programming
See All in Programming
Pythonではじめるオープンデータ分析〜書籍の紹介と書籍で紹介しきれなかった事例の紹介〜
welliving
3
780
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
680
Grafana:建立系統全知視角的捷徑
blueswen
0
280
[AtCoder Conference 2025] LLMを使った業務AHCの上⼿な解き⽅
terryu16
6
1k
perlをWebAssembly上で動かすと何が嬉しいの??? / Where does Perl-on-Wasm actually make sense?
mackee
0
310
Basic Architectures
denyspoltorak
0
180
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
530
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
2.4k
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
480
大規模Cloud Native環境におけるFalcoの運用
owlinux1000
0
250
Context is King? 〜Verifiability時代とコンテキスト設計 / Beyond "Context is King"
rkaga
10
1.5k
生成AI時代を勝ち抜くエンジニア組織マネジメント
coconala_engineer
0
39k
Featured
See All Featured
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
280
Exploring anti-patterns in Rails
aemeredith
2
220
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.8k
From π to Pie charts
rasagy
0
110
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
0
89
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
63
Faster Mobile Websites
deanohume
310
31k
The browser strikes back
jonoalderson
0
300
Designing Powerful Visuals for Engaging Learning
tmiket
0
200
How to train your dragon (web standard)
notwaldorf
97
6.5k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
37
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Transcript
社外秘 Confidential ドキュメントからコードを生成したい on Rails 開発 ラクスル株式会社 宮田 聖也
© 2021 RAKSUL, inc. All rights reserved. 社外秘 Confidential 自己紹介
サーバーサイドエンジニア 印刷のラクスルのエンタープライズ向け開発 • 16 時退勤が夢です 好き:DevOps、エレキギター、フィルムカメラ、 欧州サッカー、クラフトビール 2 @38tter_miya
© 2021 RAKSUL, inc. All rights reserved. 社外秘 Confidential よくある
Rails 新規開発の流れ Ruby on Rails : MVC (Model - View - Controller) フレームワーク 1. モデル設計 ドメイン知識をモデル定義に落とし込む ER 図等でドキュメント管理する 2. マイグレーション マイグレーションファイルを書く 3. ビジネスロジックの記述 3
© 2021 RAKSUL, inc. All rights reserved. 社外秘 Confidential モデル設計:Notion
に、 ER 図描きつつ、あーだこーだ(字余り) 4 オンラインでありがちな状況 最近よく使うのは mermaid 記法
© 2021 RAKSUL, inc. All rights reserved. 社外秘 Confidential モデル設計:Notion
に、 ER 図描きつつ、あーだこーだ(字余り) 5 https://mermaid.js.org/
© 2021 RAKSUL, inc. All rights reserved. 社外秘 Confidential 悩み:熱いうちに鉄を打ちたい
モデル定義が固まったあとはすぐ開発に取り掛かりたい モデル議論の後 = 開発効率が高い状態 ドキュメントからマイグレーションへの変換 地味にまどろっこしい `rails generate migration` でボイラープレートを生成する感覚で、変換したい ... そこで... 6
© 2021 RAKSUL, inc. All rights reserved. 社外秘 Confidential mergration
という gem を作りました (mer)maid の ER 図をパースして mi(gration) ファイルを生成 7
© 2021 RAKSUL, inc. All rights reserved. 社外秘 Confidential mergration
という gem を作りました (mer)maid の ER 図をパースして mi(gration) ファイルを生成 8
© 2021 RAKSUL, inc. All rights reserved. 社外秘 Confidential デモ
9
© 2021 RAKSUL, inc. All rights reserved. 社外秘 Confidential やっていること
1. mermaid 記法のパース kramdown という markdown パーサーを拡張して mermaid に対応 2. マイグレーションファイルの生成 マイグレーションのテンプレートを用意 パース結果を元にマイグレーションを動的に生成 10
© 2021 RAKSUL, inc. All rights reserved. 社外秘 Confidential 所感&これからやりたいこと
「ドキュメントからボイラープレート生成」の開発者体験は良い プロトタイピング、ハッカソン等、開発時間限られる場合にも good 「ドキュメントとコードを同期できる」体験にも近づけたい 編集後の ER 図から差分のマイグレーションファイルの生成 シーケンス図による記述から、コードの雛形を生成 11
© 2021 RAKSUL, inc. All rights reserved. 社外秘 Confidential PR,
issue, feature request コメント等々 お待ちしています!! 12 https://github.com/38tter/mergration