/unpopular-opinion-frontend

Unpopular Opinion Frontend

Primary LanguageJavaScript

Unpopular Opinion

Description

It's an App where you can know how popular are your opinions based on what other people respond to the same opinions and a general overview of everything you've opinated about.

User Stories

  • 404: As an anon/user I can see a 404 page if I try to reach a page that does not exist so that I know it's my fault.
  • Signup: As an anon I can't do anything.
  • Login: As a user I can login to the platform so that I can see the opinions and everything else.
  • Logout: As a user I can logout from the platform so no one else can use it.
  • Add Opinion: As a user I can add an opinion that I will share with the community.
  • Opinions: As a user I want to want to be able to respond to the different opinions of the community.
  • Profile: As a user I can see my profile an how popular am I within my community. Also I will see how people respond to my opinions.

Backlog

User profile:

  • See my index of popularity by category.
  • Upload my profile picture.
  • See other users profile.
  • List of people you follow and are followed by.
  • Chat with other users.

In my zone:

  • Add geolocation to the users so you can check those who are closer to you.
  • See the level of compatibility you have within your area.
  • See the level of compatibility you have with every specific user near you.

The swiper (Home):

  • You can mark as favourite the opinions you want to follow
  • You can report those opinions that do not follow the App policies.
  • You can follow those users whom opinions you like.
  • The fist opinions that will appear are those closer to you.
  • Filter the opinions by category.

Client

Pages

url public Functionality
/ false landing page
/signup true Signup user
/login true login user
/profile false profile of user
/opiniongenerator false user content creator
/inmyzone????? false user content creator

Services

  • Auth Service
    • auth.login(user)
    • auth.signup(user)
    • auth.logout()
    • auth.me()
    • auth.getUser(user) // synchronous
  • User
    • user.respond(opinion)
  • Opinions
    • opinion.find(query)
    • opinion.create(data)

Backlog

  • User
    • user.addFavorite(id)
    • user.removeFavorite(id)
    • user.follow(user2)
    • user.unfollow(user2)

Server

Models

User model

username - String // required
email - String // required & unique
password - String // required

Backlog - User model

favorites - [ObjectID<Opinions>] // not required
followers - [ObjectID<Followers>] // not required
following - [ObjectID<Following>] // not required
location - {lat: Number, long: Number} // required if using "In my zone"

Opinion model

author - ObjectID<User> // required
category - Array[Enum]  // required & defined by the App
question - String // required & caracter limited
response // required & caracter limited - {
  x: String,
  y: String
}

Backlog - Opinion model

photo - String (Url)
location // required if using "In my zone" - { 
  lat: Number, 
  long: Number
}, 
reported // created by the API - {
  isReported: boolean (default: false), // user reports an opinion
  isRevised - boolean (default: false), // admin checks the report
  by: [ObjectID<user>] // users that reported the opinion
},
modified // created by the API - {
  isModified: boolean (default: false), // user modifies his own opinion
  isRevised - boolean (default: false) // admin checks modification
}

Response model

opinion - ObjectID<opinion> 
responses - Array[{
  user - ObjectID<user>,
  response - Array[enum]
}] 

API Endpoints (backend routes)

API routes:

auth

Method Route Functionality
GET api/auth/me Check session status
POST api/auth/signup Log in user to app and set user to session (Body: username, email, password)
POST api/auth/login Register user to app and set user to session (Body: username, mail, password)
POST api/auth/logout Log out user from app and remove session

users

Method Route Functionality
GET api/user/:id Gives back all the information of the user
PUT api/user Updates his own information

opinions

Method Route Functionality
GET api/opinion Gives back all the opinions that haven't been responded by the user
POST api/opinion Creates a new opinion card inside the platform
POST api/opinion/response Sends the response of the user to an exact opinion
PUT api/opinion/:id Updates a new opinion card inside the platform
POST api/opinion/report Reports an opinion from the platform
DELETE api/opinion/:id Erases an opinion from the platform

admin

Method Route Functionality
GET api/reports The admin gets all the reported opinions
PUT api/reports/:id The admin modifies the state of the reported opinion
DELETE api/reports/:id The admin deletes once and for all the reported opinion
DELETE api/user/:id The admin deletes the profile of a user

Links

Trello/Kanban

Link to your trello board or picture of your physical board

Git

The url to your repository and to your deployed project

Client repository Link

Server repository Link

Deploy Link Backend

Deploy Link Frontend

Slides

The url to your presentation slides

Slides Link