All Projects → alebian → sinatra-bootstrap

alebian / sinatra-bootstrap

Licence: other
My opinionated Sinatra base application

Programming Languages

ruby
36898 projects - #4 most used programming language
Makefile
30231 projects
Dockerfile
14818 projects
shell
77523 projects

Projects that are alternatives of or similar to sinatra-bootstrap

Pluck to hash
Extend ActiveRecord pluck to return array of hashes
Stars: ✭ 275 (+1864.29%)
Mutual labels:  activerecord, sinatra
sinatra-dev-cheatsheet
A quick-and-dirty cheat sheet for creating HTML/CSS websites, and developing using Sinatra and ActiveRecord.
Stars: ✭ 44 (+214.29%)
Mutual labels:  activerecord, sinatra
rails async migrations
Asynchronous support for ActiveRecord::Migration
Stars: ✭ 56 (+300%)
Mutual labels:  sidekiq, activerecord
sinatras-skeleton
Basic Sinatra Skeleton MVC CRUD App with Sprockets, Warden, ActiveRecord and PostgresQL
Stars: ✭ 13 (-7.14%)
Mutual labels:  activerecord, sinatra
raygun4ruby
The Ruby & Ruby on Rails provider for Raygun
Stars: ✭ 37 (+164.29%)
Mutual labels:  sidekiq, sinatra
Ansible Rails
Ruby on Rails deployment using Ansible - with Lets Encrypt, Sidekiq, PostgreSQL, nginx & puma
Stars: ✭ 199 (+1321.43%)
Mutual labels:  sidekiq
sql-builder
A simple SQL builder for generate SQL for non-ActiveRecord supports databases
Stars: ✭ 34 (+142.86%)
Mutual labels:  activerecord
Sidekiq status
Extension to Sidekiq to pass job execution metadata such as status and result back to the client
Stars: ✭ 155 (+1007.14%)
Mutual labels:  sidekiq
Sidekiq
Simple, efficient background processing for Ruby
Stars: ✭ 11,450 (+81685.71%)
Mutual labels:  sidekiq
activerecord-debug errors
An extension of activerecord to display useful debug logs on errors
Stars: ✭ 23 (+64.29%)
Mutual labels:  activerecord
embedded
Rails/Activerecord plugin to make value objects embedded into active record objects
Stars: ✭ 48 (+242.86%)
Mutual labels:  activerecord
jpl-space-calendar
An app for parsing and publishing the JPL Space Calendar in JSON and ICalendar formats.
Stars: ✭ 13 (-7.14%)
Mutual labels:  sinatra
Sidekiq monitor
Advanced monitoring for Sidekiq
Stars: ✭ 220 (+1471.43%)
Mutual labels:  sidekiq
taskinator
A simple orchestration library for running complex processes or workflows in Ruby
Stars: ✭ 25 (+78.57%)
Mutual labels:  sidekiq
Limestone
Boilerplate Rails 6 SaaS application with Webpack, Stimulus and Docker integration.
Stars: ✭ 191 (+1264.29%)
Mutual labels:  sidekiq
yii2-activerecord-inheritance
ActiveRecord Inheritance is an util to provide the Class Table Inheritance Pattern the to the Yii2 framework
Stars: ✭ 18 (+28.57%)
Mutual labels:  activerecord
Activejob Retry
Automatic retries for ActiveJob
Stars: ✭ 138 (+885.71%)
Mutual labels:  sidekiq
fp-sin
Simple Sinatra shell with all the goodies.
Stars: ✭ 13 (-7.14%)
Mutual labels:  sinatra
0pdd
Puzzle Driven Development (PDD) Chatbot Assistant for Your GitHub Repositories
Stars: ✭ 108 (+671.43%)
Mutual labels:  sinatra
query-objects-example
Example of rails app using Query Objects
Stars: ✭ 37 (+164.29%)
Mutual labels:  activerecord

Sinatra bootstrap

This is an opinionated Sinatra application with conventions similar to Rails. What includes:

  • ActiveRecord
  • Sidekiq

Executables

In the bin folder there are scripts that let you:

  • Start a cosole: bin/console
  • Start the webapp: bin/webapp
  • Start workers: bin/workers

Also the repo contains a Makefile with all you need.

Database

The app is configured to use Postgres by default, you can check and change the configuration in the config/database.yml file.

If you don't want to use a database, you can remove the related dependencies (sinatra-activerecord, pg and pagy) and its usages.

Connection pool

The connection pool is configured in the activerecord initializer and uses an environment variable named DATABASE_CONNECTION_POOL.

Commands

Sinatra activerecord provides rake commands to perform database actions like Rails does.

Create migration

For example, to create a new migration you can run: bundle exec rake db:create_migration NAME=migration_name

Webserver

This app uses puma as the webserver which you can configure with environment variables: PUMA_WORKERS, PUMA_THREADS, WEBSERVER_PORT.

CORS

This app uses the rack-cors gem to provide cross domain access. You can configure this further in the config.ru file.

Application

All your business logic and domain classes are intended to live in the lib folder. In this base application you have a User model example and not much more.

Boot

All your classes are loaded using the require_all gem inside the lib/boot.rb file. You can require any other dependency you need in that file.

Secrets

One thing that I like is to use environment variables for secrets (they are defined in config/secrets.yml like Rails) and raise an exception if there is one missing (how many times have you deployed an application and forgot to set an env variable?). For this I created a class called Application which handles all of that and has some other configuration like the logger.

You can use your secrets like: Application.secrets.redis_url.

Web application

Sidekiq

The Sidekiq configuration is pretty much the default in this repo. The config files are located in config/sidekiq.yml and lib/initializers/sidekiq.rb.

Web UI

The Sidekiq's web UI is loaded in /sidekiq using basic authentication. You can change this in the config.ru file. The environment variables to set user and password are SIDEKIQ_AUTH_USER and SIDEKIQ_AUTH_PASS respectively.

Docker

Docker configuration is provided and you can run the entire application using: docker-compose up.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].