Giter Site home page Giter Site logo

sns-backend's People

Contributors

n4mlz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

sns-backend's Issues

ポストの詳細画面でのバグ

Description

  • ポストの詳細表示画面にて、コメントや返信に相互フォローでないユーザーがいるとポストそのものが表示できなくなる

API の作成

Summary

  • API を作成する

API

  • POST /api/posts
  • GET /api/posts/{postId}
  • DELETE /api/posts/{postId}
  • POST /api/posts/comments
  • DELETE /api/posts/comments/{commentId}
  • POST /api/posts/replies
  • DELETE /api/posts/replies/{replyId}
  • GET /api/posts/{postId}/likes
  • PUT /api/posts/like
  • PUT /api/posts/unlike
  • GET /api/posts/timeline
  • GET /api/users/{userName}
  • GET /api/users/{userName}/posts
  • GET /api/users/{userName}/mutuals
  • PUT /api/follows/follow
  • PUT /api/follows/unfollow
  • GET /api/follows/requests
  • PUT /api/follows/reject
  • PUT /api/settings/profile
  • PUT /api/settings/profile/icon
  • PUT /api/settings/profile/bgImage

以下は Cloudflare R2 で代用

  • GET /api/users/{userName}/icon

  • GET /api/users/{userName}/bg-image

  • (いずれは /api/notification も欲しい)

ドメインモデルの見直し

Summary

  • User エンティティ一つ一つに UserRepository を持たせるのは間違いではないか?
  • UserFactoryUserRepository を持たせるのは正しいのか?
    • これが正しくない場合、NewUserFactory()SetDefaultUserFactory() はいらなくなるのではないか?
  • UserId のみを必要とする操作のときに、毎回 getUser() をして DB アクセスが発生するのは非効率なのではないか?
    • 構造体の埋め込みを利用して、Userid のみを必要とする操作と User 自体を必要とする操作で構造体を分けられないか

環境変数の設定

Summary

  • DB の接続設定などを docker や gorm から参照するときに、環境変数を使うようにする

N+1 問題の解決

Summary

  • ネストされたクエリを修正する
  • N+1 問題が発生する部分はインフラ層に分離されている

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.