- install Ruby
- download and install postgresql. https://www.postgresql.org/download
- install RubyMine. https://www.jetbrains.com/ruby/download/#section=windows
- Run the following command.
$ gem install rails
$ bundle install
Ask for the database.yml and master.key files.
$ rails db:create
$ rails db:migrate
$ rails db:seed
- Change the host in config/database.yml to 'db'.
- Install Docker. https://docs.docker.com/desktop/windows/install/
- Run the following command. Or click on the Run icon beside services in docker-compose.yml.
$ docker-compose up
- Run in a another terminal to migrate and seed data.
$ docker-compose run web rake db:create db:migrate db:seed
The server will run on localhost:3000.
- Clone the repo or pull deploy-to-dev branch.
- Run the following command.
$ cd sr_tenant_application_api
$ bundle install
$ rails s
The server will run on localhost:3000.
- Follow the instructions in First-time setup. (Note: Set the password of postgres to root when installing postgresql.)
- Get a copy of
database.yml
andmaster.key
. - Clone the repository.
- Checkout to the development branch.
$ git fetch && git checkout deploy-to-dev
- Copy the
database.yml
andmaster.key
to/config
. - Run the following command to setup the database.
$ rails db:create db:migrate db:seed
- Make sure that the postgresql is running. (In Ubuntu's case, run the following command)
$ sudo service postgresql start
- Run the following command to setup the project.
$ cd sr_tenant_application_api
$ bundle install
$ rails s
The server will run on localhost:3000.
$ rspec spec/requests
- Model - It contains the models and data stored in our application's database.
- View - This folder contains the display templates to fill data in our application.
- Controller - All the controller files are stored here. A controller handles all the web requests from the user.
- Interactors - This folder have the appilcations business logic. It is called in controllers or organizers.
- Queries - It is a query object pattern that helps in decomposing the fat ActiveRecord models and keeping the code slim and readable by extracting complex SQL queries or scopes into the separated classes that are easy to reuse and test. This is currently used in Profile.
- Serializers - It convert a given object into a JSON format. Serializers control the particular attributes rendered when an object or model is converted into a JSON format.
- Uploaders - Carrierwave stores the configuration in this folder. Uploaders are included into some models.
- Validators - Custom validation for interactors.
- Services - It is a object pattern that can help separate business logic from controllers and models, enabling the models to be simply data layers and the controller entry point to the API. In the app, it is used to manipulate data. Such as; calculations, profile completion, getting the top agents or properties, etc.