Skip to content

Local Installation

Jaime Giraldo edited this page Sep 23, 2019 · 5 revisions

Clone Respository

To clone this repository run:

git clone https://github.com/sposmen/cinema.git

It was developed in Ruby 2.5.6 (based on Heroku version)

DB

By default the application points to postgres server and to DB's with the structure as:

cinema_<RACK_ENV>

Currently it has three environments development, test and production.

If you don't have postgres installed in your machine there is an alternative option through docker-compose. To see how to install docker-compose see here

By running docker-compose up citus-master you will have a temporarily postgres instance.

To avoid port conflicts, it is pointing to the 5434 port (remember that postgres default is 5432).

If you have already a postgres server, to configure you connections change them accordingly in the config/environment files.

Migrations

To help to generate the schema there are been added some migrations.

  1. Ensure you have the DB create rake db:create (by default it handles the development environment)
  2. Run the migrations rake db:migrate

Run app

When all previous items have been done. You can run the app through the command:

rackup

And the default endpoint will be: http://0.0.0.0:9292/v1

Test

To run the test remember to have the DB prepared (RACK_ENV=test rake db:drop db:create db:migrate)

Command: rspec

TODO: Add more tests.