Code Monkey home page Code Monkey logo

blogs's Issues

[API} blogs/getAll

get all blogs

Response:

[
  {
    id: string
    title: string
    content: string
    image: string <url>
  }
]

[Page] add update post page

this page will be similar to create post page #28 . Only difference is this will use /blogs/update/:id to update the selected blog by the user. Also the input fields on this page will already be filled by the blog's content retrieved from backend.

Also this page will contain a Review section where all the review messages sent by the admin will be displayed.
Here the button Send for review will generate a post request to /blogs/update/:id

[Component] Pending Blogs

Add the pending blogs component to the Admin Dashboard
This component will display all those blogs which are requested for a review by a user.
use /blogs/getAll route and apply filter on blog.review property to properly identify such blogs.

Design will be uploaded soon

  • Create a static component
  • Integrate the backend route to get dynamic data
  • Ensure responsiveness

[Page] add Landing page

Using the given design implement the landing page for the blog. The page will display all the posted blogs on our site. Along with a search bar to filter from the blogs.

design will be uploaded here soon.

  • Create the static page using the above design and static data.
  • Use the route /blogs/getAll #9 to fetch the data from backend.
  • Ensure responsiveness of the page

[Page] User Dashboard

a dashboard for the logined user to view all his/her blogs (pending,approved,rejected) and a button to create a new blog.

The page will have a component and a button

  • A component to display all the blogs created by the user. Use /blogs/getAll and apply filter on blogs.createdBy
    • First create a static component and ensure it's responsiveness
    • Integrate the routes to make it dynamic
    • After selecting a post, user will be directed to #30
  • Create Post button to create a new post, will direct the user to #28

[API] POST admin

@@ADMIN ONLY

Workflow to ensure admin only access this:

// get auth_token from cookie

const { userId, email } = requestDataFromJWTToken(auth_token)

const user = findUniqueUser(id, email)

if ( user.type != admin) 
  return 'Unauthorized'

// continue

[API] POST admin/blog/review/:id

@@Admin

Ensure user is admin based on #15

send review of blog based on:

  • pending: no review done
  • approved: blog is published for everyone
  • update: improve blog based on review_message

[API] POST blogs/comment/:id

add comment to blog

req:

header: {
  auth_token: <user_auth_token>
} // passed using cookie
body: {
  content: string
}

[API] POST blogs/create

create new blog.

req:

{
  title: string
  description: string
  content: string
  image: type<photo>
}

[BackEnd] complete backend

Database schema:

The schema might be changed based on further recommendation

  • Tags:

    • name: String
  • blogs:

    • title: String
    • content: String
    • tags: [Tags]
    • image: String
    • comments: Comments
    • review: enum('pending', 'approved', 'update')
    • reviewMessage: String
  • Comments:

    • user: User
    • content: String
    • date: Date
  • users:

    • email: String
    • name: String?
    • role: enum('admin', 'user')
    • newsletterIsSubscribed: Boolean
    • others...

[API] integrate Google OAuth

Integration of Google OAuth with jwt token for authentication verification

API's to make:

Public API's: accessed by all
  • /auth/signin
  • /auth/signup
Authenticated user:
  • /auth/logout

How to ensure that the user is authenticated or not?

Store cookie in client-side with key-value pair: auth_token: <auth_token>

[Page] Posted Blogs Page

Here admin can see all the posted blogs and remove any blog.
Uses /blogs/getAll to view all blogs and /blogs/delete/:id to delete the blog

  • Create a static page
  • Integrate routes
  • Ensure responsiveness

[Component] add signin/signup popup component

A popup will be shown to visiting users after a short interval, asking for:

  1. signin/signup
  2. subscribing to newsletter
  3. To display upcoming hackathons, events organized.

design will be uploaded soon

  • Create a static component
  • Add the backend routes /auth/signin and /auth/login (#7) for signup and signin respectively.
  • Add the backend route /newsletter/email (#8) for subscribing to newsletter

[Page] Blog review Page

When admin selects a blog from Pending blogs s/he will be directed to view the complete blog and add a review.
Uses /blogs/get/:id to display the blog and admin/blog/review/:id to give a review.

design will be uploaded soon

  • Create a static page
  • Integrate the routes
  • Ensure responsiveness

[Page] add Blog view page

Add the page to view the selected blog from landing page (#20)

The page will use the following backend route /blogs/get/:id (#10) to fetch the blog data.

Response from /blogs/get/:id

{
   title: String
   content: String
   tags: [Tags]
   image: String
   comments: Comments
   review: enum('pending', 'approved', 'update')
   reviewMessage: String
}

design will be uploaded soon

  • Create the blog view as well as a comment section at the bottom of the blog
  • Use the mentioned route to fetch data
  • Ensure responsiveness

[Page] Admin dashboard

Page only accessible to user.role = 'admin'

Consists of a Component and 3 buttons

  • #24
  • Posted to show all the posted blogs. Directed to #25
  • Send Newsletter to send newsletter to all the resgistered users. Directed to #26
  • Create new post to create a fresh post. Directed to #28

Design will be uploaded soon

[Page] Create post page

add the create post page which will be only accessible to logined user and the admin.

The page will contain input fields for

  1. Title
  2. Description
  3. Tags
  4. CoverImage

and a Send for review button to send the blog for review to the admin using /blogs/create route.

A large part of the page will be dedicated to a richtext editor.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.