Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
56d858a
review
pei0804 Aug 13, 2019
8e3905b
fix
pei0804 Aug 13, 2019
1460d95
みすった
pei0804 Aug 13, 2019
2bc8d4a
fix
pei0804 Aug 13, 2019
b6aef0d
fix
pei0804 Aug 13, 2019
93afc82
Merge pull request #20 from voyagegroup/review
pei0804 Aug 13, 2019
6ed4726
Clientのsetupがhardなので最低限の動かせるような筋道を示す
yamachu Aug 14, 2019
026d70a
Merge pull request #22 from voyagegroup/front-docs
yamachu Aug 14, 2019
97b8811
merge front/back
onetk Aug 15, 2019
e9454b0
add back/database
onetk Aug 15, 2019
a33cd27
add delete all /fix db cascade type
onetk Aug 16, 2019
e3f660e
add search box as textarea
onetk Aug 16, 2019
0ca2e36
色々
onetk Aug 16, 2019
9a1e84a
get arxiv texts
onetk Aug 16, 2019
70fef3a
関数分けた!!!!!!
onetk Aug 17, 2019
18af84a
make(map~)のところ
onetk Aug 17, 2019
9975d36
kireini
onetk Aug 17, 2019
2ccec55
translate func
onetk Aug 17, 2019
7e9fc41
delete iranai function
onetk Aug 17, 2019
78163ce
translateがv2なので、一時的に回避
onetk Aug 17, 2019
235f48c
翻訳, DB仮格納 ok
onetk Aug 17, 2019
e997526
Yのcurl直前
onetk Aug 17, 2019
289e626
extract keyword
onetk Aug 17, 2019
3f3f4b4
新規論文の追加時に同時にタグを追加
onetk Aug 17, 2019
c08db6a
front側にtag持ってきた
onetk Aug 17, 2019
1d01295
そいや
onetk Aug 17, 2019
1b25da7
整理
onetk Aug 17, 2019
4930a44
i,j,kには気をつけましょう
onetk Aug 17, 2019
c687272
fix
onetk Aug 17, 2019
ff9bdb5
lists get時の修正
onetk Aug 17, 2019
2f24397
bit
onetk Aug 17, 2019
433df25
fix
onetk Aug 18, 2019
88b931f
delete others
onetk Aug 18, 2019
277afa8
大改造劇的 preact to react
onetk Aug 18, 2019
4b5d39a
fix fix
onetk Aug 18, 2019
fb48063
reform return tag types
onetk Aug 18, 2019
f8099b1
react-tag-cloud 動かないところ
onetk Aug 18, 2019
fbe793c
ここまでreact-tag-cloud
onetk Aug 18, 2019
089d1dd
fix 検索の遅延
onetk Aug 18, 2019
18cef74
fix text-align / css
onetk Aug 18, 2019
da4e554
動く react-tag-cloud
onetk Aug 19, 2019
e6fb73e
fix ReadMe / add slides
onetk Aug 19, 2019
c572d5f
fix ReadMe
onetk Aug 19, 2019
d3bdb50
fix readme2
onetk Aug 19, 2019
d762e88
fix db with goose
onetk Sep 26, 2019
39229a9
add files
onetk Sep 26, 2019
6392607
Merge pull request #1 from onetk/fix-goose
onetk Sep 26, 2019
0d75955
fix insert articles
onetk Sep 26, 2019
4e2229e
change repository article func names
onetk Sep 26, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 103 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,106 @@
# treasure-app
# Arxiv Cloud ☁📄

> Remember, Makefile is always your friend
## 概要

- 日頃の論文サーベイのをより良く、更なる研究を。
- バックエンド Go, フロントエンド React, サーバ MySQL, ユーザ認証 Firebase
- URL: none
- github: here

<div align="center">
<img src="normal.png" width="400">
<img src="tags.png" width="400">
</div>

## コア体験

- Arxiv にある論文を検索、自動で和訳した Abstract や抽出されたキーフレーズによるタグを表示し、より高速な論文サーベイ・タグの可視化ができる<br>

- 動機
- 論文サーベイは時間がかかるが、より高速に様々な論文を読みたい。
- 日本語で読むほうが早い / 文章のキーワードがあるとより早く判別しやすい
- 単純なテキスト表示だけでなく、論文の動向の可視化を行いたい

## コア機能

論文検索・和訳表示・タグの可視化(word cloud)

-

1. 論文検索

