Skip to content

Development

Gustavo Cunha edited this page Apr 16, 2023 · 7 revisions

github issues

Requirements

The latest version of this app was built to be used with Ruby 3.1.x, but it should work on any Ruby >= 2.6. It also requires Postgres > 11.0, Node 18 and Yarn 1.22.

I'll not provide instructions on how to install them because this instructions could potentially be out-of-date soon.

Installing

The instructions below assumes that your computer has RVM configured.

  • If you use rbenv, please check it's documentation for steps 1 and 2 or skip to step 3, at your will.
  • If you do not use any ruby version manager, start from step 3.

After cloning this repository, run the following commands:

  1. rvm rvmrc create ruby-2.7.0@gmmcal.com.br --ruby-version to create a gemset for this project.
  2. rvm use ruby-2.7.0@gmmcal.com.br to select the current gemset. Next time you try to use this project, RMV will auto-select for you.
  3. bundle install to install all ruby gems.
  4. yarn install to install all javascript packages.
  5. cp env.example .env to configure foreman startup.

Database

This application uses Postgres database. All credentials are provided in config/database.yml file. By default, it will use your current computer username to access database. You can modify it at your will, but it should not be pushed to this repository.

After database credentials are set, run the following commands to make it ready to work.

  1. rake db:create to create database.
  2. rake db:migrate to migrate the database structure to it's latest state.
  3. rake db:seed:all to add some dummy data to database.

Running application

To run the application, you can run the following command.

bin/dev

This will install foreman start local server with all dependencies. By default, rails will run on port 3000. Make sure there are nothing else running on this port.

If everything is fine, go to your browser and load http://localhost:3000 to view the website.

You can also use Overmind or any other process starter that is Procfile based. If you use any of those tools, look at the documentation on how to start a specific set of processes.

Admin

Admin page is accessible via /admin path. Development credentials are provided on seed script.

Clone this wiki locally