Sample of clean architecture as comments in Javascript. Using node.js and express and MongoDB
- Add comments
- Get comments
- Build in hash-check that comments cannot be dublicated
- Can nest comments if in the API payload the replyToId is defined
- Comments do not have author info (for security), but that can is fetched from another db
- automatically saves source info (IP etc...)
- No entity, function etc are tightly coupled. We only couple the entities and rules in runtime.
- express
- sanitize-html
- ip-regex
- crypto