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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Seiya Miyata
August 01, 2023
Programming
620
1
Share
ドキュメントからコードを生成したい on Rails 開発
めぐろ LT #5 で発表した「ドキュメントからコードを生成したい on Rails 開発 」の資料です。
Seiya Miyata
August 01, 2023
More Decks by Seiya Miyata
See All by Seiya Miyata
「攻め」のリプレース --- ナレッジワークのユーザー体験を支えるコンテンツ処理システムについて
38tter
0
970
Other Decks in Programming
See All in Programming
CursorとClaudeCodeとCodexとOpenCodeを実際に比較してみた
terisuke
1
510
JOAI2026 1st solution - heron0519 -
heron0519
0
160
AI時代のPhpStorm最新事情 #phpcon_odawara
yusuke
0
240
Import assertionsが消えた日~ECMAScriptの仕様はどう決まり、なぜ覆るのか~
bicstone
2
160
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
160
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
320
AWSコミュニティ活動は顧客のクラウド推進に効くのか / Do AWS community activities help customers adopt the cloud?
seike460
PRO
0
160
Cache-moi si tu peux : patterns et pièges du cache en production - Devoxx France 2026 - Conférence
slecache
0
320
Agentic Elixir
whatyouhide
0
430
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
900
「話せることがない」を乗り越える 〜日常業務から登壇テーマをつくる思考法〜
shoheimitani
4
920
[RubyKaigi 2026] Require Hooks
palkan
1
260
Featured
See All Featured
How GitHub (no longer) Works
holman
316
150k
The untapped power of vector embeddings
frankvandijk
2
1.7k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1k
WCS-LA-2024
lcolladotor
0
560
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.2k
Marketing to machines
jonoalderson
1
5.2k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
23k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
900
The Pragmatic Product Professional
lauravandoore
37
7.2k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
170
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
180
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