- [Arxiv API](https://arxiv.org/help/api)
- Get でクエリに検索ワード、検索個数を載せてリクエストを送ると html 形式で返してくる

2. 和訳表示

- [Google Cloud Translation API](https://cloud.google.com/translate/pricing?hl=ja)
- いつもの。V2 だと有料なので、V3beta1 を経由すべき。

3. タグの可視化

- [react-tag-cloud](https://www.npmjs.com/package/react-tag-cloud])のパッケージ
- word cloud を react 経由で使える。preact はダメなので注意を。

## コア機能の設計

### ユーザに関して

| Name | About | Type |
| :----------- | :----------------------------- | :----- |
| id | ユーザー ID を保持 | int |
| firebase_uid | firebase のユーザー ID を保持 | string |
| email | ユーザーのメールアドレスを保持 | string |
| display_name | ユーザー表示名を保持 | string |
| photo_url | ユーザー表示画像 URL を保持 | string |
| ctime | user を作成した時間 | date |
| utime | user を更新した時間 | date |

user

### 論文に関して

#### ツイート内容

| Name | About | Type |
| :---- | :------------------------- | :----- |
| id | 論文の id を保持 | int |
| title | 論文の タイトル(EN) を保持 | string |
| body | 論文の Abstract(JP) を保持 | text |
| ctime | article を作成した時間 | date |
| utime | article を更新した時間 | date |

article - has many tag

#### タグ内容

| Name | About | Type |
| :--------- | :--------------------------- | :----- |
| id | タグの id を保持 | int |
| article_id | 紐づいている論文の id を保持 | int |
| tag | タグの内容(jp) を保持 | string |
| ctime | tag を作成した時間 | date |
| utime | tag を更新した時間 | date |

tag - belong to article

## URI 設計

| Methods | URI | About |
| :------ | :---------- | :-------------------------------------------------- |
| GET | /paper | ArxivAPI に対し query に keyword を入れて検索 |
| GET | /articles | 全ての論文を出す |
| GET | /tags | 全ての論文に紐づいたタグをだす(word cloud に投げる) |
| POST | /delete/:id | 特定の論文を削除、見た目状の変化なし |

## View 設計

| ページ | 内容 |
| :------------------ | :------------------- |
| index.html / App.js | React 経由で全て表示 |

## local 環境

### local環境
```
❯ docker --version
Docker version 18.09.2, build 6247962
Expand All @@ -18,4 +116,5 @@ v10.15.3
```

### Links
- https://12factor.net

- https://12factor.net
44 changes: 43 additions & 1 deletion backend/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
# Slide

https://go-talks.appspot.com/github.com/voyagegroup/talks/2019/treasure-go-day2/intro.slide#1

# Getting Started

## 1. Database 立ち上げ

`../database` に構成などが定義されているので、読んでみてください。

以下のターゲットを叩くと、databaseの準備をします。

```console
❯ make -f integration.mk database-init
make -C ../database init
```

```console
which goose || GO111MODULE=off go get -u github.com/pressly/goose/cmd/goose
/Users/j-chikamori/go/bin/goose
docker-compose up -d
Expand Down Expand Up @@ -72,9 +80,14 @@ PORT=1991
使っているAPI: [Exchange custom token for an ID and refresh token](https://firebase.google.com/docs/reference/rest/auth/#section-refresh-token)
それぞれのキーについては、上記リンクを見れば大体分かる。

トークンの作成

```console
❯ make -f integration.mk create-token UID=demo
go run ./cmd/customtoken/main.go demo .idToken
```

```console
{
"kind": "identitytoolkit#VerifyCustomTokenResponse",
"idToken": "idtoken",
Expand All @@ -88,17 +101,27 @@ go run ./cmd/customtoken/main.go demo .idToken

## 5. Hello World

*サーバー立ち上げ*

```console
❯ make run
go run cmd/api/main.go
```

```console
2019/08/08 11:32:47 server.go:51: Listening on port 1991
```

サーバーを立ち上げた状態で、別シェルから以下を叩く。

*認証ありエンドポイントへのリクエスト*

```console
❯ make -f integration.mk req-private
curl -v -H "Authorization: Bearer Hoge" localhost:1991/private
```

```console
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 1991 (#0)
Expand All @@ -116,10 +139,16 @@ curl -v -H "Authorization: Bearer Hoge" localhost:1991/private
<
* Connection #0 to host localhost left intact
{"message":"Hello from private endpoint! Your firebase uuid is demo"}
```

*認証なしエンドポイントへのリクエスト*

```console
❯ make -f integration.mk req-public
curl -v localhost:1991/public
```

```console
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 1991 (#0)
Expand Down Expand Up @@ -149,16 +178,29 @@ curl -v localhost:1991/public

コードを書き換える度に `go run` し直すのは面倒くさいので、書き換えるとrebuildしてくれるコマンドを用意しているので活用してください。

realizeをgo getする

```console
❯ make dev-deps
GO111MODULE=off go get -u -v \
github.com/oxequa/realize
```

```
github.com/oxequa/realize (download)
github.com/oxequa/interact (download)
github.com/fatih/color (download)
github.com/fsnotify/fsnotify (download)
```

realizeを使って実行する

```console
❯ make refresh-run
realize start
```

``` console
[11:36:48][BACKEND] : Watching 21 file/s 14 folder/s
[11:36:48][BACKEND] : Install started
[11:36:51][BACKEND] : Install completed in 3.653 s
Expand Down
Loading