{"id":24182584,"url":"https://github.com/YuriSizuku/web-MiniComment","last_synced_at":"2025-09-21T04:31:49.606Z","repository":{"id":57687491,"uuid":"310384797","full_name":"YuriSizuku/web-MiniComment","owner":"YuriSizuku","description":"A Mini Comment web application, using Nodejs, Vue.js,  Mongodb","archived":false,"fork":false,"pushed_at":"2022-05-17T14:18:49.000Z","size":750,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-07T14:47:47.881Z","etag":null,"topics":["javascript","mongodb","nodejs","serverless","webapp"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YuriSizuku.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-05T18:28:45.000Z","updated_at":"2023-02-04T17:30:01.000Z","dependencies_parsed_at":"2022-08-25T17:53:41.786Z","dependency_job_id":null,"html_url":"https://github.com/YuriSizuku/web-MiniComment","commit_stats":null,"previous_names":["yurisizuku/minicomment"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YuriSizuku%2Fweb-MiniComment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YuriSizuku%2Fweb-MiniComment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YuriSizuku%2Fweb-MiniComment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YuriSizuku%2Fweb-MiniComment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YuriSizuku","download_url":"https://codeload.github.com/YuriSizuku/web-MiniComment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233711034,"owners_count":18717952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","mongodb","nodejs","serverless","webapp"],"created_at":"2025-01-13T08:13:51.900Z","updated_at":"2025-09-21T04:31:44.301Z","avatar_url":"https://github.com/YuriSizuku.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MiniComment  \n\n![npm](https://img.shields.io/npm/v/minicomment?color=green)  \n\n❄️ A Mini Comment web application, using `Nodejs`, `Vue.js`, `Mongodb`.  \nYou can use the raw format or markdown format.  \n\n![minicomment_v0.8](screenshot/minicomment_v0.8_markdown.png)\n\n❄️ This project support for deploying in any node server, as well as vercel.  \nThe demo is here [Yurisizuku](https://blog.schnee.moe/comments/).  \n\n![minicomment_v0.7](screenshot/minicomment_v0.7.png)\n\n## 🍀 MiniComment component\n\n### MiniComment Server\n\n- `minicomment_server.js`,  main server of this app, the command line is as below\n- `minicomment_api.js`, parse the api for get/submit the comment.\n- `minicomment_model.js`  the defination of the comments model and some functions to manipulate the database\n- `minicomment_db.js`, some configs for connet database\n\n## MiniComment Client\n\nIn  `/public`, use  `minicomment.xhtml`, `minicomment.js`, `minicomment.css` to import minicoment client. The comment web UI can\n\n- fetch the comments by ajax and render the comments in several pages\n- go forward, backward, and jump to arbitary page\n- show the reference (if has) of each comment, and jump to reference\n- submit the comments , with the captcha support\n\n❄️ It has some configs as bellow:\n\n```html\n\u003cmeta article_title=\"Comments\" api_host=\"http://localhost:3003\"/\u003e\n\u003cmeta comment_view_limit=\"10\" page_limit=\"10\"/\u003e\n```\n\n## 🍀 MiniComment Client Deploy\n\n### deploy in any html page\n\n1. input the `jquery.js`, `vue.js`, `marked.js`, `highlight.js`, `highlightjs-line-numbers.js` libraries by `\u003cscript src=\"\"\u003e\u003c/scrpt\u003e`\n\n2. use jquery load `minicomment.xhtml` into where you want to add comment view, see `/public/minicomment.html` in detail. \n\n```html\n\u003cmeta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /\u003e\n\u003cmeta article_title=\"Comments\" api_host=\"http://localhost:3003\"/\u003e\n\u003cmeta comment_view_limit=\"10\" page_limit=\"10\"/\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/vue@2.6.12\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/marked@1.2.3/marked.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.1.2/build/highlight.js\"\u003e\u003c/script\u003e\n\u003clink rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.1.2/build/styles/vs.min.css\"/\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/highlightjs-line-numbers.js@2.8.0/dist/highlightjs-line-numbers.min.js\"\u003e\u003c/script\u003e\n\u003cdiv id=\"mini_comment\"\u003e\u003c/div\u003e\n\u003cscript\u003e$(\"#mini_comment\").load(\"./minicomment.xhtml\");\u003c/script\u003e\n```\n\n### deploy in hexo(butterfly theme)\n\n1. In `hook_style.js`, use  jQuery  `load` to import the html into the comment page, something like:\n\n```javascript\n// hook_style.js\nfunction add_mini_comment(){\n  $($('meta')[0]).after('\u003cmeta api_host=\"\"\u003e');\n  var article_title = $('meta[property=\"og:title\"]').attr('content');\n  if ($('meta[article_title]').length \u003c= 0 ){\n    $($('meta')[0]).after('\u003cmeta article_title=\"\"\u003e');\n  }\n  switch(article_title.toLowerCase()){\n    case \"home\":\n    case \"archives\":\n    case \"tags\":\n    case \"catagories\":\n    case \"about\": break;\n    case \"comments\":\n      $('meta[article_title]').attr('article_title', \"Comments\");\n      $('#page').append('\u003cdiv id=\"mini_comment\"\u003e\u003c/div\u003e');\n      $('div#mini_comment').load(\"/hook/minicomment.xhtml\");\n      break;\n    default:\n      $('meta[article_title]').attr('article_title',  article_title);\n      $('#post').append('\u003cdiv id=\"mini_comment\"\u003e\u003c/div\u003e');\n      $('div#mini_comment').load(\"/hook/minicomment.xhtml\");\n      break;\n  }\n}\n```\n\n2. In `_config.butterfly.yml`,   import the `Vue` and `hook_style.js`\n\n```yml\n# _config.butterfly.yml \ninject:\n  head:\n  - \u003clink rel=\"stylesheet\" href=\"/hook/hook_style.css\"\u003e\n  bottom:\n  - \u003cscript src=\"https://cdn.jsdelivr.net/npm/vue@2.6.12\"\u003e\u003c/script\u003e\n  - \u003cscript src=\"https://cdn.jsdelivr.net/npm/marked@1.2.3/marked.min.js\"\u003e\u003c/script\u003e\n  - \u003cscript src=\"https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.1.2/build/highlight.js\"\u003e\u003c/script\u003e\n  - \u003cscript src=\"https://cdn.jsdelivr.net/npm/highlightjs-line-numbers.js@2.8.0/dist/highlightjs-line-numbers.min.js\"\u003e\u003c/script\u003e\n```  \n\n3. put the `minicomment.xhtml`, `minicomment.js`, `minicomment.css` into `\u003chexo\u003e/source/hook/` directly (hexo generate html in wrong format, so rename it to xhtml). Maybe need to edit `\u003cmeta api_host=\"YourHostName or empty\"/\u003e` and delete `\u003cmeta article_title=\"xxx\"\u003e`, because it is set by the `hook_style.js`. Also change the path of js and css.\n\n**❄️ Finally, do not forget to purge the cdn caches to see the changes**  \n\n```html\n\u003cmeta api_host=\"YourHostName or empty\"/\u003e\n\u003clink rel=\"stylesheet\" type=\"text/css\" href=\"/hook/minicomment.css\" /\u003e\n\u003cscript src=\"/hook/minicomment.js\"\u003e\u003c/script\u003e\n```\n\n## 🍀 MiniComment Server Deploy\n\n### deploy on any node server  \n\n1. use command below to download, \n\n``` bash\ngit clone https://github.com/YuriSizuku/MiniComment.git \u0026\u0026 cd MiniComment \u0026\u0026 npm i\nnpm i minicomment \u0026\u0026 npm i # or just use npm to install pacakge\n```\n\n2. create a file `./secret/SECRET_DB.TXT` and put a  string like `mongodb://username:password@host:port/database?authSource=admin` for connecting to your mongodb database.\n3. `npm run start` or `pm2 start server.js` to run it, have fun ~\n\nAlso you can simple run the commad as below, to deploy in any node server.\n\n``` shell\nnode minicomment_server.js [options]\n--port=3003, or $port # you can use either secret_file or secret_url\n--secret_url, or $secret_url # mongodb://username:password@host:port/database?authSource=admin\n--secret_file=./secret/SECRET_DB.TXT\n```\n\n### deploy on vercel  \n\n1. create a project in vercel and fork [this](https://github.com/YuriSizuku/MiniComment) repository.\n2. in vercel config `settings/environment-variables` page, set enviroment, `secret_url=mongodb://username:password@host:port/database?authSource=admin` as yours.\n3. deploy and have fun ~  \n\n## 🍀 history  \n\n- v0.9, refract the code structure, support for vecel, serverless\n- v0.8, add support for markdown  \n- v0.7, initial version, with comment view and submit function  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYuriSizuku%2Fweb-MiniComment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FYuriSizuku%2Fweb-MiniComment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYuriSizuku%2Fweb-MiniComment/lists"}