GithubHelp home page GithubHelp logo

bhanditz / cs_comments_service Goto Github PK

View Code? Open in Web Editor NEW

This project forked from appsembler/cs_comments_service

0.0 2.0 0.0 1.28 MB

server side of the comment service

License: GNU Affero General Public License v3.0

Shell 2.60% Ruby 95.40% JavaScript 2.00%

cs_comments_service's Introduction

Part of edX code.

edX Comments Service/Forums Travis_ Codecov_

An independent comment system which supports voting and nested comments. It also supports features including instructor endorsement for education-aimed discussion platforms.

Getting Started

If you are running cs_comments_service as part of edx-platform development under devstack, it is strongly recommended to read those setup documents first. Note that devstack will take care of just about all of the installation, configuration, and service management on your behalf. If running outside of devstack, continue reading below.

This service relies on Elasticsearch and MongoDB. By default the service will use the Elasticsearch server available at http://localhost:9200 and the MongoDB server available at localhost:27017. This is suitable for local development; however, if you wish to change these values, refer to config/application.yml and config/mongoid.yml for the environment variables that can be set to override the defaults.

Install the requisite gems:

$ bundle install

To initialize the index:

Setup the search index. Note that the command below creates an alias with a unique name (e.g. content_20161220185820323), and assigns it a known alias: content. If you choose not to use the command below, you should still opt to reference your index by an alias rather than the actual index name. This will enable you to swap out indices (e.g. rebuild_index) without having to take downtime or modify code with a new index name.

$ bin/rake search:initialize

To validate the 'content' alias exists and contains the proper mappings:

$ bin/rake search:validate_index

To rebuild the index:

To rebuild a new index from the database and then point the alias 'content' to it, you can use the rebuild_index task. This task will also run catchup before and after the alias is moved, to minimize time where the alias does not contain all documents.

$ bin/rake search:rebuild_index

To rebuild a new index without moving the alias and without running catchup, use the following:

$ bin/rake search:rebuild_index[false]

You can also adjust the batch size (e.g. 200) and the sleep time (e.g. 2 seconds) between batches to lighten the load on MongoDB.

$ bin/rake search:rebuild_index[true,200,2]

Run the server:

$ ruby app.rb

By default Sinatra runs on port 4567. If you'd like to use a different port pass the -p parameter:

$ ruby app.rb -p 5678

Running Tests

Tests are built using the rspec framework, and can be run with the command below:

$ bin/rspec

If you'd like to view additional options for the command, append the --help option:

$ bin/rspec --help

Internationalization (i18n) and Localization (l10n)

To run the comments service in a language other than English, set the SERVICE_LANGUAGE environment variable to the language code for the desired language. Its default value is en-US.

Setting the language has no effect on user content stored by the service. However, there are a few data validation messages that may be seen by end users via the frontend in edx-platform. These will be translated to SERVICE_LANGUAGE assuming a suitable translation file is found in the locale/ directory.

edX uses Transifex to host translations. To use the Transifex client, be sure it is installed (pip install transifex-client will do this for you), and follow the instructions here to set up your .transifexrc file.

To upload strings to Transifex for translation when you change the set of translatable strings: bin/rake i18n:push

To fetch the latest translations from Transifex: bin/rake i18n:pull

The repository includes some translations so they will be available upon deployment. To commit an update to these: bin/rake i18n:commit

License

The code in this repository is licensed under version 3 of the AGPL unless otherwise noted.

Please see LICENSE.txt for details.

How to Contribute

Contributions are very welcome. The easiest way is to fork this repo, and then make a pull request from your fork. The first time you make a pull request, you may be asked to sign a Contributor Agreement.

Reporting Security Issues

Please do not report security issues in public. Please email [email protected]

Mailing List and IRC Channel

You can discuss this code on the edx-code Google Group or in the edx-code IRC channel on Freenode.

cs_comments_service's People

Contributors

dementrock avatar kevinchugh avatar clintonb avatar robrap avatar arjun810 avatar wajeeha-khalid avatar ibrahima avatar tobz avatar feanil avatar dianakhuang avatar e0d avatar jtauber avatar macdiesel avatar cpennington avatar carsongee avatar jmclaus avatar sarina avatar jarv avatar pomegranited avatar dan-f avatar bderusha avatar aboudreault avatar benmcmorran avatar denibertovic avatar markchang avatar mtyaka avatar halogenandtoast avatar changpingc avatar blarghmatey avatar hikari-boulders avatar

Watchers

James Cloos avatar  avatar

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.