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
600
ドキュメントからコードを生成したい 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
680
Other Decks in Programming
See All in Programming
GC25 Recap: The Code You Reviewed is Not the Code You Built / #newt_gophercon_tour
mazrean
0
110
AI 駆動開発におけるコミュニティと AWS CDK の価値
konokenj
5
250
その面倒な作業、「Dart」にやらせませんか? Flutter開発者のための業務効率化
yordgenome03
1
140
PHPに関数型の魂を宿す〜PHP 8.5 で実現する堅牢なコードとは〜 #phpcon_hiroshima / phpcon-hiroshima-2025
shogogg
1
340
ALL CODE BASE ARE BELONG TO STUDY
uzulla
28
6.7k
はじめてのDSPy - 言語モデルを『プロンプト』ではなく『プログラミング』するための仕組み
masahiro_nishimi
4
16k
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
490
Domain-centric? Why Hexagonal, Onion, and Clean Architecture Are Answers to the Wrong Question
olivergierke
3
980
SODA - FACT BOOK(JP)
sodainc
1
8.8k
3年ぶりにコードを書いた元CTOが Claude Codeと30分でMVPを作った話
maikokojima
0
650
When Dependencies Fail: Building Antifragile Applications in a Fragile World
selcukusta
0
110
CSC305 Lecture 09
javiergs
PRO
0
310
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
42
2.8k
Testing 201, or: Great Expectations
jmmastey
45
7.7k
Docker and Python
trallard
46
3.6k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.1k
It's Worth the Effort
3n
187
28k
Java REST API Framework Comparison - PWX 2021
mraible
34
8.9k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3k
Code Review Best Practice
trishagee
72
19k
Gamification - CAS2011
davidbonilla
81
5.5k
Making the Leap to Tech Lead
cromwellryan
135
9.6k
4 Signs Your Business is Dying
shpigford
185
22k
Building Better People: How to give real-time feedback that sticks.
wjessup
369
20k
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