"How Are You Doing?" is a group project where a user can create an account, reflect and log their feelings, and check in on friends.
Ruby 2.7.4
Rails 5.2.8.1'
- Fork this repository
- Clone your fork
- From the command line, install gems and set up your DB:
bundle install
rails db:{create,migrate,seed}
- run the server with 'rails s'
- Go to Postman and use one of these endpoints. The endpoints must look something like: http://localhost:5000/api/v1/users/history
- Alternatively you can download the Postman Suite and run the premade endpoints
get 'api/v1/emotions'
{
"data": [
{
"id": "1",
"type": "emotion",
"attributes": {
"emotion": "Affectionate",
"definition": "(of a person) Having affection or warm regard; loving; fond."
}
},
{
"id": "2",
"type": "emotion",
"attributes": {
"emotion": "Confident",
"definition": "A person in whom one can confide or share one's secrets: a friend."
}
},
{
"id": "3",
"type": "emotion",
"attributes": {
"emotion": "Grateful",
"definition": "Appreciative; thankful."
}
}
]
}
get 'api/v2/users?search=<google_id>'
{
"data": {
"id": "6",
"type": "user",
"attributes": {
"name": "Hisoka Morow",
"email": "[email protected]",
"google_id": "91239464"
}
}
}
{
"data": []
}
get '/api/v2/users?email='
{
"data": {
"id": "5",
"type": "user",
"attributes": {
"name": "Gon Freecss",
"email": "[email protected]",
"google_id": "58544636"
}
}
}
{
"data": []
}
post 'api/v1/users'
pass in name, google_id, and email in headers
or
post '/api/v2/users?name=&email=&google_id=<google_id>'
{
"message": "User successfully created"
}
get '/api/v1/users/history' & pass in user through headers or get '/api/v2/users/history?user=<google_id>'
{ “data” :
[
{
“id”: 1 ,
“type": "post",
"attributes": {
"emotion": "pensive"
"post_status": "public"
"description": "This was what I typed when I made this post."
"tone" : "anger"
"created_at": "2022-11-01 17:02:19.036593 -0600"
}
},
{
“id”: 2 ,
“type": "post",
"attributes": {
"emotion": "pensive"
"post_status": "public"
"description": "This was what I typed when I made this post."
"tone" : "anger"
"created_at": "2022-11-01 17:02:19.036593 -0600"
}
},
{
“id”: 3 ,
“type": "post",
"attributes": {
"emotion": "pensive"
"post_status": "public"
"description": "This was what I typed when I made this post."
"tone" : "anger"
"created_at": "2022-11-01 17:02:19.036593 -0600"
}
}
]
}
{
"data": []
}
get 'api/v2/users/last?user=<google_id>' or get 'api/v1/posts/last & pass in user google id through headers
{ “data” :
{
“id”: 3 ,
“type": "post",
"attributes": {
"emotion": "pensive"
"post_status": "public"
"description": "This was what I typed when I made this post."
"tone" : "anger"
"created_at": "2022-11-01 17:02:19.036593 -0600"
}
}
}
{
"data": []
}
post '/api/v2/posts?user=<google_id>&emotion=<emotion_term>&description=&post_status=<personal_or_shared>'
{
“data” :
{
“id”: 808 ,
“type": "post",
"attributes": {
"emotion": "thrilled",
"post_status": "personal",
"description": "Today I got a job offer for the company that I really loved, and have admired for a long time.",
"tone": "joy",
"created_at": "2022-11-05T23:05:26.971Z"
}
}
}
{
"data": {}
}
patch '/api/v2/posts/:post_id?emotion=<emotion_term>&description=&post_status=<personal_or_shared>'
get '/api/v1/friends/<google_id>/posts'
{
"data": [
{
"id": "17",
"type": "post",
"attributes": {
"emotion": "Embarrassed",
"post_status": "shared",
"description": "This is the text for user 5 post 1",
"tone": "eager",
"created_at": "2022-11-10T16:46:38.465Z"
}
},
{
"id": "20",
"type": "post",
"attributes": {
"emotion": "Disconnected",
"post_status": "shared",
"description": "This is the text for user 5 post 4",
"tone": "melancholy",
"created_at": "2022-11-10T16:46:38.476Z"
}
}
]
}
{
"data": []
}
get 'api/v1/friends?request_status=pending' or get '/api/v2/friends?request_status=&user=<google_id>'
{
"data": [
{
"id": "5",
"type": "user",
"attributes": {
"name": "Gon Freecss",
"email": "[email protected]"
}
},
{
"id": "6",
"type": "user",
"attributes": {
"name": "Hisoka Morow",
"email": "[email protected]"
}
}
]
}
{
"data": [
{
"id": 7,
"friendship_id": 4,
"type": "friend_followee",
"attributes": {
"name": "Jenny",
"email": "[email protected]",
"google_id": "8675309",
"request_status": "pending"
}
}
]
}
{
"data": []
}
get 'api/v1/friends?request_status=accepted' or get '/api/v2/friends?request_status=&user=<google_id>'
{
"data": [
{
"id": "10",
"type": "user",
"attributes": {
"name": "Andrew Mullins",
"email": "[email protected]"
}
},
{
"id": "13",
"type": "user",
"attributes": {
"name": "Sable",
"email": "[email protected]"
}
}
]
}
{
"data": [
{
"id": 2,
"friendship_id": 1,
"type": "friend_followee",
"attributes": {
"name": "Bubbles",
"email": "[email protected]",
"google_id": "7357151",
"request_status": "accepted"
}
}
]
}
{
"data": []
}
get 'api/v1/friends' or get '/api/v2/friends?user=<google_id>'
{
"data": [
{
"id": "10",
"type": "user",
"attributes": {
"name": "Andrew Mullins",
"email": "[email protected]"
}
},
{
"id": "13",
"type": "user",
"attributes": {
"name": "Sable",
"email": "[email protected]"
}
}
]
}
{
"data": [
{
"id": 2,
"friendship_id": 1,
"type": "friend_followee",
"attributes": {
"name": "Bubbles",
"email": "[email protected]",
"google_id": "7357151",
"request_status": "accepted"
}
},
{
"id": 3,
"friendship_id": 2,
"type": "friend_followee",
"attributes": {
"name": "Jim Lahey",
"email": "[email protected]",
"google_id": "83465653",
"request_status": "rejected"
}
},
{
"id": 4,
"friendship_id": 3,
"type": "friend_followee",
"attributes": {
"name": "Randy Bobandy",
"email": "[email protected]",
"google_id": "52785579",
"request_status": "rejected"
}
},
{
"id": 7,
"friendship_id": 4,
"type": "friend_followee",
"attributes": {
"name": "Jenny",
"email": "[email protected]",
"google_id": "8675309",
"request_status": "pending"
}
}
]
}
{
"data": []
}
get 'api/v2/users/followers?user=<google_id>'
{
"data": [
{
"id": 3,
"friendship_id": 10,
"type": "friend_follower",
"attributes": {
"name": "Jim Lahey",
"email": "[email protected]",
"google_id": "83465653",
"request_status": "pending"
}
},
{
"id": 4,
"friendship_id": 12,
"type": "friend_follower",
"attributes": {
"name": "Randy Bobandy",
"email": "[email protected]",
"google_id": "52785579",
"request_status": "pending"
}
},
{
"id": 5,
"friendship_id": 14,
"type": "friend_follower",
"attributes": {
"name": "Gon Freecss",
"email": "[email protected]",
"google_id": "58544636",
"request_status": "accepted"
}
}
]
}
{
"data": []
}
get /api/v2/users/followers?user=<google_id>&request_status=accepted
{
"data": [
{
"id": 5,
"friendship_id": 14,
"type": "friend_follower",
"attributes": {
"name": "Gon Freecss",
"email": "[email protected]",
"google_id": "58544636",
"request_status": "accepted"
}
}
]
}
{
"data": []
}
get /api/v2/users/followers?user=<google_id>&request_status=pending
{
"data": [
{
"id": 3,
"friendship_id": 10,
"type": "friend_follower",
"attributes": {
"name": "Jim Lahey",
"email": "[email protected]",
"google_id": "83465653",
"request_status": "pending"
}
},
{
"id": 4,
"friendship_id": 12,
"type": "friend_follower",
"attributes": {
"name": "Randy Bobandy",
"email": "[email protected]",
"google_id": "52785579",
"request_status": "pending"
}
}
]
}
{
"data": []
}
get /api/v2/users/followers?user=<google_id>&request_status=rejected
{
"data": [
{
"id": 1,
"friendship_id": 2,
"type": "friend_follower",
"attributes": {
"name": "Ricky LaFleur",
"email": "[email protected]",
"google_id": "19023306",
"request_status": "rejected"
}
}
]
}
{
"data": []
}
Friends: get '/api/v2/friends?email=&user=<google_id>' get '/api/v2/friends/:friendship_id?request_status='
- Andrew Mullins - - GitHub Profile - LinkedIn
- Mary Ballantyne - - GitHub Profile - LinkedIn
- Aleisha Mork - - GitHub Profile - LinkedIn
- Carter Ball - - GitHub Profile - LinkedIn
- Alaina Kneiling - - GitHub Profile - LinkedIn