Educational Website project by Abhishek Asarawa and Fariya Banu

AttainU
AttainU

Educational Website

Created an educational website which shall be having javascript content. You will be able to access many resources from this space. There are two ways to access the content either you register yourself or become a guest reader. The registration comes with its own benefits namely, you can become an author who will have the access to write content as we all know the technology keeps updating frequently as we are living in the era of developing technology.

You register yourself and you can drop constructive comments on the content for others, you can in a way become a mentor for people who are new to the technology. You can update the content which is present on the website, add your own work if need be and do lots more.

If you are a guest reader you still have access to every bit of data present on the website just that not having write access on the website. 

We plan to squeeze in as many resources as possible for every topic we cover on our website. We shall be adding links to various other informational posts from medium or any such website related to the topic.

We will make study materials available online and make the site a valuable resource both for existing and future students.

Following are the features:

Features:

  1. If a user happens to forget his/her password, he/she can change the password.
  2. User authorization via google.
  3. User Profile.
  4. Users can create, read, update and delete content on the website.
  5. Users can comment.
  6. Users can add their profile picture.
  7. Users can search topics on the website.
  8. FAQs, where users can ask questions and previously asked questions can be found.
  9. Admin can delete any blog, comment and question (on FAQs) that is inappropriate.
  10. Only the admin can answer the FAQs.
  11. Only admin can make any other user an admin.
  12. AskMe section where registered users can ask anything.

Routes:

1. User Related Routes

        a. post(/register):

            Body: Name, E-mail, Password, picture(if any)

            Response: request_id, status(200)

            Error: schema error for not accepting any details 406

        b. post(/verifyEmail):

            Body: request_id, OTP

            Response: new user created, asked to go for login. status(201)

            Error: OTP or request_id or both is not valid, status(406)

        c. post(/login):

            Body: email, password

            Response: token, status(200)

            Error: incorrect credentials, status(401)

        d. get(/logout):

            It will be a protective route.

            Response: logged out, status(200)

            Error: Unauthorized, status (403)

        e. put(/update)

            It will be a protective route.

            Body: user has to provide a field that he wants to change and password.

            Response: details updated. status(200)

            Error: Validation Error, status(406). Unauthorized, status(403)

        f. get(/details):

            It will be a protective route.

            Response: users details, status(200)

            Error: Unauthorized, status(403)

        g. post(/forgetPassword):

            It will be a protective route.

            Body: new password, OTP

            Response: password updated

            Error: Invalid OTP, status (401). Validation Error, status(406), 

          Unauthorized, status(403)

        h. delete(/deactivateAccount):

            It will be a protective route.

            Body: password

            Response: user deactivate, status(200)

            Error: Unauthorized, Invalid Credential, status(403)

    2. Blog Related Routes:

        These routes can only be accessible by valid users (except blog view route).

        a. post(/create):

            Body: Title, Body, picture(if any)

            Response: blog created, status(201)

            Error: Validation Error, status(406). Unauthorized, status(403).

        b. put(/update):

            Body: Title, Body

            Response: blog updated, status(200)

            Error: Validation Error, status(406). Unauthorized, status(403)

        c. delete(/delete/:blog_id):

            Response: blog deleted, status(200)

            Error: Unauthorized, status(403). Not Found, status(404).

        d. get(/view/:blog_id):

            (route which is unauthorized)

            Response: blog data, status(200)

            Error: Not Found, status(404)

        e. get(search/?key=value):

            (route which is unauthorized)

            Response: blogs related to search, status(200)

            Error: Not Found, status(404)

    3.Comments Related Routes

        These routes can only be accessible by valid users.

        (The comments will be visible in its related blog)   

        a. post(/create):

            Body: blog_id, body

            Response: comment is created, status(201)

            Error: Unauthorized, status(403). Validation Error, status(406). Not 

           Found(blog_id), status(404)

        b. delete(/:comment_id):

            Response: comment deleted, status(200)

            Error: Unauthorized, status(403). Not Found, status(404)

        c. put(/edit/:comment_id):

            Body: blog_id, body

            Response: comment edited, status(200)

            Error: Error: Unauthorized, status(403). Validation Error, status(406). Not 

           Found(blog_id), status(404)     

4.Admin Related Routes:

        (There will be an admin by default. This admin can make any other person admin. These routes can only be accessible by an admin.)

        a.post(/makeAdmin):

            Body: user_id, email (of the user that will become admin)

            Response: new admin created, status(200)

            Error: Unauthorized, status(403). Not Found, status(404)

        b.delete(/deleteBlog/:blog_id):

            (Admin has authorization to delete any blog from the website)

             Response: blog deleted, status(200)

             Error: Unauthorized, status(403). Not Found, status(404)

        c.delete(/removeComment/:comment_id):

            (admin has authorization to remove any inappropriate comments)

            Response: comment deleted, status(200)

            Error: Unauthorized, status(403). Not Found, status(404)

    5.Website FAQ Related Routes:

        a.get(/FAQ):

            Response: all FAQs, status(200)

            Error: Server Error, status(500).

        b.post(/askQuestion):

            Body: question, status(201)

            Response: added to FAQs

            Error: Validation error, status(406). Server Error, status(500)

        c.post(/giveAnswer/:question_id):

            (Only Admin has authorization to answer).

            Body: answer

            Response: Get answered question, status(201)

            Error: Validation Error, status(406). Unauthorized, status(403). Not Found, 

           status(404).

        d.delete(/deleteFAQ/:question_id):

            (Only Admin has authorization to delete).

            Response: Question deleted.

            Error: Unauthorized, status(403). Not Found, status(404)

DEMO :