YamadaTakaki
    • Create new note
    • Create a note from template
      • 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
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me 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
    • Save as template
    • 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 Create Help
Create Create new note Create a note from template
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
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me 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
    # Merucii再現アプリ作成 ### 機能要件 - ユーザーがコインをためる - ユーザーが別のユーザーにコインを送る - コインを送るときにメッセージを送れる - 持っているコインを消費して交換することができる - 毎週決まったコインが配布される - 配布用コインは残らない ### あってもよい機能 - 集計 - ランキング等、可視化するもの - 匿名投稿 - コメントに返信できたらまあいい - ボーナスタイム --- ### できていること - ユーザ情報の登録・参照 - firebaseのauthとfirestoreを用いてアカウント登録やログインができる - ユーザデータの参照にローカルストレージを用いているため改善したい(が実装が少々大変) - authにe-mailなどのユーザの登録情報、firestoreのusersコレクションに所持コイン数などのユーザ情報を入れている - firestoreの内容 - id: ユーザのID - name: ユーザの名前 - distributedCoin: ユーザの配布用コイン所持数 - receivedCoin: ユーザの受け取ったコイン所持数 - distributedCount: ユーザが他ユーザにコインを送った回数 - receivedCount: ユーザが他ユーザからコインを受け取った回数 - コインの定期配布機能 - date-fnsの関数を用いてあらかじめ設定している配布時間と現在時間を比較し、現在時間が配布時間を過ぎていた時にusersのreceiverCoinを変更し、設定時間を変更する - 設定している配布時間はfirestoreのbonusCoinDayに保存している - コインとメッセージを他者に送る機能 - セレクトボックスで送りたい相手を複数選択できる - 送るコイン数は100枚, 300枚, 500枚の中から選んでいる - 「コインを送る」ボタンを押すと確認ダイアログを開き、ダイアログ内の「送る」ボタンを押すとfirestoreのpostsコレクションに - time: 送った時間 - sender: 送り手 - receivers: 受け手 - send_amount 送ったコインの枚数 - comment: メッセージ として送信している - 景品交換機能 - コインを消費して景品と交換する機能 - 景品交換時に消費されるコインは、firestoreのusersにあるreceivedCoinと連動している。 - trade2000/3000のメソッドで行っている。 - userの中に現在ログインしているアカウントのデータを入れ、そのreceivedCoinから2000/3000ひかれた値をとる。 - firestoreのusersの中からログインしているアカウントと同じものを探して、そのreceivedCoinを先ほど取ったreceivedCoin-2000/3000した値で更新することで、コインが消費されたこととしている。 - ローカルストレージにあるユーザ情報から、どのユーザが景品を交換しようとしているのかを判断し、その人のusersのデータと連動するようにしている - 現在2000コインの景品と3000コインの景品のところで使用している画像は適当にインターネットから持ってきた画像 - 変更したいときはitems2000などにあるsrcのURLを変更することで変えられる - タイムライン - 「誰が」「誰に」「どのくらいのコイン」を「何というコメント」と一緒に「いつ」送ったのかを過去10件分表示する機能 - これらのデータはfirestoreのpostsにあるデータから持ってきている - また、全てのコインの送受信の情報、自分が受け取ったコインの情報、自分が送ったコインの情報を選択してみる機能もある。 - ローカルストレージにあるログインしているユーザの情報から、どのユーザが見ているのかを判断する。 - そのユーザが送った・受け取ったコインの情報を調べて表示している - これを調べるときに、matchを使って調べているため、それが原因でバグが起きるかもしれない。 - test1さんとtest10さんがいる場合、test1さんの受け取った/送ったの情報にtest10さんの情報が出てくるかもしれない。 - whereはうまく使えなかった。 --- ### 主なフォルダ内のファイル名と役割 - components フォルダ内 - loginState.vue - ホーム画面や景品交換の画面の左にユーザ情報を載せる - Nuxtlogo.vue - nuxt.jsのロゴを載せる(未使用) - timeline.vue - ホーム画面にタイムラインを載せる - tutorial.vue - vueのチュートリアル等が書かれたファイル(未使用) - VuetifyLogo.vue - Vuetifyのロゴを載せる(未使用) - layouts フォルダ内 - default.vue - 全てのページにヘッダーやフッターを載せる - error.vue - エラーが起きた際や無効なurlに飛んだ際に書かれた内容を載せる - pages フォルダ内 - chat.vue - firestoreの動作確認用に使用した(現在未使用) - index.vue - ホーム画面を載せる - inspire.vue - プロジェクトを始めた際にできたデフォルトファイル(未使用) - login.vue - ログイン画面を載せる - sendCoin.vue - 他者にコインを送る際の画面を載せる - signUp.vue - アカウント登録画面を載せる - tradeItem.vue - 景品交換画面を載せる --- ### 参考にしたサイト - 公式ドキュメント - [firestore データのクラウド管理](https://firebase.google.com/docs/firestore/query-data/get-data?hl=ja) - [firestore onSnapshot リアルタイムのアップデートを入手](https://firebase.google.com/docs/firestore/query-data/listen?hl=ja) - [firebase auth ユーザ認証等](https://firebase.google.com/docs/auth/web/password-auth?hl=ja) - [date-fns 時間取得系](https://date-fns.org/v2.29.2/docs/Getting-Started) - [Vue ウェブのUI開発に有効なjsフレームワーク](https://jp.vuejs.org/v2/guide/syntax.html) - [vuetify 便利なUIコンポーネント マテリアルデザイン](https://vuetifyjs.com/ja/introduction/why-vuetify/) - ○○のやり方シリーズ - [nuxt.js 起動方法など](https://reffect.co.jp/vue/nuxt-js-first-step) - [firebase データ操作](https://t8.dev/ja/blog/firebase_firestore_nuxtjs/) - [localStorage ウェブにデータを保存する](https://www.granfairs.com/blog/staff/local-storage-01) - 便利な関数シリーズ - [JavaScript 特定の文字列を含むかどうか](https://qiita.com/shimajiri/items/a2d79d9aa1323da972f3) - [find 最初に条件に合った配列を返す](https://ginpen.com/2018/12/04/array-find/) - [filter 条件に合った配列を複数個返す](https://techacademy.jp/magazine/15575) - [指定の文字列/配列を削除](https://webukatu.com/wordpress/blog/9885/) - [forEach for文の拡張](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) - [firestore where クエリ 条件 抽出](https://zenn.dev/tentel/articles/ea7d5c03e68e6d142d98) - その他 - [vueのライフサイクル](https://qiita.com/chan_kaku/items/7f3233053b0e209ef355) - [vsCodeでvue開発をするとき](https://qiita.com/tetusan/items/81b1f863f28731dcb19c)

    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