Skip to content

l0gicpath/know_more

Repository files navigation

Small Knowledge Base

This is a small Knowledge Base that will contain help articles divided by topics.

Setup

To get started, a few configurations have to be set.

Database

First is the database, you'll find a database configuration example called database.yml.example in the config directory. Copy it to database.yml and modify it to include the database settings needed.

The database used is postgresql, a server should be up and running on your machine before attempting to run this.

Next step is to create the database tables and run migrations:

$ bundle exec rails db:create
$ bundle exec rails db:migrate

Translation Services

Second thing is the configuration of the translation services. The implementation lives in lib/translator.rb. This includes a Microsoft Translation Service integration, simple but does the job well.

Current Integrations:

  • Google Cloud Translation API
  • Microsoft Translation API V3

Currently the default service is set to :google, so in config/initializers/translations.rb we are loading the translation services configuration of which an example exists config/translation_services.yml.example

Important config/translation_services.yml is expected to be there, otherwise the application will not boot.

Google Integration

Google cloud translation API client is a bit special. It requires an environment variable to be set pointing at a creds json file, which a sample of it lives in config/google-auth.json.example. This must be replaced with one downloaded from Google developers console.

The environment variable part is already handled by the implementation, so all you need is to point at the right file.

Features

  • Users can list Articles, credit, edit and update them as well as delete them
  • Article content can contain HTML formatting elements