Skip to content

thedumbsloth/blogsway

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blogsway

Technologies used:

Front-end: HTML, CSS, Bootstrap(CSS-framework), EJS templating

Back-end: NodeJS, ExpressJS(NodeJS framework)

Database:MongoDB, mongoose(JS library for MongoDB)

Features

  • Create Account(Register and Login).
  • Usage of Bcrypt Hashing to store passwords as encrypted hashes instead of plain text
  • Create, edit and delete a blogpost
  • Read blogposts published by other usernames
  • Toggle your post as either private or public
  • Database Schema:

    blogSchema={
                 title
                 content
                 visibility
    }
    userSchema={
                username
                password
                [blogSchema]
    }
    

    Endpoints:

    Endpoints Description Acceptable values Method
    / homepage GET
    /register add a new user to db POST
    /login check for existing user to login POST
    /:username view blogs posted publicly by a username username GET
    /:userId/blogs view all the users from db userId GET
    /:userId/myblogs view all the blogs posted by the loggedin user userId GET
    /:userId/compose create a blog userId,blogId POST
    /:userId/:blogId/edit edit a blog by id userId,blogId POST
    /:userId/:blogId/del delete a blog by id userId,blogId POST
    /:userId/:blogId/visibility/:visibility toggle a private blog to public and vice-versa userId,blogId,visibility POST

    **userId corresponds to the loggedin user

    Run locally:

    git clone [email protected]:thedumbsloth/blogsway.git
    
    cd blogsway/
    
    npm i
    
    node app.js
    

    Alternatively running npx nodemon instead of node app.js will automatically restart the node application when file changes in the directory are detected.

    open http://localhost:3000/ in your browser