{"id":13777256,"url":"https://github.com/Wixel/Frank-Sinatra","last_synced_at":"2025-05-11T11:33:04.118Z","repository":{"id":8640741,"uuid":"10289461","full_name":"Wixel/Frank-Sinatra","owner":"Wixel","description":"A boilerplate for modular MVC style Sinatra (1.4.2^) applications. ","archived":false,"fork":false,"pushed_at":"2014-07-07T13:36:06.000Z","size":251,"stargazers_count":51,"open_issues_count":0,"forks_count":10,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-22T03:25:11.654Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Wixel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-25T20:31:48.000Z","updated_at":"2023-10-27T15:47:49.000Z","dependencies_parsed_at":"2022-08-22T10:00:27.040Z","dependency_job_id":null,"html_url":"https://github.com/Wixel/Frank-Sinatra","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/Wixel%2FFrank-Sinatra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wixel%2FFrank-Sinatra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wixel%2FFrank-Sinatra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wixel%2FFrank-Sinatra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Wixel","download_url":"https://codeload.github.com/Wixel/Frank-Sinatra/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225043077,"owners_count":17411925,"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":[],"created_at":"2024-08-03T18:00:40.473Z","updated_at":"2024-11-17T13:30:34.672Z","avatar_url":"https://github.com/Wixel.png","language":"CSS","funding_links":[],"categories":["Boilerplate and Template"],"sub_categories":[],"readme":"# Hello, Frank - Sinatra\n\nA simplistic, modular-MVC style [Sinatra](http://www.sinatrarb.com/) boilerplate for rapid application prototyping. A blazingly fast way to get your app up and running in no time (most batteries included). Deployment to [Heroku](http://heroku.com) is painless too, that helps.\n\nThe is a starting point and is by no means a complete application. You should be able to use this to kick the fire for your own applications relatively fast. We use this over at [Wixel](http://wixelhq.com) for fast prototyping. \n\nI assume you have Git installed and understand how to use it via the command line. HTML5 Boilerplate has been included by default to help you speed up your front-end creation.\n\n## Installation ##\n\n### Requirements ###\n\n  * [Ruby](http://www.ruby-lang.org/) 1.9.2 and up\n  * [Rubygems](http://rubygems.org/)\n  * [Git](http://git-scm.com/)\n  * [Bundler](http://rubygems.org/gems/bundler)\n\n### Clone from Github ###\n\n    $ git clone https://github.com/Wixel/Frank-Sinatra.git \u003cyour app name\u003e\n    $ cd \u003cyour app name\u003e\n    \n### Install Required Gems ###\n\nTo check your dependencies and install, type:\n\n\t$ bundle check\n    $ bundle install\n\nThis will install all the dependencies and create the Gemfile.lock file. This process could take some time to complete. \n\n### Running Locally ###\n\nWhen running locally, a sqlite3 database file will be created in the /db directory. \n\nTo start up your application using shotgun, type:\n\n\t$ shotgun\n\nThe shotgun command will dynamically load and reload your application code when you change things. You can now access your app at: [http://localhost:9393](http://localhost:9393)\n\nTo start up your application using rackup, type:\n\n\t$ rackup\n\t\nThe rackup command will load your app once and not reload each time you change code. You can access your app at: [http://localhost:9292](http://localhost:9292)\n\nYou can also start your app using [Foreman](https://github.com/ddollar/foreman) as follows:\n\n\t$ foreman start\n\t\nYou can now access your app at [http://localhost:5000](http://localhost:5000)\n\n#### Installed Components ####\n\t\n  * [Rack](http://rack.github.io/)\n  * [Sinatra 1.4.3](http://www.sinatrarb.com/)\n  * [Builder](https://github.com/jimweirich/builder)\n  * [Sqlite3](https://github.com/luislavena/sqlite3-ruby)\n  * [BSON](http://bsonspec.org/)\n  * [Sinatra-flash](https://github.com/SFEley/sinatra-flash)\n  * [Logger](https://github.com/nahi/logger)\n  * [Pony](https://github.com/benprew/pony)\n  * [Omniauth](https://github.com/intridea/omniauth)\n  * [Mime-types](http://mime-types.rubyforge.org/)\n  * [Fog](http://fog.io/)\n  * [Will Paginate](https://github.com/mislav/will_paginate)\n  * [Data Mapper](http://datamapper.org/)\n  * [Awesome Print](https://github.com/michaeldv/awesome_print)\n  * [Shotgun](https://github.com/rtomayko/shotgun) \n  * [Foreman](https://github.com/ddollar/foreman)\n  * [Cucumber](http://cukes.info/)\n  * [Resque](https://github.com/resque/resque)\n\nFeel free to add and remove from your Gemfile as needed.\n\n## Usage \u0026 Modifying ##\n\n### General Setup ###\n\nBefore running your application successfully, you will need to do the following:\n\n1) Create a session cookie secret (app.rb - line 13):\n  \n\t$ use Rack::Session::Cookie, :secret =\u003e \"random string here\" \n\t\n2) Define your database and runtime settings:\n\n\tFile: config/database.yaml\n\tFile: config/development.yaml\n\tFile: config/production.yaml\n\t\nYour database defaults to sqlite3 until you manually change the Adapter setting in `database.yaml`\n\n### Databases/Models ###\n\nYou can use any database abstraction layer, but we prefer [DataMapper](http://datamapper.org/) and we'll use it by default in Frank-Sinatra. \n\nIf you've come this far, DataMapper should already be installed along side your project (`bundle install`). \n\nYou define models in the `models` directory. We've created one called `user.rb` for demonstration purposes. \n\nRead more about DataMapper in their [excellent documentation](http://datamapper.org/docs/).\n\nHere's an example of a very simple User model (yes, it's that simple):\n\n\tclass User\n    \tinclude DataMapper::Resource\n\t    property :id, Serial\n\t    property :name, String\n\t    property :email, Text\n\t    property :password, Text    \n\t    property :created_at, DateTime\n\tend\n\n##### Trouble installing dm-mysql-adapter? #####\n\nYou probably need to install MySQL. You can try one of the following options:\n\nWith MacPorts:\n\n\t$ sudo port install mysql5\n\t\nWith RPM:\n\n\t$ sudo yum install mysql-devel\n\t\nWith Homebrew:\n\n\t$ brew install mysql\n\t\n##### Working with PostgreSQL #####\n\nIf you have chosen PostgreSQL as your database backend and you use OS-X, I highly recommend that you take a look at [PostgresApp](postgresapp.com).\n\nUncomment the `gem dm-postgres-adapter` line in your Gemfile and set your database access credentials in `config/database.yaml`.\n\nYou also need to change the adapter setting to `adapter:postgres` in the above mentioned database config.\n\n### Controllers ###\n\nYour controllers are simply extending your base App class. Controllers do not reserve specific urls segments. \n\nBest practice is to prepend your mount-point with the logical controller-\u003eurl namespace as follows:\n\t\nauth.rb mounts to '/auth/ using:\n\n\tclass App \u003c Sinatra::Base\t\n\t\tget '/auth/login' do\n\t\t\terb :login\n\t\tend\n\t\tpost '/auth/login' do\n\t\t\t# Perform login action\n\t\tend\n\tend\n\nGoing to http://host/auth/login renders controllers -\u003e auth.rb\n\n### Helpers ###\n\nHelpers are simple [Sinatra Helpers](http://www.sinatrarb.com/intro.html#Helpers) defined in external files for separation.\n\n### Views ###\n\nViews are simple Sinatra views. You can use any rendering engine as per usual.\n\n## Deploying to Heroku ##\n\n[Sign up](https://api.heroku.com/signup/devcenter) for your Heroku account (if you don't have one already).\n\nThen go ahead and install the [Heroku Toolbelt](https://toolbelt.heroku.com/), a CLI tool used to manage your applications.\n\n#### Login to Heroku CLI ####\n\nLog in to your Heroku account via the CLI toolbelt:\n\n\t$ heroku login\n\tEnter your Heroku credentials.\n\tEmail: you@you.com\n\tPassword:\n\tCould not find an existing public key.\n\tWould you like to generate one? [Yn] \n\tGenerating new SSH public key\n\tUploading ssh public key /Users/adam/.ssh/id_rsa.pub\n\t\n#### Create your Heroku app ####\n\n\t$ heroku create\n\tCreating blazing-galaxy-997... done, stack is cedar\n\thttp://blazing-galaxy-997.herokuapp.com/ | git@heroku.com:blazing-galaxy-997.git\n\tGit remote heroku added\n\t\n### Deploy your code to Heroku ###\n\n\t$ git push heroku master\n\t\n\tCounting objects: 6, done.\n\tDelta compression using up to 4 threads.\n\tCompressing objects: 100% (5/5), done.\n\tWriting objects: 100% (6/6), 660 bytes, done.\n\tTotal 6 (delta 0), reused 0 (delta 0)\n\t\n\t-----\u003e Heroku receiving push\n\t-----\u003e Ruby app detected\n\t-----\u003e Installing dependencies using Bundler version 1.1\n\t       Checking for unresolved dependencies.\n\t       Unresolved dependencies detected.\n\t       Running: bundle install --without development:test --path vendor/bundle --deployment\n\t       Fetching source index for https://rubygems.org/\n\t       Installing rack (1.2.2)\n\t       Installing tilt (1.3)\n\t       Installing sinatra (1.1.0)\n\t       Using bundler (1.1)\n\t       Your bundle is complete! It was installed into ./vendor/bundle\n\t-----\u003e Discovering process types\n\t       Procfile declares types -\u003e web\n\t       Default types for Ruby  -\u003e console, rake\n\t-----\u003e Compiled slug size is 6.3MB\n\t-----\u003e Launching... done, v4\n\t       http://blazing-galaxy-997.herokuapp.com deployed to Heroku\n\t\n\tTo git@heroku.com:blazing-galaxy-997.git\n\t * [new branch]      master -\u003e master\n\n#### Visit your app online ####\n\n\t$ heroku open\n\n#### Keep an eye on the logs ####\n\n\t$ heroku logs\n\nYou can find more info on the official [Heroku Dev Center](https://devcenter.heroku.com/articles/ruby) page.\n\n# TODO #\n\n* Integrating test coverage or a template to build test from\n* Wire up some of the other Gems to show how they can be used\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWixel%2FFrank-Sinatra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FWixel%2FFrank-Sinatra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWixel%2FFrank-Sinatra/lists"}