JISOU | プログラミングコーチング
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Chapter1 課題2 前回作成した学習記録アプリの欠点が見つかりました それはデータが永続化していないこと。リロードするとすべてのデータが消えてしまうのです あなたはデータを永続化してあなたのスマートフォンから実際にサービスを利用できるよう取り組むことにしました # MVP1 データベースから学習記録データを取得して初期表示する ## TODO - [x] 課題1で作成したアプリを[Vite](https://ja.vitejs.dev/)で作ったReact+JavaScriptの環境の上に作り直してください(コードはコピペでOK) - [x] [Supabase](https://supabase.com/)のアカウントを作成する - [x] 新規プロジェクトを作成する(プロジェクト名はstudy-record、データベースパスワードは適当でOK) - [x] Table Editorで以下のテーブルを作成する テーブル名 : study-record |column|type|option| |---|---|---| |id|uuid|| |title|varchar|non null| |time|int4|non null| ここでtitleやtimeは課題1で自分がつけた名前にすること ![upload_0e71a22e5ba32cc034c4f801b601f609](https://hackmd.io/_uploads/rkXNTk0l0.png) - [x] テストデータを3つ作成する ![upload_8ae5e99972ee4734ef736ca277015e9b](https://hackmd.io/_uploads/rkUSakRlA.png) |title|time| |---|---| |記録1|10| |記録2|2| |記録3|4| - [x] RLSをDisableに設定する 誰でも読み取れる権限にする(disableにしないと権限がないと読み取れない) https://qiita.com/Sicut_study/items/1ab87c0c182fc42ad824 こうなっていればOK ![upload_4a4dc96ddc2cac2b1538a799cdfc7b63](https://hackmd.io/_uploads/Syi8pJAeC.png) - [x] 学習アプリを読み込んだ際に1度データベースから情報を取得してユーザーはみることができる - [x] クライアントを設定する supabaseからのデータは[subapase-client](https://supabase.com/docs/reference/javascript/installing)を利用することで可能 https://supabase.com/docs/reference/javascript/initializing これをみてクライアントの初期設定を行う(他の記事なども参考にすること) [この動画](https://youtu.be/CZlZgRo0bZ4?si=uE9pje_lqepzZjqi)の14分〜が参考になります - [x] .envでシークレット情報を管理する クライアントの設定で紹介した動画では.env.localですが、.envで進めてください。 .envについては[こちら](https://for.kobayashiii.dev/articles/nqbaxkkf8)を読んで理解してみる 環境変数の読み込みに関しては以下も参考にする(VITEプロジェクトは環境変数名を命名規則に乗っ取らないと読み込めない) https://ja.vitejs.dev/guide/env-and-mode.html 動画で.env.localにしていますが、.envというファイル名に変更してください。違いは各自調べること - [x] .gitignoreに.envを追加する プロジェクトURLや鍵などは.envで管理して.gitignoreに追加すること(pushすると悪用されるため) - [x] Githubにpushして.envがリポジトリに含まれていないかを確認する - [x] データベースからデータを取得してuseStateの初期値にする(サイト読み込み時に1回だけ) 以下のようになればOK ![upload_d8990efef3a3b0891f4ab2d87304604a](https://hackmd.io/_uploads/BJKKpkCx0.png) - [x] データ読み込みのタイミング(useEffect)時にLoading画面がでること(loadingのステートをtrue/falseで表示する画面を変える) # MVP2 学習記録を追加する際にデータベースにも記録する ## TODO - [x] 登録を押したらsupabaseのテーブルにもデータを作成してみることができる(リロードしたら追加したデータも初期表示される) # MVP3 - [x] 登録したデータを削除できる - [x] 記録の横に削除ボタンをみることができる - [x] 削除ボタンを押すとデータが削除される(idを参照して削除できるようにする、追加して削除してもできることを確認) - [x] supabaseのテーブルからも削除される # MVP4 アプリをデプロイしてスマホから利用できる - [x] [Firebase](https://firebase.google.com/?hl=ja)のアカウントを作成する - [x] Firebaseのプロジェクトを作成する - [x] ウェブアプリに登録 - [x] Firebase Cliのインストール - [x] firebase login - [x] firebase init hostingをする - [x] アプリをビルドする(npm run build) - [x] デプロイする (firebase deploy) [記事](https://zenn.dev/yumemi_inc/articles/2020-10-06-react-firebase-deploy)を参考にデプロイする(firebase sdkの設定も紹介しているが不要 リンクからアクセスできたら成功(スマホからも確認) ![upload_a2e7da9cd3792a58c5846514c50ad458](https://hackmd.io/_uploads/HJs5aJ0xR.png) [今回の模範解答アプリ](https://study-record-b2afd.web.app/) - [x] [makeコマンド](http://omilab.naist.jp/~mukaigawa/misc/Makefile.html)でデプロイできるようにする(Macは標準で入っています) - [x] makeコマンドをインストールする ``` # Ubuntu $ sudo apt install make ``` - [x] Makefileを作成する 以下のコマンドを実行してファイルを作成 ``` $ touch Makefile ``` 以下の内容を貼り付ける ``` deploy: npm run build firebase deploy ``` - [x] 学習アプリを一部変更する(見た目に見える部分であればどこでもOK、タイトル変えたりボタン名変えたり) - [x] makeコマンドで一発でデプロイする ``` $ make deploy ``` make deployでnpm run buildとfirebase deployを2つ実行してくれる - [x] 新しい変更がデプロイされて反映しているかをチェックする デプロイしたらURLをGithubに追加してください ![upload_976a7bda1ee6210e1877d979631f288c](https://hackmd.io/_uploads/HkqsT1RgR.png) # MVP5 開発者はアプリをgit pushするだけで本番に自動デプロイ(cd)することができる - [x] アプリを CI/CDすることができる - [x] GithubActionsでHelloWorldをすることができる [ハンズオン](https://qiita.com/Teach/items/d2c4d7bec98228df1807)を実施する - [x] Push時にhelloWorldする 調べてみるとすぐわかるはず - [x] Reactをビルドすることができる - [x] Firebaseにデプロイができる デプロイしたアプリを再度アクセスして開ければ成功 ※ 一工夫しないとCDでのデプロイはできません それぞれのステップで何をしているか理解しておくこと https://zenn.dev/jinwatanabe/articles/4026d373383739 # MVP6 CICDに向けて自動テスト(CI)を作成します - [x] Jestとreact-testing-libraryを導入する https://hackmd.io/65Ei6ID0TNG-jCiKJdiDKw - [x] タイトルが表示されている - [x] フォームに学習内容と時間を入力して登録ボタンを押すと新たに記録が追加されている 数が1つ増えていることをテストする - [x] 削除ボタンを押すと学習記録が削除される 数が1つ減っていることをテストする - [x] 入力をしないで登録を押すとエラーが表示される - [x] パイプラインにCIのステップを追加する # MVP7 - [x] READMEを作成する 自分で好きなように書いてください 最低限必要な項目 - サービス名 - サービスの説明 - 環境設定の方法(.envなど) - 起動の仕方 https://qiita.com/Sicut_study/items/3b762364c95e4673bfbe - [x] 記事を1本投稿する

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully