Code Monkey home page Code Monkey logo

mitty-server's Introduction

開発

ローカルではdocker-compose startして開発を行う。

$ cd mitty-server
$ docker-compose start
$ docker-compose logs -f

githubに反映

$ git push origin master

サーバーに反映

$ ssh -i ~/.ssh/mitty-2017.pem [email protected]
$ cd go/src/mitty.co/mitty-server
$ git pull origin master
$ docker-compose logs -f

Error

input error

status: 400

{
  "errors":[
    "tag Required",
    "type Required"
  ]
}

internal server error

status: 500

{
  "errors":[
    "database insert error"
  ]
}

goose

# migrationファイル作成
$ goose -dir db/migrations create xxxx sql

# migrationファイルをDBに反映
$ goose -dir db/migrations postgres "postgres://root:[email protected]:5432/mitty_db?sslmode=disable" up

mitty-server's People

Contributors

domanthan avatar

Watchers

James Cloos avatar Dongri Jin avatar  avatar

mitty-server's Issues

server start error

何かが不都合で、サーバー startup errrorになる
postgres.go の不具合?

docker-compose start

mitty-server | 2017/05/04 16:41:45 stderr: mitty.co/mitty-server/app/models.AddTableWithName(0xc420014c60)
mitty-server | 2017/05/04 16:41:45 stderr: /go/src/mitty.co/mitty-server/app/models/postgres.go:13 +0x58d
mitty-server | 2017/05/04 16:41:45 stderr: main.main()
mitty-server | 2017/05/04 16:41:45 stderr: /go/src/mitty.co/mitty-server/server.go:39 +0x180

elastic Search

Elastic Searchのインストールお願いします。
JDKなども必要あったらインストール。

テーブル変更

1. UserテーブルにIcon を追加。
  今のUsersテーブルにはIcon項目がない。
  ユーザー情報を表示する際の随所びIconを表示必要。
  UsersテーブルにIcon のURLを直接置き、便利を図る。

  users.sqlを参照
  04b1544#diff-02c979f500f490a6baffc5f4859d3c80R11

  1. Eventのanticipation -> participation
     単純に英語の意味を間違ってた。
      参加する意味を求めてったが、間違ってanticipation(見込みの意味)を定義してしまった。
      events.sqlを参照
      04b1544#diff-d7488f7c2627bab6080d03e8dedfe94fR32

server データリセット

ごめんなさい。

私のせいで、server側のデータがちょっとめちゃくちゃの状態。
一度リセットしてほしいです。

  1. s3のデータ
    全部消していいです。

2.elasticsearchデータ
 全件消していいです。

3.goose
conversationとrequestテーブル分を追加。
 
4.postgresql
 usersテーブル以外は全件消す。

よろしくお願いします。

Apiが成功したのに、stderrが出力されている

2017/06/05 08:56:37 stderr: time="2017-06-05T08:56:37Z" level=info msg=OK method=GET path="/api/search/event" remote_addr="172.17.0.1:44586" request_time="2017-06-05T08:56:37Z" status=200 time_taken=13ms
2017/06/05 09:27:09 stderr: time="2017-06-05T09:27:09Z" level=info msg=OK method=GET path="/api/event/of" remote_addr="172.17.0.1:44586" request_time="2017-06-05T09:27:09Z" status=200 time_taken=11ms

これらのapiはstatus=200になっているし、アプリ側も問題ないのに、なぜstderrが出力されるですか

dockerが動かない、Help

-Dockerを起動しようとしたら、エラーが出ました。

gridscalenoMBP:mitty-server gridscale$ docker-compose up
Creating mitty-server

ERROR: for mitty-server Cannot create container for service mitty-server: Could not get container for postgres
ERROR: Encountered errors while bringing up the project.
gridscalenoMBP:mitty-server gridscale$

活動一覧検索

各ユーザーの自分所有する活動の一覧を取得する。
(活動とはそれぞれ自分の分しか見てはならない)

一覧に表及び次のステップに必要な項目は下記通り
1・ ID 活動のID
2・EventID メインイベントID
3・日付: メインイベントの開始日時
4・Title:タイトル: 活動テーブルのタイトルを取得
5・eventLogUrl : EventsのLogo_idに結びつくContentsのLink_URL

https://github.com/gridscaleinc/mitty-server/blob/master/API.md#9activity-list

elastic search対応

イベントや、今後に追加されるリクエスト、オッファー、会話など、
自然言語による検索が要求されます。

