- About The Practical Dev - DEV Community 👩💻👨💻
- "Where programmers share ideas and help each other grow. It is an online community for sharing and discovering great ideas, having debates, and making friends."
- Qiitaてきな
- FounderはBen Halpern
- Ben Halpern - DEV Profile
- Ben Halpern
- Dev.toを作った事について語っている動画
- Ben Halpern // The Inside Story of @ThePracticalDev [FirstMark's Code Driven] - YouTube
- migrationファイルを見る限り、2015年から開発を行っているもよう
- "Where programmers share ideas and help each other grow. It is an online community for sharing and discovering great ideas, having debates, and making friends."
- DEV Community
- iOS用アプリもあるthepracticaldev/DEV-ios]
- Androidはまだ。thepracticaldev/DEV-Android。
-
-
Save y-yagi/d166b23a5f652c7826d9c47f3a49b858 to your computer and use it in GitHub Desktop.
Ginzarb 63
- https://github.com/thepracticaldev/dev.to
- インストールガイド
- https://docs.dev.to/installation/
- Dockerfileはない
- PRはある WIP: Adds optional support for Docker/Compose
- ↑のガイドに書いてある通りにすれば動く
- bin/setupを叩けばOKなようになっている
- 必要なデータの作成はdb/seeds.rbで
- bin/setupを叩けばOKなようになっている
- Algoliaのセットアップが必要
- Getting API Keys for Dev Environment · DEV Docs
- 他の外部サービスはセットアップしてなくてもアプリケーションの起動はする
- The dev.to tech stack
- Key App Tech & Services · DEV Docs
- 以下ちょっとした補足と↑に無いけど使ってそうなサービスについて
- Algolia | Fast, Reliable and Modern Search and Discovery
- サイト内検索サービス
- Stream
- パーソナライズされたnews feedsやactivityを作成する為のサービス
- Timber
- ログ管理
- Skylight
- パフォーマンスプロファイラサービス
- Netlify
- Stripe
- 有料会員
- Keen
- "BYPASS THE HEADACHES, SHIP CUSTOM USER-FACING ANALYTICS QUICKLY"
- 使ってない…?
- black_box
BlackBox
クラスがある- scoreの計算をしている
- 後はGoogleAnalytic用クラス
- controllers
- 普通にRailsのcontroller
- ちょっと長い、なと思う処理もあるものの、全体的に普通な印象
- dashboards
- administrate(管理画面用gem)用のクラス群
- decorators
- Drapper
- fields
- これもadministrate(管理画面用gem)用のクラス群。Dashboardで使用する。
- helpers
- 普通にRailsのhelper
- javascript
- これは別で
- labor
- ARを継承していないRubyのクラス群
- ビジネスロジックをここに集約している印象
- lib
- acts-as-taggable-onやredcarpetなどの、ライブラリを拡張したコードの置き場
- liquid_tags
- liquidで使う用のTagクラス
- 記事を書く際にLiquid Tagsが使えるようになっており、その独自拡張の為のクラス
- mailers
- 普通にRailsのmailer
- models
- 普通なRailsのmodel
- 基本的にはActiveRecord::Baseの子クラスのみ置いており、プレーンなRubyのclassはここには無い
- email_message.rbやtag.rbのような例外もあり
- observers
- Railsのoveserver
- rails/rails-observers
- policies
- 認可にpunditを使っており、そちらで使用する為のclass
- sanitizers
- rails/rails-html-sanitizerを拡張した独自のsanitizer
- Markdown用
- codeblock用のvaliation処理を独自に行っている
- services
- 素のRubyのclass
- publicメソッドが複数ある
- uploaders
- ファイルのアップロードにcarrierwaveuploader/carrierwaveを使っており、その為のclass
- views
- erb
- jbuilderを使っており、API用のviewもこの配下にある
- app/views/layouts/_styles.html.erb
- (なみだぐましい)
- CSSをHTMLの中に直接埋め込むよう
- 特にコメントなし
- 特にコメントなし
- persistent_csrf_token_cookie.rb
- CSRF protection prevents some webkit users from submitting forms 用のmonkey patch
- rails/rails#21948 (comment) 辺りが詳しい
- CSRF protection prevents some webkit users from submitting forms 用のmonkey patch
- reserved_words.rb
- serviceworker.rb
- rossta/serviceworker-railsを使っていて、その為のinitializer
- ふつう
/hello-goodbye-to-the-go-go-go
のような謎のpathが割とある
- 特にコメントなし
- 先によんでおきたい
- 出来る限りFastlyにcache
- cache対象のページでは
set_cache_control_headers
メソッドでcache用のヘッダーを指定しているCache-Control
とSurrogate-Control
set_cache_control_headers
メソッドはfastly-rails
gemで提供されているメソッド
- cacheしたデータが更新されたら、CacheBusterを使用してcacheをpurge
- cache対象のページでは
- RailsConf 2018での発表資料
- slide: https://docs.google.com/presentation/d/15-kjLHlwFNQoZ0DYZXtky_CRBoZkerZqc1zgvEDnXXc/edit#slide=id.g35565a7ec4_0_6
- video: http://confreaks.tv/videos/railsconf2018-how-we-made-our-app-so-fast-it-went-viral-in-japan
- ページの高速化について説明している
- render-blocking latencyを削減する為、出来る限り非同期で頑張ってる。最低限必要なcssはHTMLに埋め込み。
- layouts/application.html.erb で
render "layouts/styles"
_styles.html.erb
では生成したcssをcacheして、viewのrenderが行われないようにしている
- app/assets/javascripts/initializePage.js.erb で初期化諸々
- bodyのdata属性にユーザ情報を埋め込んでいるが、これを非同期にやるようにしている
- CDNにcacheさせるHTMLにユーザ情報が入らないようにしている
- ユーザデータはlocalStorageにもcacheするようにしてい、そちらからデータが取得出来る場合はそちらの値を使用している
- app/assets/javascripts/serviceworker.js.erb
- install時に最低限必要なassetsをcache
- オフラインで使えるようにしている
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment