Code Monkey home page Code Monkey logo

comment-microapi's Introduction

Comments Microservice

Build Status Coverage Status

This is a microservice that allows user to create comments, edit comments and also flags comment. Users can also reply comments, flag reply and also upvote and downvote comments and replies. Also, origin of these comments are tracked.

For quick navigation:

Getting Started

Ensure that your local machine has all the required software, listed below, before setting up your local environment.

Requirements

Setup Local Environment

You will first need to setup your local environment and ensure that all configuration files are correctly configured.

  1. Fork the repo.
  2. Clone your forked repo to you local environment.
  3. In your terminal, run npm install.
  4. In your terminal, run cp .env.example .env.
  5. In your terminal, run npm run startDev.

Linting Your Code

  1. Run npm run lint:fix to fix all fixable errors in source code and format with prettier
  2. Run npm run lint to find errors that still remain in your code syntax/format
  3. Ensure you fix any remaining linting errors displayed. Run npm run test:ci to ensure your code matches the test

Testing Your Code

  1. Run npm run test to ensure your code passes all tests

Contributing Your Code

Ensure that you lint and test your code before submitting a pull request (PR). For more information on the contributing guidelines and tips on certain implementation details, please see the contributing documentation.

Endpoints Documentation

There are two options that you can choose from when you would like to view the endpoints' Swagger documentation.

The first option is online and should be your first go to as this will be the live server with the most trustworthy documentation.

The second option is local and should be used as a last resort when the online option is unavailable.

Online

Visit the online server to see the live Swagger documentation.

Locally

After setting up your local environment (see above), please visit the localhost:4000 or the localhost:4000/documentation route to see the local Swagger documentation.

Schema Design Explanation

Comments

This model contains the following fields

comment_body: string (the body of the comment)
comment_origin: string ( the origin of the comment; Bot or Reports from FE)
isFlagged: boolean( if the comment has been flagged for sensitive words)
upVotes: number
downVotes:  number
user: schema ref ( the details of the person that commented);

Replies

This model contains the following fields

reply_body: string (the body of the comment)
comment_id: schema ref ( the id of the comment)
isFlagged: boolean( if the comment has been flagged for sensitive words)
upVotes: number
downVotes:  number

Users

This model contains the following fields

name: string (name of the person comment)
email: string (email address of the person commenting)

License

MIT License

Copyright (c) 2020, Team Justice League. All rights reserved.

comment-microapi's People

Contributors

dave-ok avatar oscar-ekeyekwu avatar simply-alliv avatar piouson avatar aptcoder avatar ericomartin avatar adebayoileri avatar simeon979 avatar neymarjimoh avatar

Watchers

James Cloos avatar

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.