Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
ドキュメントからコードを生成したい on Rails 開発
Search
Seiya Miyata
August 01, 2023
Programming
650
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ドキュメントからコードを生成したい on Rails 開発
めぐろ LT #5 で発表した「ドキュメントからコードを生成したい on Rails 開発 」の資料です。
Seiya Miyata
August 01, 2023
More Decks by Seiya Miyata
See All by Seiya Miyata
「攻め」のリプレース --- ナレッジワークのユーザー体験を支えるコンテンツ処理システムについて
38tter
0
1.4k
Other Decks in Programming
See All in Programming
CodeRabbitの効果検証と過ごしてみた3ヶ月
armondando
0
190
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
350
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
320
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.5k
技術的負債を組織課題として解く-増えすぎたマイクロサービスとの戦い-
reimaru
1
2.9k
Are APIs Still Relevant in the AI Era?
soyuka
0
440
mrbgem 三角測量 開発
ogom
0
210
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.8k
Ghostty + Neovimで作る 透明でカッコ良い開発環境
j341nono
0
150
Kubernetes祭り #2 OP/ED
bells17
0
100
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
150
プロダクトコードからライブラリの境界を見つける
elmetal
PRO
0
110
Featured
See All Featured
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.3k
Music & Morning Musume
bryan
48
7.4k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
77k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
620
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
BBQ
matthewcrist
90
10k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
580
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Mind Mapping
helmedeiros
1
390
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
540
For a Future-Friendly Web
brad_frost
184
10k
KATA
mclloyd
PRO
35
16k
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