Jasis is a Docker-based Sinatra starter kit w/ Postgres and Sequel support
Ruby Shell Other
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin added tasks folder for rake, and updated docker compose files to wait… Mar 28, 2018
controllers added bridge networking mode for production to accomodate docker-comp… Apr 2, 2018
db added encrypted password to user Mar 26, 2018
emails added email support, added liquid templating to emails, moved app.rb … Mar 25, 2018
lib added tasks folder for rake, and updated docker compose files to wait… Mar 28, 2018
log unignore log Mar 19, 2018
models added encrypted password to user Mar 26, 2018
spec initial commit Mar 19, 2018
tmp modular version Mar 20, 2018
views removed redis and added omniauth Mar 22, 2018
.env added bridge networking mode for production to accomodate docker-comp… Apr 2, 2018
.gitignore updated gitignore Mar 28, 2018
.rspec initial commit Mar 19, 2018
Dockerfile initial commit Mar 19, 2018
Gemfile updated mailer to support erb and liquid Mar 27, 2018
Gemfile.lock added tasks folder for rake, and updated docker compose files to wait… Mar 28, 2018
LICENSE Create LICENSE Apr 1, 2018
README.md Update README.md Apr 3, 2018
Rakefile added tasks folder for rake, and updated docker compose files to wait… Mar 28, 2018
app.rb updated mailer to support erb and liquid Mar 27, 2018
boot.rb enabling sql literal strings Mar 31, 2018
config.ru removed redis and added omniauth Mar 22, 2018
docker-compose.live.yml added bridge networking mode for production to accomodate docker-comp… Apr 2, 2018
docker-compose.yml added tasks folder for rake, and updated docker compose files to wait… Mar 28, 2018
passenger.3000.pid.lock initial commit Mar 19, 2018

README.md

Ruby Starter Framework

Jasis is an eloquent Ruby framework, that provides you a nice boilerplate code to get you started developing websites as quickly as possible. It was inspired heavily by Padrino, but it takes it a notch further in terms of simplification by keeping Sinatra to it's core as much as possible. You won't see any Jasis library here, it will be just several Ruby gems put together on top of the Sinatra framework.

What is Jasis?

  1. 100% Docker-based for easy setup and deployment
  2. Explicit by design, no more black magic, know how everything gets loaded
  3. Minimal to the core (less files, less codes)
  4. Stupidly simple (no crazy class hierchy, just plain simple approach)
  5. Faster and lighter, up to 30% ~ 40% faster than Rails

Setup

Jasis is developed to work within the following requirements:

  • docker and docker-compose
  • jwilder/nginx-proxy Docker image running listening on port 80
  • dnsmasq w/ .docker extensions mapped to your docker machine's ip address

Having this allows you to virtual host any sites through Docker with a .docker domain extension (ie; http://jasis.docker). This means no more fiddling with port numbers and updating your hosts file to point to them.

Therefore, I recommend the following.

For OSX:

For Ubuntu:

Install

  1. git clone https://github.com/jaequery/jasis
  2. cd jasis
  3. docker-compose up -d
  4. your site should now show up on http://jasis.docker (update VIRTUAL_HOST from docker-compose.yml)

Checklist

  • setup sinatra modular structure with sequel / postgres
  • add Docker support
  • add migrations
  • add seeds
  • add email w/ template support
  • add bettererrors
  • add db export, db import sh scripts
  • add deploy script
  • add contact us
  • add admin
  • add blog
  • add shop
  • add forum

Some of the essential features that makes Jasis great!

error debugging with bettererrors

screenshot

dotenv for dev / production environment variables

To set environmental variables depending on your environment, we used dotenv. You simply place a .env file at the root of the app folder.

.env (base) .env.development .env.production

Within it, you can simply have:

TWITTER_KEY=xxxxx
TWITTER_SECRET=xxxxx

And you would call it from your app using:

ENV['TWITTER_KEY']

Send Emails

  1. Configure your SMTP settings from the .env file
  2. Call the email() helper function within the controllers

Standard Email

email({:from => 'me@email.com', :to => 'user@email.com', :subject => 'hi', :body => 'Hello'})

Email through a liquid file

email({:to => 'user@email.com', :subject => 'hi'}, {:file => "emails/welcome.liquid", :data => {'name' => 'john'} })