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
- Linting Your Code
- Testing Your Code
- Contributing Your Code
- Endpoints Documentation
- Schema Design Explanation
Ensure that your local machine has all the required software, listed below, before setting up your local environment.
You will first need to setup your local environment and ensure that all configuration files are correctly configured.
- Fork the repo.
- Clone your forked repo to you local environment.
- In your terminal, run
npm install
. - In your terminal, run
cp .env.example .env
. - In your terminal, run
npm run startDev
.
- Run
npm run lint:fix
to fix all fixable errors in source code and format with prettier - Run
npm run lint
to find errors that still remain in your code syntax/format - Ensure you fix any remaining linting errors displayed. Run npm run test:ci to ensure your code matches the test
- Run
npm run test
to ensure your code passes all tests
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.
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.
Visit the online server to see the live Swagger documentation.
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.
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);
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
This model contains the following fields
name: string (name of the person comment)
email: string (email address of the person commenting)
MIT License
Copyright (c) 2020, Team Justice League. All rights reserved.