Only this and nothing more.
Raven is a network to share poetry, and all the creative ideas that come with it. It includes social elements such as commenting and annotation, but is not intended to be a traditional social network– instead serving as a modern medium between poets and readers.
You'll need to get an instance of Mongo running first.
git clone https://github.com/maybulb/raven
cd raven && npm run mongo
Keep this session open, and open a new one in the same directory.
npm run start
Current roadmap, and will be updated in the future to support a public API which can be used by users, and will likely be used with our iOS app.
If the user is logged in, will bring them to the home page.
If the user is not logged in it will bring them to the main index with Raven's description, as well as login/register buttons.
Returns the page to post a poem. Redirects to login if the user is not authenticated.
Takes 2 parameters through body (title
, body
), and creates a Poem
object with the following model.
{
"title": String,
"body": String,
"author": ObjectID,
"preview": String
}
Returns the settings page, which includes logout and deactivate buttons, as well as a small form to change your username. Date of account creation is also listed. If user is not authenticated, redirect to login.
Takes 1 parameter through body (username
) to change the user's username.
Returns confirmation for asking author to delete poem with ID :id
.
Deletes poem associated with :id
. Requires author to be logged in. If user is unauthenticated, redirect to current user's profile.
Returns confirmation for asking author to delete account with all poems.
Deletes author and all author's poems from database. Must be authenticated as author, or else redirected to error.handlebars
with error message.
Returns the edit page for poem with ID :id
for
authenticated user. If authenticated user is not author, redirect to login.
Takes 2 parameters through body (title
, content
). Updates poem with ID :id
with these values. If an error occures, redirect to error.handlebars
with error. If no error occurs, redirect to /poem/:id
.
Logs the authenticated user out.
Returns register.handlebars
for registering.
Uses passport to take body parameters (username
, password
). password
is hashed using bcrypt. User is stored in database and logged in if registering is successful. If not, user is redirected to /register
with flash message displaying error.
Returns login.handlebars
for logging in.
Uses passport to take body parameters (username
, password
). If user credentials are authenticated, log the user in and redirect to /
. If an error occurs, redirect to /login
and flash the error.
Displays the poem with ID :id
. If poem does not exist, redirect to error.handlebars
and display error.
Returns user's profile page, containing all poems/other content, if user/username exists. If authenticated user is not :username
, also display follow button.
Returns the list of followers for :username
.
Shortcut redirect for authenticated user's profile.
If user :username
exists, is not currently being followed, and is not authenticated user, add :username
's ID to authenticated user's relationships.following
, as well as add authenticated user's ID from :username
's relationship.followers
.
If user :username
exists and authenticated user is currently following them, removes :username
's ID from authenticated user's relationships.following
, as well as remove authenticated user's ID from :username
's relationship.followers
.
Will be removed in the production version of Raven.
Returns all user objects in JSON.
{
"_id": "58490820d25a14000485d091",
"created_at": "2016-12-08T07:13:36.901Z",
"username": "test",
"password": "$2a$10$vn0cUDytQEpZMq1uBsbSZeSCd9CMa",
"relationships": {
"followers": ["51223123123", "131231235"],
"following": ["134987138", "18937129837"],
},
"__v": 0
}
Returns all poem objects in JSON.
{
"_id": "584908f1d10bb40004a134ea",
"created_at": "2016-12-08T07:17:05.576Z",
"title": "you say",
"content": "this is the poem. i dont know",
"author": "58490820d25a140f0485d091",
"preview": "this is the poem. / i dont know.",
"__v": 0
},