Skip to content

Repository files navigation

Moments - API

Project description

Moments is a social media platform. It has been designed for its users to share their life's moments. The application consists of the React app and an API. Welcome to the Django Rest Framework API project section.

User stories

CategoryasI want toso that I canmapping API feature
authuserregister for an accounthave a personal profile with a picturedj-rest-auth
Create profile (signals)
authuserregister for an accountcreate, like and comment on postsCreate post
Create comment
Create like
authuserregister for an accountfollow usersCreate follower
postsvisitorview a list of postsbrowse the most recent uploadsList/ Filter posts
postsvisitorview an individual postsee user feedback, i.e. likes and read commentsRetrieve post
postsvisitorsearch a list of postsfind a post by a specific artist or a titleList/ Filter posts
postsvisitorscroll through a list of postsbrowse the site more comfortablyList/ Filter posts
postsuseredit and delete my postcorrect or hide any mistakesUpdate property
Destroy property
postsusercreate a postshare my moments with othersCreate post
postsuserview liked postsgo back often to my favourite postsList/ Filter posts
postsuserview followed users' postskeep up with my favourite users' momentsList/ Filter posts
likesuserlike a postexpress my interest in someone's shared momentCreate like
likesuserunlike a postexpress that my interest in someone's shared moment has faded awayDestroy like
commentsusercreate a commentshare my thoughts on other people's contentCreate comment
commentsuseredit and delete my commentcorrect or hide any mistakesUpdate comment
Destroy comment
profilesuserview a profilesee a user's recent posts + post, followers, following count dataRetrieve profile
List/ filter posts
profilesuseredit a profileupdate my profile informationUpdate profile
followersuserfollow a profileexpress my interest in someone's contentCreate follower
followersuserunfollow a profileexpress that my interest in someone's content has faded away and remove their posts from my feedDestroy follower

Entity Relationship Diagram

ERD

Models and CRUD breakdown

modelendpointscreateretrieveupdatedeletefiltertext search
usersusers/
users/:id/
yesyesyesnonono
profilesprofiles/
profiles/:id/
yes (signals)yesyesnofollowing
followed
name
likeslikes/
likes/:id/
yesyesnoyesnono
commentscomments/
comments/:id/
yesyesyesyespostno
followersfollowers/
followers/:id/
yesyesnoyesnono
postsposts/
posts/:id/
yesyesyesyesprofile
liked
feed
title

Tests

  • Posts app:
    • logged out users can list posts
    • logged in users can create a post
    • logged out users can't create a post
    • logged out users can retrieve a post with a valid id
    • logged out users can't retrieve a post with an invalid id
    • logged in users can update a post they own
    • logged in users can't update a post they don't own

Deployment steps

  • set the following environment variables:
    • CLIENT_ORIGIN
    • CLOUDINARY_URL
    • DATABASE_URL
    • DISABLE_COLLECTSTATIC
    • SECRET_KEY
  • installed the following libraries to handle database connection:
    • psycopg2
    • dj-database-url
  • configured dj-rest-auth library for JWTs
  • set allowed hosts
  • configured CORS:
    • set allowed_origins
  • set default renderer to JSON
  • added Procfile with release and web commands
  • gitignored the env.py file
  • generated requirements.txt
  • deployed to Heroku

Happy coding!

About

No description, website, or topics provided.

Resources

Stars

19 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages