Git Product home page Git Product logo

comments's Introduction

comments app

A real-time comment engine with support for anonymous or authenticated posts

Quickstart

mkdir -p target/standalone && cd target/standalone
wget https://cdn.jsdelivr.net/npm/[email protected]/bin/comments-linux-standalone-x64.tar.gz
tar -xzf comments-linux-standalone-x64.tar.gz
./start.sh

screenshot

The demo is running on a $2.5 vultr plan located in SG, with the app configured to use a max memory of 128mb (to leave most of the available memory to the filesystem cache).

Instant comments on your site/blog

Put this anywhere in the html body (although it is advisable to put it last)

<div id="comments"></div>
<script>
window.comments_config = {
  collapse_depth: 7, // the depth where comments get collapsed by default
  limit_depth: 10, // max: 127
  //auth_host: 'https://api.dyuproject.com', // if you prefer authenticated comments
  ws_enabled: true, // real-time updates
  ws_host: 'wss://rpc.dyuproject.com/sub',
  rpc_host: 'https://rpc.dyuproject.com'
}
</script>
<script src="https://netlify-comments.dyuproject.com/dist/build.js"></script>
<link rel="stylesheet" href="https://netlify-comments.dyuproject.com/dist/build.css" />

Note: Uses the same instance powering the demo. No tracking whatsoever.

  1. The css is 7.1kb minified, built with pavilion core.
  2. The js is 91.8kb minified, built with:

Server runtime dependencies

  • jdk7

Dev requirements

  • node 6.9.0 or higher
  • yarn (npm install -g yarn)
  • jdk7 (at /usr/lib/jvm/java-7-oracle)
  • maven
  • protostuffdb (downloaded below)

Setup

mkdir -p target/data/main
echo "Your data lives in user/ dir.  Feel free to back it up." > target/data/main/README.txt

# download protostuffdb
yarn add [email protected] && mv node_modules/protostuffdb/dist/* target/ && rm -f package.json yarn.lock && rm -r node_modules

wget -O target/fbsgen-ds.jar https://repo1.maven.org/maven2/com/dyuproject/fbsgen/ds/fbsgen-ds-fatjar/1.0.10/fbsgen-ds-fatjar-1.0.10.jar
./modules/codegen.sh
mvn install

npm install -g http-server clean-css-cli
cd comments-ts
yarn install

Dev mode

# produces a single jar the first time (comments-all/target/comments-all-jarjar.jar)
./run.sh

# on another terminal
cd comments-ts
# serves the ui via http://localhost:8080/
yarn run dev

If your dev machine is a MacOS, protostuffdb currently does not have binary distributions for it (no MacOS machine to test/build against).

On the other hand, you can still do development on the client-side part with this temporary workaround:

  1. Edit comments-ts/index.html
  2. Replace window.rpc_host = 'http://127.0.0.1:5020' with window.rpc_host = 'https://rpc.dyuproject.com'

Production mode

cd comments-ts
# produces a single js and other assets in comments-ts/dist/
yarn run build

comments's People

Contributors

dyu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

comments's Issues

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.