検索対象を整理して、該当エンティティの登録、更新、削除APIにElastic Serarchの更新も
同時に実施することで、リアルタイムで検索エンジンに反映する。

1: Event
Action, Description, InfoSource, Price Info, ...

2: Request

3: Proposal

Access コントロールー自分以外のアクティビティをアクセスさせない

現状:
 1) activityテーブルにowenr idを記録していない。 (一律0となっている)
API : 10. Register New Activity -> 修正要
    ログインuserid -> Owner Id

 2) activity list取得時、自分以外のactivityを取ってきている。
  9. Activity List  ー>を修正
Login User Id = Owner ID条件チェック

 3) activity詳細取得時、自分以外のも取得できてしまう
  13. Activity Details  ー>修正
     Login User Id = Owner ID条件チェック

contentsテーブルにowner_idを追加

◆ コンテンツは誰の所有なのかを記録する必要ある。
 後になって、自分のコンテンツ一覧を出す際に必要。
◆ 画像の小さいバージョンが必要

そのため、
1)API 3を修正必要
https://github.com/gridscaleinc/mitty-server/blob/master/API.md#3add-content-to-gallery
2)contentsテーブルに owner_id、thumbnail_urlを項目を追加
3)contents.sqlの修正をmodel と Postgres DBに反映

よろしくお願いします。

ユーザー登録機能

iOSにユーザー登録フォーム追加

サーバーにユーザー格納ロジック追加

/api/gallery/contentがbasic 認証必要?

gallery にcontentを登録しようとすると、権限ないと言われ、
basic認証必要かね?

mitty-server | 2017/05/27 09:49:41 stderr: time="2017-05-27T09:49:41Z" level=info msg=Unauthorized method=POST path="/api/gallery/content" remote_addr="172.17.0.1:43120" request_time="2017-05-27T09:49:41Z" status=401 time_taken=1ms

API Event Searching 実装

API実装
下記仕様通り(ちょっと面倒い)

https://github.com/gridscaleinc/mitty-server/blob/master/API.md#7event-searching

Elastic searchの元で自然言語によるEvent検索。
2段階をわけて行う。
1)検索キー 例:q=「ニューヨークに遊びに行きたい」のような文にあるキーワードと部分一致
  するeventをelastic searchより引っ張り出す。

2)アクセス制御及び情報補足
  2−1)プラベートeventは検索より出力されちゃまずいので、フィルターを掛ける。
  2−2)島情報、LogoURL,投稿者情報を補足する。

  

Gallery にcontentアプロード API処理

gallery/content APIを通して、画像をアプロードした後、gallery とcontentsテーブルにレコード作成されますが、 以下の事象がみられますので、確認お願いします

1)galleryテーブルにcontentidが未設定。
2)contentsテーブルにはS3のURLをが登録されていない

API/new/event変更依頼

65c3558

https://github.com/gridscaleinc/mitty-server/blob/master/API.md#8register-new-event

イベントと活動の関連性を持たせるために、親活動の情報が必要です。
当初のAPI設計は考えが足りなかったので、2項目を追加します。
relatedActivityId : 必須項目ではないが、指定した場合、ActivityItemテーブルに1件登録。
    activityItem.activity_Id=relatedActivityId
activityItem.event_id=eventId
activityItem.title=event.title
activityItem.memo = null
activityItem.notification =false
activityItem.notification_date_time=null

asMainEvent: true/false でrelatedActivityIdが指定された場合のみ指定可能。   trueの場合
  activity.main_event_id=eventIdを更新します。

iPhone識別

iPhoneからのアクセかどうか
iPhoneのバージョンなど

目的、ダウンロードボタン表示要否判定

ログイン機能

iOSにログインフォーム追加。
サーバーにログインロジック実装

島登録 API実装依頼。

https://github.com/gridscaleinc/mitty-server/blob/master/API.md#12register-new-island

島とは人が集まる場所のこと。イベントの開催地となる重要な情報です。
当面はイベントの場所選んだところを自動的にこのAPIを通して登録しますが、
将来に的ビジネスパートナーとなるお店やホテル、タクシー、航空フライトを登録する。

対象テーブル:
https://github.com/gridscaleinc/mitty-server/blob/master/db/island.sql

Websocket認証できない

Websocket のリクエストをaliceのhandlerを通して、authを掛けたい。
どうしたらいいか?

今、websocktのリクエストハンドラーが他から独立している。
これはよくないし、認証されてないので、問題です。

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.