AlMikan
    • 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
    ## frontend - issueベース - branchの切り方  **#[issue番号]-[やること]** - iconはreact icon - fontは要相談 - sign up画面ではPOSTせず,プロフィール入力が完了した時点でPOSTする。 - session認証 - 毎回headerに入れる - dependencies - chakra-ui - react-icons - react-router-dom ## Backend - users - id - user_name - email - password - description - isParent - created_at - updated_at CREATE TABLE `users` ( `id` INT NOT NULL AUTO_INCREMENT, `user_name` VARCHAR(255) NOT NULL, `email` VARCHAR(255) NOT NULL UNIQUE, `password` VARCHAR(32) NOT NULL, `description` TEXT, `isParent` BOOLEAN NOT NULL, `created_at` datetime default current_timestamp, `updated_at` timestamp default current_timestamp on update current_timestamp, PRIMARY KEY (`id`) ); - posts - id - user_id - title - description - created_at - updated_at CREATE TABLE `posts` ( `id` INT NOT NULL AUTO_INCREMENT, `user_id` INT NOT NULL, `title` VARCHAR(255) NOT NULL, `description` TEXT NOT NULL, `created_at` datetime default current_timestamp, `updated_at` timestamp default current_timestamp on update current_timestamp, FOREIGN KEY (`user_id`) REFERENCES users(`id`), PRIMARY KEY (`id`) ); - comments - id - post_id - user_id - comment - created_at - updated_at CREATE TABLE `comments` ( `id` INT NOT NULL AUTO_INCREMENT, `post_id` INT NOT NULL, `user_id` INT NOT NULL, `comment` TEXT NOT NULL, `created_at` datetime default current_timestamp, `updated_at` timestamp default current_timestamp on update current_timestamp, FOREIGN KEY (`post_id`) REFERENCES posts(`id`), FOREIGN KEY (`user_id`) REFERENCES users(`id`), PRIMARY KEY (`id`) ); - session - user_id - session CREATE TABLE `session` ( `user_id` INT NOT NULL, `session` VARCHAR(32) NOT NULL, PRIMARY KEY (`user_id`), FOREIGN KEY (`user_id`) REFERENCES users(`id`) ); ### api.kitaq.qqey.net/signup POST #### 新規登録時に使います user_name,email,password(MD5),isParent(1 or 0),file,description(null) POST内容 ```json { "user_name": "名前", "email": "メールアドレス", "password": "パスワード", "isParent": 1, "file": "(base64になった画像)", "description": "説明文(省略可)" } ``` 登録成功時 ステータスコード:200 header ``` set-Cookie session=[session_id] ``` body ```json { "status": "OK", "user_data": { "description": "", "image_url": "http://api.kitaq.qqey.net/static/users/44.webp", "isParent": "1", "user_id": 44, "user_name": "aiueo" } } ``` 登録失敗時 (登録しようとしているemailが使用されてると出力されます) ステータスコード:400 ```json { "status": "NG" } ``` ### api.kitaq.qqey.net/login POST #### ログイン時に使います POST内容 ``` { "email": "メールアドレス", "password": "パスワード" } ``` ログイン成功時 ステータスコード:200 header ``` set-Cookie session=[session_id] ``` body ```json { "status": "OK", "user_data": { "description": "ユーザーの説明文です", "image_url": "http://api.kitaq.qqey.net/static/users/1.webp", "isParent": 1, "user_id": 1, "user_name": "ほげほげ" } } ``` ログイン失敗時 ステータスコード 400 header 送信なし body ```json { "status": "NG" } ``` ### api.kitaq.qqey.net/users GET #### トップページのユーザー情報を取得するときに使います 送信(ブラウザで自動的にされると思います 非ログイン時の状態もあるので必須ではありません) ・sessionが含まれたCookie 成功時 ステータスコード 200 body ```json [ { "description": "ユーザーの説明文です", "image_url": "http://api.kitaq.qqey.net/static/users/1.webp", "user_id": 1, "user_name": "ほげほげ" }, { "description": "ふがふがさんの説明文です。", "image_url": null, "user_id": 2, "user_name": "ふがふが" }, { "description": "siueo", "image_url": null, "user_id": 11, "user_name": "aiueo" } ] ``` image_urlはユーザー登録時必須なのでnullは出ないと思いますが、念のため return [user_id,user_name,description,image_url] ### api.kitaq.qqey.net/users/:id GET #### ユーザーの個別タイムラインを取得するときに使います 送信 Cookie 成功時 ステータスコード 200 ```json { "status": "OK", "user_name": "ほげほげ", "image_url": "http://api.kitaq.qqey.net/static/users/1.webp", "posts": [ { "comments": 1, "created_at": "2022-09-06 13:44:40", "description": "投稿の説明文です。NULLはダメ", "image_url": "http://api.kitaq.qqey.net/static/posts/1.webp", "post_id": 1, "title": "投稿のタイトル" }, { "comments": 1, "created_at": "2022-09-07 12:45:11", "description": "ああああああああああああああああああああああああ 投稿テス2", "image_url": null, "post_id": 2, "title": "投稿のテスト2個目" } ] } ``` 失敗時 ステータスコード 404 ```json { "status": "NG" } ``` 200 return user_name,image_url,[post_id,created_at,image_url,title,description,comments] ### api.kitaq.qqey.net/posts/:id GET #### 投稿の内容を表示するときに使います 送信 Cookie 成功時 ```json { "comments": [ { "comment": "コメントの中身", "created_at": "2022-09-06 13:44:40", "id": 1, "image_url": "http://api.kitaq.qqey.net/static/users/1.webp", "post_id": 1, "user_name": "ほげほげ" }, { "comment": "コメントの中身", "created_at": "2022-09-08 10:52:35", "id": 2, "image_url": null, "post_id": 1, "user_name": "ふがふが" } ], "description": "投稿の説明文です。NULLはダメ", "image_url": "http://api.kitaq.qqey.net/static/users/1.webp", "posts_id": 1, "title": "投稿のタイトル", "user_id": 1 } ``` 失敗時 ステータスコード 404 ``` { "status": "NG" } ``` 200 return post_id,created_at,image_url,title,description,{comments[{id,user_id,user_name,image_url,created_at,comment}]} ### api.kitaq.qqry.net/posts/:id DELETE #### 投稿を削除するときに使います 投稿したユーザーのCookieが必要です 削除成功時 ステータスコード:200 ``` { "posts_id": 3(削除したid) "status": "OK" } ``` 認証系失敗時 ステータスコード:401 or 403 (403は他のユーザーの投稿を消そうとした場合に返されるので、通常は起こらないと思います。) ``` { "status": "NG" } ``` 削除失敗時 ステータスコード:404 ``` { "status": "NG" } ``` ### api.kitaq.qqey.net/posts/:id/comments POST #### コメントを投稿をするときに使います。 ログインされている状態が必要です。 Cookie,comment POST内容 ``` { "comment": "コメント" } ``` 成功時 ステータスコード 200 ``` { "comment_id": 4, "status": "OK" } ``` セッション切れなどの認証失敗時 ステータスコード:401 ``` { "status": "NG" } ``` 投稿失敗時 ステータスコード:404 ``` { "status": "NG" } ``` 201 return success ### api.kitaq.qqey.net/posts/:id/comments DELETE #### コメントを削除するときに使います コメントを投稿したユーザーのCookieが必要です POST内容 ``` { "comment_id": コメントID } ``` 成功時 ステータスコード 200 ``` { "comment_id": 4, "status": "OK" } ``` セッション切れなどの認証失敗時 ステータスコード:401 ``` { "status": "NG" } ``` 投稿したユーザーと削除しようとしているユーザーが異なるとき (通常は発生しないと思います) ステータスコード:403 ``` { "status": "NG" } ``` 投稿失敗時 ステータスコード:404 ``` { "status": "NG" } ``` ### api.kitaq.qqey.net/post POST #### 新規投稿をするときに使います Cookie POST内容 ``` { "file": base64になった画像, "title": "タイトル", "description": "説明文" } ``` 登録成功時 ステータスコード:200 登録に成功すると、登録時に発行されたpost_idが返却されます ```json { "post_id": 4, "status": "OK" } ``` 認証系失敗時 ステータスコード:401 ```json { "status": "NG" } ``` form送信された内容が足りない (通常は起こらないと思います) ステータスコード:400 ```json { "status": "NG" } ``` サーバーエラー ステータスコード:500 ```json { "status": "NG" } ``` 201 return success ### api.kitaq.qqey.net/user PATCH #### ユーザー情報を更新するときに使います Cookie form送信(どれかあればOK) ``` //例 //全部更新 { "user_name": "ユーザー名", "file": base64になった画像, "description": "説明文" } //ユーザー名だけ更新 { "user_name": "ユーザー名" } ``` 成功時 ステータスコード:200 ```json { "status": "OK" } ``` 失敗時 ステータスコード:400 ``` { "status": "NG" } ``` 200 return success

    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