README.md 3.15 KB
Newer Older
1
# Basic Setup
Florian Hübsch's avatar
Florian Hübsch committed
2
3
4
5
* Copy `config/database.yml.example` to `config/database.yml` and enter your database connection information.
* Copy `.ruby-gemset.example` to `.ruby-gemset`.
* Copy `.ruby-version.example` to `.ruby-version`.
* Reload directory to create rvm gemset.
Merlin's avatar
Merlin committed
6

Jan-Philipp Willem's avatar
Jan-Philipp Willem committed
7
8
9
10
## nokogiri
if there are errors with nokogiri compilation with new xcode7:
`gem install nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2 --use-system-libraries`

Merlin's avatar
Merlin committed
11
12
## openbabel
* `brew install cmake` for OSX
jwillem's avatar
jwillem committed
13
* install openbabel as described in its [documentation](https://github.com/cubuslab/openbabel/blob/master/INSTALL)
14

Merlin's avatar
Merlin committed
15
16
## rmagick
* `brew install imagemagick gs` for OSX
Merlin's avatar
Merlin committed
17
* `apt-get install libmagickcore-dev libmagickwand-dev` for linux
Merlin's avatar
Merlin committed
18
19
20
* if installing the rmagick gem fails you may try: `IM_PREFIX=$(brew list imagemagick 2>&1 | grep -E 'identify$' | sed 's/bin\/identify$//g') PKG_CONFIG_PATH=${IM_PREFIX}lib/pkgconfig/ C_INCLUDE_PATH=${IM_PREFIX}include/ImageMagick*/ gem install rmagick` (OSX only)

## Application Setup
Florian Hübsch's avatar
Florian Hübsch committed
21
22
23
* Execute `bundle install`.
* Execute `rake db:reset` (this creates and seeds the database).

24
25
26
27
28
29
30
31
32
33
34
# Deployment notes

The search feature uses the Postgres extension pg_trgm (http://www.postgresql.org/docs/9.3/static/pgtrgm.html). For the first installation on the production machine you have to install the `postgres-contrib` package in order to enable Postgres extensions.
Just restart Postgres after installing the package.

If you like to reset the database (after `cap production deploy`) you have to execute the following commands (under the assumption your production database is called `chemotion`)

* `RAILS_ENV=production bundle exec rake db:drop db:create`
* `sudo -u postgres psql -d chemotion -c "CREATE EXTENSION pg_trgm;"`
* `RAILS_ENV=production bundle exec rake db:migrate db:seed`

35
36
# JS Setup & Testing

jwillem's avatar
jwillem committed
37
* Install `nvm`: `brew install nvm && echo "source $(brew --prefix nvm)/nvm.sh" >> ~/.profile`
jwillem's avatar
jwillem committed
38
39
* Copy `.nvmrc.example` to `.nvmrc`.
* Execute `nvm install` nvm will automatically use node 0.10.40 (in order to work with current jest-version)
40
41
* Execute `npm install`.

Florian Hübsch's avatar
Florian Hübsch committed
42
43
# Available Seeds

44
Currently 3 users are seeded with respective email `test@ninjaconcept.com`, `hattori@ninjaconcept.com`, `momochi@ninjaconcept.com`, and password `ninjaconcept` (for all 3 the same).
45

46
47
48
49
# Mailing in Development Environment

Run `rake jobs:work` for asynchronous handling of email notifications. Run `mailcatcher` in your console and go to `localhost:1080` to see all sent mails.

50
51
52
53
# API (v1)

## Collections

54
* Get serialized, unshared collection roots for current user
55
56

  `/api/v1/collections/roots`
57

58
59
60
61
* Get serialized, shared collection roots for current user

  `/api/v1/collections/shared_roots`

62
63
64
* Get serialized samples by collection id

  `/api/v1/collections/:collection_id/samples`
65

66
67
68
* Get serialized sample by id

  `/api/v1/samples/:id`
Jubke's avatar
Jubke committed
69
70
71
72
73
74
75
76
77
78
79
80

# Icon Font

* put new icons as SVG files (e.g. '<ICON_NAME>.svg') in `app/assets/images/svg_icons`
* run `rake icons:compile`

Icons are now available as css classes: '.icon-<ICON_NAME'

## FontCustom Dependencies

* `brew install fontforge --with-python`
* `brew install eot-utils`