项目作者: OpenWebslides

项目描述 :
Backend component of the Open Webslides platform
高级语言: Ruby
项目地址: git://github.com/OpenWebslides/openwebslides-backend.git
创建时间: 2018-02-27T09:16:06Z
项目社区:https://github.com/OpenWebslides/openwebslides-backend

开源协议:MIT License

下载


Open Webslides Travis Coverage Status

Open Webslides is an open-source co-creation platform.

Getting started

Install the following software first:

  • RVM
  • Ruby (version: see Gemfile or .ruby-version)
  • Yarn
  • NodeJS 7.6.0

Then install all backend dependencies:

  1. $ gem install bundler --no-ri --no-rdoc
  2. $ bundle install

Initialize and update the git submodules:

  1. $ git submodule init
  2. $ git submodule update

To update the frontend module, use:

  1. $ cd web
  2. $ git pull

And install all frontend dependencies:

  1. $ cd web
  2. $ yarn install

Enable git pre-commit hooks:

  1. $ bundle exec overcommit --install

When the overcommit configuration changes (and on the first run), you have to verify it:

  1. $ bundle exec overcommit --sign

Development

Start the Rails server

  1. $ bundle exec rails db:migrate
  2. $ bundle exec rails server

Use RuboCop to enforce code conventions:

  1. $ bundle exec rubocop --rails

Use RSpec to run tests:

  1. $ bundle exec rails db:drop RAILS_ENV=test
  2. $ bundle exec rails db:create RAILS_ENV=test
  3. $ bundle exec rails db:migrate RAILS_ENV=test
  4. $ bundle exec rspec

If you want to fill the development database with sample data:

  1. $ bundle exec rails db:drop RAILS_ENV=development
  2. $ bundle exec rails db:create RAILS_ENV=development
  3. $ bundle exec rails db:migrate RAILS_ENV=development
  4. $ bundle exec rails db:sample RAILS_ENV=development

There is a Rake task for generating JWTs with a long lifetime for developing:

  1. $ # Use the user ID as argument
  2. $ bundle exec rails token:generate[1]
  3. $ # Or if you're using zsh
  4. $ bundle exec rails 'token:generate[1]'

Documentation

The application structure, operations manual and API documentation is located here.