Twitter clone coding sample
To run (standard Rails app):
- install Ruby 2.3.1 if not already installed
- clone repo
bundle
rake db:setup
rails s
This is a 100% Service (API) application. The endpoints can be tested by using tools like cURL or Postman.
Client side application in development: https://github.com/tagCincy/TAGitter-client
API Instructions:
-
Registration:
POST /api/v1/auth
- Required:
email
,handle
,password
,password_confirmation
- Response:
- body: newly created user
- headers:
access-token
,token-type
,uid
,expiry
returned and used for future api calls
- Required:
-
Sign-in:
POST /api/v1/auth/sign_in
- Required:
email
orhandle
andpassword
- Response:
- body: newly created user
- headers:
access-token
,token-type
,uid
,expiry
returned and used for future api calls
- Required:
-
Posts (and endpoints require
access-token
,token-type
,uid
, andexpiry
headers):-
User's Feed:
GET /api/v1/authenticated/posts
-
Specific Post:
GET /api/v1/authenticated/posts/:id
-
Create Post:
POST /api/v1/authenticated/posts
- required:
body
(=< 144 characters)
- required:
-
Update Post:
PATCH /api/v1/authenticated/posts/:id
- required: new
body
- required: new
-
Delete Post:
DELETE /api/v1/authenticated/posts/:id
-
Repost:
POST /api/v1/authenticated/posts/:id/repost
-
Favorite:
POST /api/v1/authenticated/posts/:id/favorite
-
Unfavor:
DELETE /api/v1/authenticated/posts/:id/unfavorite
-
-
Users (and endpoints require
access-token
,token-type
,uid
, andexpiry
headers):- View User:
GET /api/v1/authenticated/users/:id
- View Owen User:
GET /api/v1/authenticated/users/me
- Update Own User:
PATCH /api/v1/authenticated/users/me
- Follow User:
POST /api/v1/authenticated/users/:id/follow
- Unfollow User:
POST /api/v1/authenticated/users/:id/unfollow
- View User: