Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dev-mastery/comments-api
https://github.com/dev-mastery/comments-api
Last synced: 22 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dev-mastery/comments-api
- Owner: dev-mastery
- License: mit
- Created: 2019-03-12T21:43:11.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-28T10:59:06.000Z (over 1 year ago)
- Last Synced: 2024-10-01T12:01:30.982Z (about 1 month ago)
- Language: JavaScript
- Size: 634 KB
- Stars: 1,919
- Watchers: 47
- Forks: 648
- Open Issues: 59
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - dev-mastery/comments-api - (JavaScript)
README
# DevMastery Comments Microservice API
To manage comments on various Dev Mastery properties.[Using Clean Architecture for Microservice APIs in Node.js with MongoDB and Express](https://www.youtube.com/watch?v=CnailTcJV_U)
> In this video we talk about Bob Martin's Clean Architecture model and I will show you how we can apply it to a Microservice built in node.js with MongoDB and Express JS - @arcdev1
## Features
* XSS Protection (via [sanitize-html](https://www.npmjs.com/package/sanitize-html))
* Flags Spam (via [Akismet](https://akismet.com/))
* Flags rude or inappropriate language (English only via [Content Moderator](https://contentmoderator.cognitive.microsoft.com))
* Flags personally identifiable information (English only via [Content Moderator](https://contentmoderator.cognitive.microsoft.com))## Running Locally
#### Prerequisites
* [Git](https://git-scm.com/downloads)
* [Node JS](https://nodejs.org/en/)
* [Mongo DB](https://www.mongodb.com) (To use the Mongo DB interface as shown in the Mastery Monday youtube video, you need to install Mongo Compass)
* [Azure Content Moderator account (free)](https://contentmoderator.cognitive.microsoft.com)
* [Akismet Developer account (free)](https://akismet.com/development/api/#getting-started)#### 1. Clone the repo and install dependencies
```bash
git clone
cd comments-api
npm i
```#### 2. Modify the .env file
Save `sampledotenv` as `.env` and then add your database and Content Moderator + Akismet API details.#### 3. Startup your MongoDB
Usually this is just: `mongod` on the command line.#### 4. Start the server
To run in production mode where code is transpiled by Babel into a `dist` folder and run directly in `node`:
```bash
npm start
```To run in development mode where code is run by [babel-node](https://babeljs.io/docs/en/babel-node) via [nodemon](https://nodemon.io) and re-transpiled any time there is a change:
```bash
npm run dev
```