Coder Social home page Coder Social logo

yuki0920 / go-notes Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 1.48 MB

Go×Nuxt.js製WEBノート

Home Page: https://golang-notes.netlify.app

Go 71.66% JavaScript 5.15% Shell 0.52% Dockerfile 1.10% Makefile 0.50% Vue 19.85% SCSS 0.89% TypeScript 0.33%
go nuxtjs

go-notes's Introduction

Stats

My Portfolio

  • Title(in English): Japan Listed Companies
  • Title(in Japanese): 上場企業ランキング
  • Description: Website of Japanese listed companies. You can see rankings by sales, profits and salaries by English or Japanese.
  • Tech Stack: Ruby, Go, Next.js

go-notes's People

Contributors

dependabot[bot] avatar yuki0920 avatar

Watchers

 avatar

go-notes's Issues

記事にカテゴリー用タグを付けられるようにする

TODO

  • テーブル設計
  • マイグレーション作成 & 適用
  • カテゴリー一覧取得API追加、カテゴリー作成作成API追加
  • 記事一覧取得取得API修正、記事取得API修正
  • API実装
  • フロントエンドライブラリ選定 => Vue Multiselect
  • フロントエンド記事編集時カテゴリ紐付け
  • フロントエンド記事作成時カテゴリ紐付け
  • フロントエンドカテゴリ表示実装(詳細、一覧)

全体のレイアウト調整

  • ヘッダー・フッターの色
  • フッターの位置を下部に固定する
  • fontawesomeのアイコンをBootstrap Iconに置き換える
  • aタグをnuxt-linkに変更
  • 外部サイトのaタグを別タブで開くようにする

Herokuにコンテナをデプロイする

  • Herokuのアプリを作成する
  • APIディレクトリをデプロイする
  • 環境変数を追加する
  • DBにMySQLを指定する
  • DB作成、マイグレーションをする

参考

デプロイ関連

環境変数定義

DBをモックしてリクエスト、レスポンスのテストをする

現状handelrはrepositoriyをimportして使っているため、repositoryをモックしづらい(できない?)状況にある。
各リポジトリの役割、設計を見直し、テスタビリティを高めたい

残TODO

TODO

APIの既存実装削除

/API に使用しないエンドポイント、HTML,JS,CSS,が残っているので削除する

削除可能なハンドラ

ArticleIndex
ArticleNew
ArticleShowData
ArticleEdit
ArticleUpdateData
ArticleSample

記事作成・更新・削除に認証を追加する

参考

モデル

# paswordはハッシュしたバイトのためjson,dbにマッピングしない
type User struct {
	Id        uint   `json:"id" db:"id"`
	Name     string `json:"name" db:"name"`
	Password  []byte `json:"-"`
}

エンドポイント

Method URL Parameter Response 説明
GET /user Authorization ユーザ名を返す ユーザ情報を返す
Method URL Body Response 説明
POST /login id, password Tokenを返す ログインを行う

JWTのトークン(Claim)

カスタムせず、既存のを使う

  • name: ユーザー名
  • exp: 有効期限

TODO

タスク1

  • JWT認証に関するフローをREADMEにまとめる
  • ユーザー情報保存用のテーブルを生成する
  • ユーザー用のサンプルデータを生成する
  • ユーザーの検証用のログイン用のエンドポイントを追加する

タスク2

  • ログイン用のエンドポイントでJWTを生成し返すようにする
  • ユーザー情報取得用のエンドポイントを用意する
  • ログアウト用のエンドポイントでJWTを破棄する
  • ログイン画面追加

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.