CMPUT 404 Group Project Repo
A distributed peer-to-peer social networking app!
Frontend deployed site can be found here Backend deployed site can be found here
Generally everything is LICENSE'D under the Apache 2 license by Abram Hindle.
All text is licensed under the CC-BY-SA 4.0 http://creativecommons.org/licenses/by-sa/4.0/deed.en_US
Contributors:
- Sanjeev Kotha
- Urvi Patel
- Adit Rada
- Marzookh Farook
- Ervin Binu
Can be found via the wiki here
To run backend, from the subdirectory
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver
To run frontend from the subdirectory
npm install
npm start
- Django
- Heroku
- React
- Python
- JavaScript
- Axios
- Postgres
https://www.youtube.com/watch?v=dqZNT5IdY7Q
-
Authentication
- login/
- Login page
- logout/
- Logout page
- register/
- Register page
- login/
-
Authors
- GET //service/authors/
- Authors List
- GET //service/authors/{AUTHOR_ID}
- Author Profile
- POST //service/authors/{AUTHOR_ID}
- Create Author
- GET //service/authors/
-
Post
- GET //service/authors/{AUTHOR_ID}/posts/
- Post List of Author {AUTHOR_ID}
- POST //service/authors/{AUTHOR_ID}/posts/
- Creating Post with Random ID
- GET //service/authors/{AUTHOR_ID}/posts/{POST_ID}
- Public Post {POST_ID}
- POST //service/authors/{AUTHOR_ID}/posts/{POST_ID}
- Update Post {POST_ID}
- DELETE //service/authors/{AUTHOR_ID}/posts/{POST_ID}
- Delete Post {POST_ID}
- PUT //service/authors/{AUTHOR_ID}/posts/{POST_ID}
- Create Post {POST_ID}
- GET //service/public/
- Public Post List
- GET //service/authors/{AUTHOR_ID}/posts/
-
Comment
- GET //service/authors/{AUTHOR_ID}/posts/{POST_ID}/comments
- Comment List of the Post {POST_ID}
- POST //service/authors/{AUTHOR_ID}/posts/{POST_ID}/comments
- Create comment for Post {POST_ID}
- GET //service/authors/{AUTHOR_ID}/posts/{POST_ID}/comments/{COMMENT_ID}
- View Comment {COMMENT_ID} of Post {POST_ID}
- GET //service/authors/{AUTHOR_ID}/posts/{POST_ID}/comments
-
Follower
- GET //service/author/{AUTHOR_ID}/followers/
- Followers List of the the Author
- GET //service/author/{AUTHOR_ID}/followers/{FOLLOWER_ID}
- Check if foreign author is following the Author
- POST //service/author/{AUTHOR_ID}/followers/{FOLLOWER_ID}
- Foreign author follows the Author
- DELETE //service/author/{AUTHOR_ID}/followers/{FOLLOWER_ID}
- Remove foreign author from the Author's followers
- GET //service/author/{AUTHOR_ID}/followers/
-
Friend Request
- GET //service/author/{AUTHOR_ID}/followers/friendrequest/
- Pending friend requests recieved by the Author
- GET //service/author/{AUTHOR_ID}/followers/friendrequest/{FOREIGN_ID}
- Check if foreign author has sent a friend request to the Author
- POST //service/author/{AUTHOR_ID}/followers/friendrequest//{FRIEND_ID}
- Foreign author sends a freind request to the Author
- DELETE //service/author/{AUTHOR_ID}/followers/friendrequest/{FOREIGN_ID}
- Remove the friend request sent by the foreign author to the Author
- GET //service/author/{AUTHOR_ID}/followers/friendrequest/
-
Likes
- GET //service/author/{AUTHOR_ID}/posts/{POST_ID}/likes/
- Likes List of the Post
- POST //service/author/{AUTHOR_ID}/posts/{POST_ID}/likes/{LIKE_ID}
- Author likes the Post, and added to Like DB
- GET //service/author/{AUTHOR_ID}/posts/{POST_ID}/likes/
-
Inbox
- GET //service/author/{AUTHOR_ID}/inbox/
- Inbox of the Author, retrieves all the posts, friend requests and likes sent to the author.
- POST //service/author/{AUTHOR_ID}/inbox/
- Send a post to the Author's inbox
- Send a friend request to the author's inbox
- Send a like to the author's inbox
Tip: when sending the request for the author dict inside friend request/post, you only need to include the author id
- GET //service/author/{AUTHOR_ID}/inbox/
-
Token
- http post http://127.0.0.1:8000/api-token-auth/ username=vitor password=123
- Get token for user vitor with password 123
- http post http://127.0.0.1:8000/api-token-auth/ username=vitor password=123
Suppose we want to send a friend request from FOREIGN_AUTHOR to AUTHOR, we need to send a POST request to the following endpoint:
1. POST //service/author/{AUTHOR_ID}/inbox/
- AUTHOR_ID is the id of the AUTHOR
- The body of the request should be in the following format:
{
"type": "follow",
"actor": {
"id": FOREIGN_AUTHOR_ID
},
"object": {
"id": AUTHOR_ID
},
"summary": "FOREIGN_AUTHOR wants to follow you"
}
OR (for quick internal testing not to be used in real)
1. POST //service/author/{AUTHOR_ID}/followers/friendrequest/{FOREIGN_ID}
- FOREIGN_ID is the id of the FOREIGN_AUTHOR
- AUTHOR_ID is the id of the AUTHOR
2. POST //service/author/{AUTHOR_ID}/inbox/
- AUTHOR_ID is the id of the AUTHOR
- The body of the request is going to be the same as above
Suppose AUTHOR accepts the friend request from FOREIGN_AUTHOR, we then do the following:
1. PUT //service/author/{AUTHOR_ID}/followers/{FOLLOWER_ID}
- AUTHOR_ID is the id of the AUTHOR
- FOLLOWER_ID is the id of the FOREIGN_AUTHOR
2. DELETE //service/author/{AUTHOR_ID}/followers/friendrequest/{FOREIGN_ID}
- AUTHOR_ID is the id of the AUTHOR
- FOREIGN_ID is the id of the FOREIGN_AUTHOR