{"id":18783597,"url":"https://github.com/cimon-io/billet","last_synced_at":"2025-07-04T10:32:45.355Z","repository":{"id":32911728,"uuid":"36506921","full_name":"cimon-io/billet","owner":"cimon-io","description":"scratch rails app using best practices","archived":false,"fork":false,"pushed_at":"2023-03-08T19:45:00.000Z","size":3155,"stargazers_count":7,"open_issues_count":9,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-13T12:11:40.216Z","etag":null,"topics":["billet","rails","ruby","scaffold"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cimon-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-29T13:47:14.000Z","updated_at":"2021-10-31T08:19:30.000Z","dependencies_parsed_at":"2024-11-07T20:42:41.336Z","dependency_job_id":"bb2fd04d-ac00-4009-b275-0a12fa11e963","html_url":"https://github.com/cimon-io/billet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cimon-io%2Fbillet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cimon-io%2Fbillet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cimon-io%2Fbillet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cimon-io%2Fbillet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cimon-io","download_url":"https://codeload.github.com/cimon-io/billet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710450,"owners_count":21149191,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["billet","rails","ruby","scaffold"],"created_at":"2024-11-07T20:39:51.238Z","updated_at":"2025-04-13T12:11:41.803Z","avatar_url":"https://github.com/cimon-io.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/cimon-io/billet.svg?branch=master)](https://travis-ci.org/cimon-io/billet)\n\n# Billet\n\n## How to use it.\n\n### Initialize repo\n - Remove existing `.git` folder via `rm -rf .git`\n - Initiate new repo via `git init`\n - Add and commit all files `git add .` and `git commit -m \"Initial import from billet\"`\n - Add remote repository: `git remote add origin REPO_URL`\n - Push the repo `git push -u origin master`\n\n### Rename application\n - Rename module application in `config/application.rb`\n - Rename name of module in constand definition `config/initializers/uptime.rb`\n - Rename default database for development and test in `config/database.yml`\n - Rename all names of containers and variales in `docker-compose.yml`\n - Rename name of session store in `config/initializers/session_store.rb`\n\n### Various configs\n - Rename application and and other project based config values in `config/settings.yml`\n - Rename application in the header of `README.md`\n - Add description to the 'Synopsis' section\n - Change production domain in 'Synopsis' section\n\n### Database seeding\n - Edit `db/seed.rb` to fill database automaticaly (especially email of single user)\n\n### Remove this documentation\n - This documentation is not required for your project, thus just remove section 'How to use it'\n\n# Synopsis\n*Describe your project here*\n\n* Production site: https://billet.dev\n\n## Initial setup\n\n - Install required ruby version. The actual one can be found in `./.ruby-version`. Now it is `3.0.2`.\n - Install nodejs version. The actual one can be found in `./assets/.node-version`. Now it is `17.0.1`.\n - Install `yarn` package manager.\n\nInstall another dependencies from `Brewfile` via\n\n```console\n$ brew bundle\n```\n\nInstall required libraries from `Gemfile` via\n\n```console\n$ bundle\n```\n\nRun database setup. This will set up the database and populate it with initial data.\n\n```console\n$ bin/rake db:create db:migrate db:seed\n```\n\n## Run application\n\nForeman is able to run everything whats needed via single command. Check `Procfile` to read more:\n\n```console\nforeman start\n```\n\nIt runs the following processes:\n\n 1. `web`. The http server. It can be run separately via command `bin/rails s -b 0.0.0.0`\n 1. `worker`. The background job processor. Run it separately via command `bin/sidekiq -C config/sidekiq.yml`\n 1. `rpc`. The part of anycable. Separate command is `bin/anycable`\n 1. `ws`. The part of anycable. It is separate binary which can be run as `anycable-go --host=localhost --port=3334 -headers=cookie,Authorization,origin`\n\n`lvh.me` is the default domain, configured in example\nconfiguration files. Use `lvh.me:3000` and its subdomains\nto access the application in development.\n\nThat's it.\n\n## Run tests\n\n* Make sure you've run `bin/rake db:migrate RAILS_ENV=test`\n* Running `bin/rake` will run unit tests, then, if all pass, run acceptance\n  tests\n* We do unit testing with rspec. To run just unit tests run `bin/rake spec`.\n  To run a single one, run `bin/rspec spec/path/to/spec.rb`.\n* To run rubocop, just `bin/rubocop`. Do not forget to do it before commit.\n* `bin/brakeman` checks code for security vulnerabilities.\n* `bin/bundle audit check --update` checks public known vulnerabilities in the libraries.\n\n## Framework changes\n\nThere are several fundamental changes and concepts were applied to the framework. Some of them work well in a vanilla Ruby on Rails application, but it is not customary to use it by default.\n\n### Rails Engines\n\nAn application is split by engines by on controllers level only. All models should be left in `app/models`. To generate new engine use namespace generator via command `bin/rails generate namespace NamespaceName`. There are several config options available.\n\n - `--begin_chain current_company`. All resource controllers starts chaining with a root method where everything should be available. For example class Company has many projects, thus `current_company.projects` will be called in controller `projects_controller`.\n - `--access cancan` with options `fake`, `cancan`, `http` and `none`\n -  `--route prefix` to change route prefix where engine will be available. By default it is lowercased underscored namespace name.\n - `--api false` (or `true`). A namespace will be optimised for api only if it's `true`.\n\n### Webpack Assets\n\nhttps://github.com/cimon-io/billet-isolated-assets\n\n### Application Settings\n\nAll configuration variables should be stored in the `config/settings.yml` file via `config` gem. Also it should define ENV variables to rewrite defaults.\n\n### Initializers\n\nAll initializers have been split by 4 subfolders: `core`, `libs`, `concerns` and `monkeypatches`.\n\n - `core` folder contains rails initializers.\n - `libs` folders is for libraries and gems configuration and initializations.\n - `concerns` content patches and includes are `ActiveRecord::Base` and other base classes of rails.\n - `monkeypatches` folder contains the hard patches of ruby core, rails libraries and other low level libraries.\n\n ### Monkeypatches\n\n- `action_view_assets_url_helper.rb` patches the `AssetUrlHelper` and it needs for new `assets` to find resources for `image_url` and other helpers.\n- `active_record_database_statements.rb` patches ActiveRecord and it allows to use `RETURNING` statement to define postgresql procedures.\n\n### Seed Loader\n\n\n### Database Structure\n\n\n### Database connection configuration\n\n`DATABASE_URL`, `TEST_ENV_NUMBER`, `DATABASE_POOL`\n\n### Secrets Encryption\n\n### RETURNING method in SQL\n\n#### `created_at` and `updated_at`\n\n\n#### `_count` field\n\n\n#### Belongs directly to\n\n\n### Redis configuration\n\n### Sidekiq tuning\n\n\n### Attribute Normalizers\n\n### Glipper as Decorator\n\n`glipper` and `drappers`\n\n### Unobtrusive Controllers\n\n`unobtrusive_resources` with pagination\n\n### Mute Action\n\n`mute_action`\n\n### Attribute accessor with default value\n\n`attr_accessor_with_default`\n\n### Prevent destroying records\n\n`deny_destroy`\n\n### Boolean checks on ActiveRecord level\n\n`true?(value)`\n\n### I18n\n\n#### Pluralization\n\n`plur`\n\n#### Translation with lookup\n\n`t` and `th`\n\n#### Attribute Name\n\n`display_attribute` and `human_attribute_name`\n\n### Helpers\n\n#### `data-link` attribute\n\n`datalink` and `datalink_if`\n\n#### Meta tags\n\ncontroller method `meta_for` and helper `page_meta_for`\n\n#### Flash\n\n - `flash_styleclass`\n - do not render flash if xhr\n\n#### Escape Javascript Alias\n\n`e`\n\n#### Number to Percentage\n\n`custom_number_to_percentage` with alias `ntp`\n\n#### HTML DOM helpers\n\n##### `collection_class`\n##### `dom_id`\n##### `dom_klass`\n##### `css_id`\n\n##### Markdown helpers\n\n`markdown_to_html`, `markdown_to_html_if` and `md`\n\n#### Smart Sentence\n\n`smart_sentence`\n\n#### Smart Sanitize\n\n`smart_sanitize` and `should_sanitized?`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcimon-io%2Fbillet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcimon-io%2Fbillet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcimon-io%2Fbillet/lists"}