Skip to main content

Chemotion ELN Project Overview

Info

This page is still being edited and reviewed.

Both the native and Docker installation for development will result in cloning the source code (or a fork of it) for Chemotion ELN project. The source code can be found on GitHub. The images in this chapter are provided from the Docker installation, where the source code can be found in chemotion/client-chemotion-dev/src.

The project is built with the Ruby on Rails framework in version 5. It uses the Model-View-Controller (MVC) architectural pattern. However, this project differs from a typical Ruby on Rails project with the following points:

  • It is using JSON API.
  • Rails comes with built-in support for SQLite, but the project is using PostgreSQL. Redis might be used in the future as well.
  • Front-end: Written in React framework. The main page is a single-page application (SPA) along with a few other pages.

app#

app is the main directory in a Ruby on Rails application which contains the MVC structure. So it has the folders models, views, and controllers. As the architecture of the project is not the standard one, the controllers are mostly empty. Instead of that, as JSON API is used, everything is taken care of in the api directory. Also, there are not many pages in the views directory.

For compiling assets Webpacker is used in addition to (or in the future replacement of) the Rails Asset Pipeline. There are currently multiple directories containing assets (e. g. under app, public, vendor, tmp). The app/assets directory was the main directory for storing assets in the previous version with Rails 4. With the of implementation webpacker in the Rails 5 version of the Chemotion ELN the assets are moved to app/packs. For example the JavaScript files with all React components were former stored in app/assets/javascripts and are now stored in app/packs/src. The JavaScript directories contain a directory for each single-page application (SPA) (4 single-page applications) where the main page seen by the user is the components. The stylesheets directory is still located under app/assets.

config#

It contains the configuration of the application. database.yml contains the configuration of the database. There is also the environments directory which contains the three environments provided by Ruby on Rails by default which are development, production and test environments. Another directory here is the initializers where the configuration of extensions is located. For instance, devise is a package for authentication where the configuration of the mail sender and passwords happen.

lib#

Modules related to the application are added to this directory, such as PubChem, DataCite, OpenBabel. It also has the storage directory where the files are uploaded.

node_modules#

It contains the installed node modelus, that are installed by yarn.

public#

It contains the static files. The directory images contains the images of the molecules for instance, but it is difficult to query them as they have hexadecimal identifiers. When creating, e.g., a new reaction, the application will create an image for it and store it in the images/reactions directory.

spec#

It contains the tests such as unit test, acceptance test, and javascript test.

uploads#

It contains the attachments uploaded by the user.

.rubocop.yml and .eslintrc#

It is also advised to use RuboCop and ESLint for identifying problematic patterns found in Ruby and JavaScript code. In the hidden file .eslintrc and .rubocop.yml, there are the rules provided to the linters. Look at the development chapter for more details.

Last updated on by maipy