UOP 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 have thought about. And this is the API that supports it.
User
username: String // required
email: String // required & unique
password: String // required
favorites: [ObjectID<Opinions>] // not required
followers: [ObjectID<Followers>] // not required
following: [ObjectID<Following>] // not required
location: {lat: Number, long: Number} // required
Opinion
author: ObjectID<User> // required
category: Array[Enum] // required & defined by the App
question: String // required
response: {x: String, y: String} // required
photo: String
location: {lat: Number, long: Number} // required
reported: {
isReported: Boolean (default: false), // user reports an opinion
isRevised: Boolean (default: false), // admin checks the report
by: [ObjectID<user>] // users that reported the opinion
}
Response
opinion :ObjectID<opinion>
responses: Array[
{
user: ObjectID<user>,
response: Array[enum]
}
]
Method | Route | Functionality |
---|---|---|
GET |
/auth/me | Check session status |
POST |
/auth/signup | Log in user to app and set user to session (Body: username, email, password) |
POST |
/auth/login | Register user to app and set user to session (Body: username, mail, password) |
POST |
/auth/logout | Log out user from app and remove session |
Method | Route | Functionality |
---|---|---|
GET |
/:id | Gives back all the information of the user |
PUT |
/ | Updates his own information |
Method | Route | Functionality |
---|---|---|
GET |
/opinion | Gives back all the opinions that haven't been responded by the user |
POST |
/opinion | Creates a new opinion card inside the platform |
GET |
/opinion/all | Gives back all the opinions with author data |
GET |
/opinion/categories | Gives back all the available categories |
POST |
/opinion/response | Sends the response of the user to an opinion |
Method | Route | Functionality |
---|---|---|
POST |
/ | Receives a query object with the required statistic config |
Method | Route | Functionality |
---|---|---|
DELETE |
/user/:id | The admin deletes the profile of a user |
GET |
/reported | Gives all reported opinions unchecked |
PUT |
/reported | Updates Opinion and Reported as checked |
DELETE |
/reported/:id | Deletes an Opinion |
{
username: "demo",
password: "demo"
}
Support by giving a ⭐. Any suggestions are welcome!