---
# System prepended metadata

title: カプロサンプルアプリ

---

# カプロサンプルアプリ

Twitterっぽいやつ

## 機能

- [ ] アカウントが作れる
- [ ] ログイン・ログアウトができる
- [ ] 他のユーザーをフォロー・アンフォローできる
- [ ] ツイートできる
- [ ] いいねできる
- [ ] ツイートにリプライできる
- [ ] ツイートを削除できる
- [ ] RTできる

## テーブル設計

- users
  - id
  - screen_id
  - name
  - password
  - biography
  - profile_image_url
  - created_at
  - updated_at

- shouts
  - id
  - user_id
  - parent_id(nullable)
  - content
  - created_at

- users_shouts
  - id
  - user_id
  - shouts_id
  - is_reshout
  - created_at

- likes
  - id
  - user_id
  - shouts_id
  - created_at

- shouts_images
  - id
  - shouts_id
  - image_url
  - created_at
 
- follows
  - followee
  - follower
  - is_mutual
  - created_at

## エンドポイント

### POST /users

#### request

- body param
  - screen_id
  - name
  - pasword
  - biography(optional)

#### response

- success
  - 201
  - jwt

### PATCH /users

#### request

- body param
  - screen_id(optional)
  - name(optional)
  - pasword(optional)
  - biography(optional)

### PUT /users/image

#### request

- file
  - profile_image

#### response

- success
  - 201

### POST /users/login

#### request

- body param
  - screen_id
  - password

#### response

- success
  - 200
  - jwt

### POST /users/:id/follow

#### request

- header
  - bearer jwt
 
#### response

- success
  - 204

### DELETE /users/:id/follow

#### request

- header
  - bearer jwt

#### response

- success
  - 204

### GET /users/:id/shouts

#### request

- query param
  - limit
  - last_shout_id(optional)

#### response

- success
  - shouts

### GET /shouts

#### request

- header
  - bearer jwt

- query param
  - limit
  - last_shout_id(optional)

#### response

- success
  - shouts

### POST /shouts

#### request

- header
  - bearer jwt
- body parameter
  - content
  - images(optional)
  - parent(optional)

#### response

- success
  - 201
  - shout
 
### POST /shouts/:id/reshout

#### request

- header
  - bearer jwt

#### response

- success
  - 204

### DELETE /shouts/:id/reshout

#### request

- header
  - bearer jwt

#### response

- success
  - 204

### POST /shouts/:id/like

#### request

- header
  - bearer jwt

#### response

- success
  - 204

### DELETE /shouts/:id/like

#### request

- header
  - bearer jwt

#### response

- success
  - 204

### DELETE /shouts/:id

#### request

- header
  - bearer jwt

#### response

- success
  - 204