├── .babelrc ├── .dockerignore ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature.md └── workflows │ └── tests.yml ├── .gitignore ├── .gitlab-ci.yml ├── .postcssrc.yml ├── .rspec ├── .rubocop.yml ├── .ruby-version ├── .tool-versions ├── CONTRIBUTORS.md ├── Dockerfile ├── Gemfile ├── Gemfile.lock ├── PULL_REQUEST_TEMPLATE.md ├── README-EN.md ├── README.md ├── Rakefile ├── app ├── assets │ ├── config │ │ └── manifest.js │ ├── images │ │ ├── .keep │ │ ├── brazil_flag.svg │ │ ├── favicon.ico │ │ ├── header.jpg │ │ ├── ico-password.png │ │ ├── ico-user.png │ │ ├── logo-mail.png │ │ ├── people_in_love.svg │ │ ├── preview-ribbon.png │ │ ├── scale.png │ │ ├── scale.svg │ │ ├── test-ribbon.png │ │ ├── trans-people.svg │ │ ├── transervicos-logo.png │ │ └── transervicos-logo.svg │ ├── javascripts │ │ ├── application.js │ │ ├── cable.js │ │ ├── channels │ │ │ └── .keep │ │ ├── components │ │ │ ├── application.js │ │ │ └── carousel.js │ │ ├── email_validator.js │ │ ├── error_formatter.js │ │ ├── infinite_scroll.js │ │ ├── like_dislike.js │ │ ├── registrations.js │ │ ├── report_validator.js │ │ ├── required_validator.js │ │ └── service_form.js │ └── stylesheets │ │ ├── _core.scss │ │ ├── _variables.scss │ │ ├── application.scss │ │ ├── auth.scss │ │ ├── jasny-bootstrap.min.css │ │ └── welcome.scss ├── channels │ └── application_cable │ │ ├── channel.rb │ │ └── connection.rb ├── controllers │ ├── application_controller.rb │ ├── concerns │ │ └── .keep │ ├── dashboard_controller.rb │ ├── errors_controller.rb │ ├── lists_controller.rb │ ├── registrations_controller.rb │ ├── reports_controller.rb │ ├── services_controller.rb │ ├── states_controller.rb │ └── welcome_controller.rb ├── helpers │ ├── application_helper.rb │ ├── pagination_helper.rb │ ├── registrations_helper.rb │ └── services_helper.rb ├── javascript │ ├── app.vue │ └── packs │ │ └── application.js ├── jobs │ └── application_job.rb ├── mailers │ └── application_mailer.rb ├── models │ ├── .keep │ ├── ability.rb │ ├── address.rb │ ├── application_record.rb │ ├── area.rb │ ├── city.rb │ ├── concerns │ │ └── .keep │ ├── forbidden_word.rb │ ├── report.rb │ ├── service.rb │ ├── state.rb │ ├── subarea.rb │ ├── user.rb │ └── voting_session.rb ├── validators │ ├── city_validator.rb │ └── state_validator.rb └── views │ ├── dashboard │ └── index.html.erb │ ├── devise │ ├── confirmations │ │ └── new.html.erb │ ├── mailer │ │ ├── confirmation_instructions.html.erb │ │ ├── password_change.html.erb │ │ ├── preview │ │ │ └── devise_mailer_preview.rb │ │ ├── reset_password_instructions.html.erb │ │ └── unlock_instructions.html.erb │ ├── passwords │ │ ├── edit.html.erb │ │ └── new.html.erb │ ├── registrations │ │ ├── edit.html.erb │ │ └── new.html.erb │ ├── sessions │ │ └── new.html.erb │ ├── shared │ │ └── _links.html.erb │ └── unlocks │ │ └── new.html.erb │ ├── errors │ ├── internal_error.html.erb │ ├── not_found.html.erb │ └── unacceptable.html.erb │ ├── layouts │ ├── application.html.erb │ ├── mailer.html.erb │ └── mailer.text.erb │ ├── lists │ └── services_with_reports.html.erb │ ├── partials │ ├── _like_unlike.html.erb │ ├── _service.html.erb │ ├── _service_list.html.erb │ ├── _service_report.html.erb │ └── _service_with_reports_list.html.erb │ ├── reports │ └── index.html.erb │ ├── services │ ├── _form.html.erb │ ├── edit.html.erb │ ├── index.html.erb │ ├── index.json.jbuilder │ ├── new.html.erb │ ├── show.html.erb │ └── show.json.jbuilder │ ├── trans_mailer │ ├── send_mail_report.html.erb │ └── send_mail_report.txt.erb │ └── welcome │ └── index.html.erb ├── bin ├── bundle ├── rails ├── rake ├── setup ├── update ├── webpack ├── webpack-dev-server └── yarn ├── config.ru ├── config ├── application.rb ├── boot.rb ├── brakeman.ignore ├── cable.yml ├── credentials.yml.enc ├── database.yml.example ├── environment.rb ├── environments │ ├── development.rb │ ├── production.rb │ └── test.rb ├── initializers │ ├── application_controller_renderer.rb │ ├── assets.rb │ ├── backtrace_silencers.rb │ ├── content_security_policy.rb │ ├── cookies_serializer.rb │ ├── devise.rb │ ├── filter_parameter_logging.rb │ ├── inflections.rb │ ├── mime_types.rb │ ├── simple_form.rb │ └── wrap_parameters.rb ├── locales │ ├── devise.en.yml │ ├── en.yml │ ├── simple_form.en.yml │ └── views │ │ └── welcome │ │ └── pt-br.yml ├── puma.rb ├── routes.rb ├── spring.rb ├── storage.yml ├── webpack │ ├── development.js │ ├── environment.js │ ├── loaders │ │ └── vue.js │ ├── production.js │ └── test.js └── webpacker.yml ├── db ├── migrate │ ├── 20151211201731_devise_create_users.rb │ ├── 20151214201039_add_extra_fields_to_users.rb │ ├── 20151214203920_create_services.rb │ ├── 20151214205645_create_addresses.rb │ ├── 20151222164956_add_service_id_to_address.rb │ ├── 20151223150803_create_areas.rb │ ├── 20151223151132_create_subareas.rb │ ├── 20151229132522_add_relation_between_service_and_subarea.rb │ ├── 20160119203424_add_relation_between_user_and_service.rb │ ├── 20160120123758_create_friendly_id_slugs.rb │ ├── 20160120124010_add_slug_to_services.rb │ ├── 20160121150431_add_name_preference_to_user.rb │ ├── 20160201174342_add_owner_fields_to_services.rb │ ├── 20160202171035_add_another_phone_to_services.rb │ ├── 20160202184346_add_admin_to_user.rb │ ├── 20160219183101_create_states.rb │ ├── 20160219191835_create_cities.rb │ ├── 20160222182548_add_city_and_state_to_address.rb │ ├── 20160301014528_add_website_to_services.rb │ ├── 20160419185224_create_forbidden_words.rb │ ├── 20160422180911_acts_as_votable_migration.rb │ ├── 20160424224442_create_voting_sessions.rb │ ├── 20160520165008_install_trigram.rb │ ├── 20160520203043_add_index_service_name.rb │ ├── 20160520211129_add_index_service_description.rb │ ├── 20160523194021_create_extension_unaccent.rb │ ├── 20160523201023_drop_extension_pg_trgm.rb │ ├── 20160523201311_drop_indexes_pg_trgm_on_services.rb │ ├── 20160609170644_create_reports.rb │ ├── 20160613213641_add_email_to_report.rb │ └── 20190120183617_create_active_storage_tables.active_storage.rb ├── schema.rb ├── seeds.rb └── structure.sql ├── docker-compose.yml ├── entrypoint.sh ├── lib ├── assets │ └── .keep ├── tasks │ └── .keep └── templates │ └── erb │ └── scaffold │ └── _form.html.erb ├── log └── .keep ├── package.json ├── public ├── 404.html ├── 422.html ├── 500.html ├── apple-touch-icon-precomposed.png ├── apple-touch-icon.png ├── favicon.ico └── robots.txt ├── spec ├── features │ ├── visitor_create_an_account_spec.rb │ └── visitor_visit_root_path_spec.rb ├── models │ ├── address_spec.rb │ ├── area_spec.rb │ ├── city_spec.rb │ ├── report_spec.rb │ ├── service_spec.rb │ ├── state_spec.rb │ ├── subarea_spec.rb │ ├── user_spec.rb │ └── votin_session_spec.rb ├── rails_helper.rb └── spec_helper.rb ├── storage └── .keep ├── tmp └── .keep └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { 4 | "modules": false, 5 | "targets": { 6 | "browsers": "> 1%", 7 | "uglify": true 8 | }, 9 | "useBuiltIns": true 10 | }] 11 | ], 12 | 13 | "plugins": [ 14 | "syntax-dynamic-import", 15 | "transform-object-rest-spread", 16 | ["transform-class-properties", { "spec": true }] 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | ./.git 2 | ./tmp 3 | ./log 4 | ./node_modules 5 | ./coverage 6 | ./dumps 7 | ./public/system 8 | ./public/assets 9 | *.log 10 | ./Dockerfile* 11 | ./public/packs 12 | ./public/packs-test 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "🐞 Template para bug reports" 3 | about: Por favor use este template quando quiser enviar bug reports 4 | title: "[BUG] - " 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | # O que houve 11 | Descrição do bug 12 | 13 | - Quando eu [abro uma tela/clico em um botão], [algo inesperado acontece]. 14 | 15 | # Como reproduzir o bug 16 | Escreva da maneira mais específica possível. Uma boa ideia é seguir a lista 17 | abaixo, dessa forma podemos encontrar e arrumar o problema de forma mais rápida: 18 | 19 | - Nome e versão do navegador usado 20 | - Nome e versão do sistema operacional 21 | - Prints, se possível. Eles ajudam muito a processar o problema. 22 | - Onde você clicou 23 | - O que aconteceu 24 | 25 | Agradecemos seu feedback! ♡ 26 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "✨ Template de issue para novas features" 3 | about: "Quer ver uma feature nova no projeto? Crie uma issue usando este template." 4 | title: "[FEATURE] - " 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | # O que é 10 | Descreva a feature que você gostaria de ver no projeto 11 | 12 | - Como uma [persona/papel] eu quero [ação] de forma que [resultado/benefício]. 13 | - Quando [eu trabalho com alguma coisa/contexto de vida] eu quero que [motivação] de forma que [resultado/benefício]. 14 | 15 | # Por que 16 | Motivos para incluir esta feature nova no projeto. 17 | 18 | Agradecemos seu feedback! ♡ 19 | -------------------------------------------------------------------------------- /.github/workflows/tests.yml: -------------------------------------------------------------------------------- 1 | name: Transerviços - Validações 2 | on: push 3 | jobs: 4 | test: 5 | runs-on: ubuntu-latest 6 | container: 7 | image: ruby:2.6.4 8 | env: 9 | PGUSER: postgres 10 | PGPASSWORD: postgres 11 | RAILS_ENV: test 12 | services: 13 | db: 14 | image: postgres:11 15 | env: 16 | POSTGRES_USER: postgres 17 | POSTGRES_PASSWORD: postgres 18 | ports: 19 | - 5432:5432 20 | options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 21 | 22 | steps: 23 | - uses: actions/checkout@master 24 | - uses: actions/setup-node@v1 25 | with: 26 | node-version: '8.16.2' 27 | - name: Setup dependencies 28 | run: | 29 | wget -q -O - https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - 30 | echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list 31 | apt-get update -yq 32 | apt-get install -y apt-transport-https build-essential cmake libpq-dev python3-software-properties software-properties-common unzip libgit2-dev yarn 33 | cp config/database.yml.example config/database.yml 34 | gem install bundler:2.0.1 35 | gem install pronto pronto-rubocop pronto-brakeman 36 | bundle check || bundle install --jobs $(nproc) 37 | bundle exec rails db:create db:migrate db:seed db:test:prepare 38 | yarn install 39 | yarn run build 40 | - run: pronto run -f gitlab -c origin/master 41 | - run: rubocop --config .rubocop.yml 42 | - run: brakeman 43 | - run: rspec spec 44 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore all logfiles and tempfiles. 11 | /log/* 12 | /tmp/* 13 | !/log/.keep 14 | !/tmp/.keep 15 | 16 | # Ignore uploaded files in development 17 | /storage/* 18 | !/storage/.keep 19 | 20 | /config/database.yml 21 | 22 | /vendor/cache 23 | /node_modules 24 | /yarn-error.log 25 | 26 | /public/assets 27 | .byebug_history 28 | 29 | # Ignore master key for decrypting credentials and more. 30 | /config/master.key 31 | /public/packs 32 | /public/packs-test 33 | /node_modules 34 | yarn-debug.log* 35 | .yarn-integrity 36 | 37 | coverage 38 | 39 | .env 40 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | # This file is a template, and might need editing before it works on your project. 2 | # Official language image. Look for the different tagged releases at: 3 | # https://hub.docker.com/r/library/ruby/tags/ 4 | image: "ruby:2.6" 5 | 6 | # Pick zero or more services to be used on all builds. 7 | # Only needed when using a docker container to run your tests in. 8 | # Check out: http://docs.gitlab.com/ce/ci/docker/using_docker_images.html#what-is-a-service 9 | services: 10 | - postgres:latest 11 | 12 | variables: 13 | DATABASE_URL: postgresql://postgres@postgres 14 | RAILS_ENV: 'test' 15 | 16 | # Cache gems in between builds 17 | cache: 18 | paths: 19 | - vendor/ruby 20 | stages: 21 | - build 22 | - test 23 | - code_review 24 | - deploy 25 | 26 | # This is a basic example for a gem or script which doesn't use 27 | # services such as redis or postgres 28 | before_script: 29 | - ruby -v # Print out ruby version for debugging 30 | # Uncomment next line if your rails app needs a JS runtime: 31 | # Install node and some other deps 32 | - curl -sL https://deb.nodesource.com/setup_8.x | bash - 33 | - apt-get update -yq 34 | - apt-get install -y apt-transport-https build-essential cmake nodejs libpq-dev python3-software-properties software-properties-common unzip 35 | 36 | # Install yarn 37 | - wget -q -O - https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - 38 | - echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list 39 | - apt-get update -yq 40 | - apt-get install -y yarn 41 | 42 | - cp config/database.yml.example config/database.yml 43 | - gem install bundler # Bundler is not installed with the image 44 | - gem install pronto pronto-rubocop pronto-brakeman 45 | - bundle check || bundle install --jobs $(nproc) 46 | - yarn install 47 | 48 | code_review: 49 | stage: code_review 50 | script: 51 | - pronto run -f gitlab -c origin/master 52 | - rubocop --config .rubocop.yml 53 | - brakeman 54 | allow_failure: true 55 | 56 | build: 57 | stage: build 58 | script: 59 | - yarn run build 60 | - bundle exec rails db:create 61 | - bundle exec rails db:migrate 62 | - bundle exec rails db:seed # TODO: Change/refactor to run once 63 | 64 | test: 65 | stage: test 66 | script: 67 | - bundle exec rails db:test:prepare 68 | - rspec spec 69 | 70 | # This deploy job uses a simple deploy flow to Heroku, other providers, e.g. AWS Elastic Beanstalk 71 | # are supported too: https://github.com/travis-ci/dpl 72 | deploy: 73 | stage: deploy 74 | environment: production 75 | script: 76 | - gem install dpl 77 | - dpl --provider=heroku --app=$HEROKU_APP_NAME --api-key=$HEROKU_PRODUCTION_KEY 78 | only: 79 | - master 80 | -------------------------------------------------------------------------------- /.postcssrc.yml: -------------------------------------------------------------------------------- 1 | plugins: 2 | postcss-import: {} 3 | postcss-cssnext: {} 4 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --require spec_helper 2 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | require: 2 | - rubocop-rails 3 | 4 | Metrics/LineLength: 5 | Max: 120 6 | 7 | AllCops: 8 | TargetRubyVersion: 2.6 9 | Exclude: 10 | - 'vendor/**/*' 11 | - 'node_modules/**/*' 12 | - 'bin/setup' 13 | - 'bin/update' 14 | - 'db/schema.rb' 15 | - 'db/migrate/*.rb' 16 | - 'spec/spec_helper.rb' 17 | - 'spec/rails_helper.rb' 18 | 19 | Style/Documentation: 20 | Enabled: false 21 | 22 | Metrics/BlockLength: 23 | ExcludedMethods: ['describe', 'context', 'feature', 'scenario', 'let'] 24 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 2.6.4 2 | -------------------------------------------------------------------------------- /.tool-versions: -------------------------------------------------------------------------------- 1 | ruby 2.6.4 2 | -------------------------------------------------------------------------------- /CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | **Contributors** 2 | 3 | * [Brandon Dees](https://twitter.com/brandondees) 4 | * [Eduardo Stuart](https://twitter.com/eduardostuart) 5 | * [Eliezer Salvato](https://medium.com/@eliezersalvato) 6 | * [Iago Cavalcante](https://twitter.com/iagoangelim) 7 | * [Klaus Kazlauskas](https://twitter.com/klauskpm) 8 | * [leandro Bighetti](https://twitter.com/leandrobighetti) 9 | * [Nayara Alves (Naahh)](https://twitter.com/_jhorse) 10 | * [Rachel Curioso](https://twitter.com/_rchc) 11 | * [Rafael França](https://twitter.com/rafaelfranca) 12 | * [Rimenes Ribeiro](https://twitter.com/rimenes) 13 | 14 | Thank you <3 You're awesome folks!!! <3 15 | 16 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ruby:2.6.4 2 | ENV BUNDLE_PATH="$GEM_HOME" HISTFILE="$APP_HOME/tmp/docker_histfile" 3 | 4 | RUN apt-get update -qq \ 5 | && apt-get install -y --no-install-recommends nodejs postgresql-client cmake npm \ 6 | && npm install -g yarn 7 | 8 | RUN mkdir /transervicos 9 | WORKDIR /transervicos 10 | RUN gem install bundler:2.0.1 11 | COPY Gemfile /transervicos/Gemfile 12 | COPY Gemfile.lock /transervicos/Gemfile.lock 13 | COPY . /transervicos 14 | 15 | # Install gems using Bundler 16 | RUN bundle check || (bundle install --no-cache --jobs=2 \ 17 | && bundle clean --force \ 18 | && rm -rf "$BUNDLE_PATH/gems/*/.git" \ 19 | && rm -rf "$BUNDLE_PATH/bundler/gems/*/.git") 20 | 21 | # Install JS packages using Yarn 22 | COPY package.json yarn.lock /transervicos/ 23 | RUN yarn install && yarn cache clean 24 | 25 | # Add a script to be executed every time the container starts. 26 | COPY entrypoint.sh /usr/bin/ 27 | RUN chmod +x /usr/bin/entrypoint.sh 28 | ENTRYPOINT ["entrypoint.sh"] 29 | EXPOSE 3000 30 | 31 | # Start the main process. 32 | CMD ["rails", "server", "-b", "0.0.0.0"] 33 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source 'https://rubygems.org' 4 | git_source(:github) { |repo| "https://github.com/#{repo}.git" } 5 | 6 | ruby '2.6.4' 7 | 8 | gem 'acts_as_votable' 9 | gem 'bootsnap', '>= 1.1.0', require: false 10 | gem 'bootstrap-sass' 11 | gem 'cancancan' 12 | gem 'coffee-rails', '~> 4.2' 13 | gem 'devise' 14 | gem 'friendly_id' 15 | gem 'i18n', '1.0.0' 16 | gem 'jasny-bootstrap-rails' 17 | gem 'jbuilder', '~> 2.5' 18 | gem 'jquery-turbolinks' 19 | gem 'pg', '~> 1.1', '>= 1.1.4' 20 | gem 'puma', '~> 3.12' 21 | gem 'rails', '~> 5.2' 22 | gem 'rails_admin' 23 | gem 'sassc-rails' 24 | gem 'simple_form' 25 | gem 'turbolinks', '~> 5' 26 | gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] 27 | gem 'uglifier', '>= 1.3.0' 28 | gem 'webpacker' 29 | gem 'will_paginate' 30 | gem 'will_paginate-bootstrap' 31 | 32 | group :development, :test do 33 | gem 'awesome_print' 34 | gem 'byebug', platforms: %i[mri mingw x64_mingw] 35 | gem 'factory_bot_rails' 36 | gem 'pry-rails' 37 | gem 'rspec-activemodel-mocks' 38 | gem 'rspec-rails', '~> 3.8' 39 | end 40 | 41 | group :development do 42 | gem 'better_errors' 43 | gem 'binding_of_caller' 44 | gem 'listen', '>= 3.0.5', '< 3.2' 45 | gem 'pronto' 46 | gem 'pronto-rubocop', require: false 47 | gem 'rubocop', require: false 48 | gem 'rubocop-rails' 49 | gem 'spring' 50 | gem 'spring-watcher-listen', '~> 2.0.0' 51 | end 52 | 53 | group :test do 54 | gem 'capybara', '>= 2.15' 55 | gem 'shoulda-matchers' 56 | gem 'simplecov', require: false 57 | end 58 | -------------------------------------------------------------------------------- /PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # O que 2 | Descrição do que você fez com as mudanças propostas no código. 3 | 4 | # Por que 5 | Por que você abriu este pull request. 6 | 7 | # Amostra 8 | Você pode anexar imagens nesta descrição pra nos mostrar o resultado, se for possível. 9 | -------------------------------------------------------------------------------- /README-EN.md: -------------------------------------------------------------------------------- 1 | [![Open Source Helpers](https://www.codetriage.com/juuh42dias/transervicos/badges/users.svg)](https://www.codetriage.com/juuh42dias/transervicos) 2 | 3 | Version in [PORTUGUESE](https://github.com/juuh42dias/transervicos/blob/master/README.md) 4 | 5 | # Transerviços 6 | This is a Rails 5.2.x application. 7 | 8 | # Documentation 9 | 10 | This README describes the goal of this repository and how to configure the development environment. There are also other documentation sources as follow: 11 | 12 | ## Pre conditions: 13 | ### Requirements: 14 | 15 | **Ruby 2.6.4**, preferably managed using [Rbenv](https://github.com/rbenv/rbenv) 16 | [PostgreSQL](https://www.digitalocean.com/community/tutorials/how-to-set-up-ruby-on-rails-with-postgres) must be installed and accepting connections. 17 | 18 | 19 | **Docker and Docker Compose (optional)** 20 | 21 | You can use [Docker](https://docs.docker.com/install/) and [Docker 22 | Compose](https://docs.docker.com/compose/install/) 23 | to run this project on development or test mode. 24 | 25 | If you need help to configure the Ruby development environment, consult this Rails OS X installation guide. 26 | 27 | # 28 | # Getting Started without Docker 29 | 30 | **bin/setup** 31 | Execute the bin/setup script. This script will: 32 | 33 | * Verify if the necessary Ruby version is installed 34 | * Install the gems using Bundler 35 | * Create local copies of `.env` and `database.yml` 36 | * Create, migrate and populate the database 37 | * Run! 38 | * Run the `bin/rake test` to guarantee that everything is working fine. 39 | * Run `bin/rake test:system` to execute every system tests. 40 | * Run `bin/rails` 41 | 42 | 43 | # Gettint Started with Docker 44 | 45 | After you have installed Docker and Docker Compose, run the commands below: 46 | 47 | * `docker-compose build` to create the Docker Images 48 | * `docker-compose run web bash` to open a `shell` inside the container with the 49 | application already setup 50 | 51 | 52 | Within this `shell` you must setup the application database before running other 53 | commands. To do so, run: `bin/setup` 54 | 55 | To run the application, run: 56 | 57 | `rails server -b 0.0.0.0` 58 | 59 | # Testing 60 | 61 | ## PENDING 62 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Open Source Helpers](https://www.codetriage.com/juuh42dias/transervicos/badges/users.svg)](https://www.codetriage.com/juuh42dias/transervicos) 2 | 3 | Version in [ENGLISH](https://github.com/juuh42dias/transervicos/blob/master/README-EN.md) 4 | 5 | # Transerviços 6 | Esta é uma aplicação Rails 5.2.x 7 | 8 | # Documentação 9 | 10 | Este README descreve o objetivo deste repositório e como configurar um ambiente de desenvolvimento. Outras fontes de documentação são as seguintes: 11 | 12 | ## Pré requisitos 13 | ### Este projeto requer: 14 | 15 | 16 | **Ruby 2.6.4**, preferencialmente gerenciado usando [Rbenv](https://github.com/rbenv/rbenv). 17 | [PostgreSQL](https://www.digitalocean.com/community/tutorials/how-to-set-up-ruby-on-rails-with-postgres) deve estar instalado e aceitando conexões. 18 | 19 | **Docker e Docker Compose (opcionais)** 20 | Uma alternativa para executar o projeto em modo de desenvolvimento e/ou testes é 21 | utilizar o [Docker](https://docs.docker.com/install/) com [Docker 22 | Compose](https://docs.docker.com/compose/install/). 23 | 24 | Se você precisar de ajuda para configurar um ambiente de desenvolvimento Ruby, consulte este Guia de instalação do Rails OS X. 25 | 26 | # Começando sem Docker 27 | 28 | **bin/setup** 29 | Execute o script bin/setup. Este script irá: 30 | 31 | * Verificar se você tem a versão necessária do Ruby 32 | * Instalar gemas usando o Bundler 33 | * Criar cópias locais de .env e database.yml 34 | * Criar, migrar e propagar/popular o banco de dados 35 | * Executá-lo! 36 | * Executar o teste bin/rake para garantir que tudo funcione. 37 | * Executar teste bin/rake: sistema para executar testes do sistema. 38 | * Execute bin/rails 39 | 40 | # Começando com Docker 41 | 42 | Com Docker e Docker Compose instalados, execute no diretório raíz do projeto: 43 | 44 | * `docker-compose build` para criar as imagens necessárias 45 | * `docker-compose run web bash` para acessar o `shell` do container já com a 46 | aplicação instalada 47 | 48 | Dentro desse `shell` você deve configurar o banco de dados antes de executar 49 | outros comandos. Para isso execute: 50 | 51 | `bin/setup` 52 | 53 | Para executar a aplicação, a partir do `shell` do Docker, execute: 54 | 55 | `rails server -b 0.0.0.0 ` 56 | 57 | 58 | # Executando o projeto de forma local 59 | 60 | Para executar o projeto de forma local, após executar o comando `bin/setup`, 61 | basta executar `rails server`. A aplicação estará disponível no endereço: 62 | `localhost:3000` em seu navegador. 63 | 64 | Caso você esteja utilizando Docker, basta executar `docker-compose up`. A aplicação estará disponível no endereço: 65 | `localhost:3000` em seu navegador. 66 | 67 | 68 | # Rodando testes 69 | 70 | ## PENDENTE 71 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Add your own tasks in files placed in lib/tasks ending in .rake, 4 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 5 | 6 | require_relative 'config/application' 7 | 8 | Rails.application.load_tasks 9 | -------------------------------------------------------------------------------- /app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../javascripts .js 3 | //= link_directory ../stylesheets .css 4 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juuh42dias/transervicos/a9247b1f516223720dc0389be5c79382d4796cf4/app/assets/images/.keep -------------------------------------------------------------------------------- /app/assets/images/brazil_flag.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 18 | 19 | 20 | 22 | 23 | 24 | 26 | 27 | 28 | 34 | 35 | 36 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /app/assets/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juuh42dias/transervicos/a9247b1f516223720dc0389be5c79382d4796cf4/app/assets/images/favicon.ico -------------------------------------------------------------------------------- /app/assets/images/header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juuh42dias/transervicos/a9247b1f516223720dc0389be5c79382d4796cf4/app/assets/images/header.jpg -------------------------------------------------------------------------------- /app/assets/images/ico-password.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juuh42dias/transervicos/a9247b1f516223720dc0389be5c79382d4796cf4/app/assets/images/ico-password.png -------------------------------------------------------------------------------- /app/assets/images/ico-user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juuh42dias/transervicos/a9247b1f516223720dc0389be5c79382d4796cf4/app/assets/images/ico-user.png -------------------------------------------------------------------------------- /app/assets/images/logo-mail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juuh42dias/transervicos/a9247b1f516223720dc0389be5c79382d4796cf4/app/assets/images/logo-mail.png -------------------------------------------------------------------------------- /app/assets/images/people_in_love.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 9 | 10 | 13 | 17 | 18 | 19 | 22 | 23 | 24 | 27 | 28 | 29 | 32 | 33 | 34 | 36 | 37 | 38 | 40 | 41 | 42 | 44 | 45 | 46 | 47 | 48 | 50 | 51 | 52 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 64 | 65 | 66 | 67 | 69 | 70 | 71 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /app/assets/images/preview-ribbon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juuh42dias/transervicos/a9247b1f516223720dc0389be5c79382d4796cf4/app/assets/images/preview-ribbon.png -------------------------------------------------------------------------------- /app/assets/images/scale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juuh42dias/transervicos/a9247b1f516223720dc0389be5c79382d4796cf4/app/assets/images/scale.png -------------------------------------------------------------------------------- /app/assets/images/scale.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 43 | 44 | 45 | 46 | 47 | 48 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /app/assets/images/test-ribbon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juuh42dias/transervicos/a9247b1f516223720dc0389be5c79382d4796cf4/app/assets/images/test-ribbon.png -------------------------------------------------------------------------------- /app/assets/images/transervicos-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juuh42dias/transervicos/a9247b1f516223720dc0389be5c79382d4796cf4/app/assets/images/transervicos-logo.png -------------------------------------------------------------------------------- /app/assets/images/transervicos-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 9 | 10 | 12 | 14 | 15 | 18 | 19 | 21 | 22 | 23 | 28 | 31 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into application.js, which will include all the files 2 | // listed below. 3 | // 4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's 5 | // vendor/assets/javascripts directory can be referenced here using a relative path. 6 | // 7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 8 | // compiled file. JavaScript code in this file should be added after the last require_* statement. 9 | // 10 | // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details 11 | // about supported directives. 12 | // 13 | 14 | //= require jquery 15 | //= require jquery.turbolinks 16 | //= require jquery_ujs 17 | //= require turbolinks 18 | //= require_tree . 19 | //= require bootstrap-sprockets 20 | //= require jasny-bootstrap.min 21 | //= require components/application 22 | 23 | (function($, window, document) { 24 | 'use strict'; 25 | 26 | $(function() { 27 | $('select[data-option-dependent=true]').each(function () { 28 | var _this = $(this); 29 | var subareaSelectId = _this.attr('id'); 30 | var areaSelectId = _this.data('option-observed'); 31 | var optionsDocumentUrl = _this.data('option-url'); 32 | var optionValue = _this.data('option-key-method'); 33 | var optionText = _this.data('option-value-method'); 34 | var subareaDefaultOption = _this.has('option[value=\'\']').size() ? _this.find('option[value=\'\']') : $('