• Stars
    star
    156
  • Rank 239,589 (Top 5 %)
  • Language
    Ruby
  • Created over 13 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Skeleton of a Sinatra app. it helps me to organize my code.

This is the source code for the sinatra-template project on github.
It's the basic structure I use for my Sinatra projects and it make things a bit more organized.

What's inside?

  • Modular Sinatra app version 1.3.2 using ruby 1.9.3-p125
  • minitest for unit-level tests
  • rack-test for routes tests
  • capybara + minitest for integration tests (no need for rspec)
  • yard for documentation
  • Rakefile, Gemfile, .rvmrc, .gitignore

Folders Structure

app.rb         # require sinatra, vendor'd gems, models/init, routes/init, helpers/init

helpers/         
  init.rb      # Require each helper file
  helper1.rb   # Related helper methods

models/          
  init.rb      # Require each model, in controlled order
  user.rb      # model
  picture.rb   # model

routes/          
  init.rb      # Require each route, in controlled order
  user.rb      # One or more routes related to some feature
  admin.rb     # One or more routes related to administration

views/
  layout.erb   # Common layout
  index.erb    # Specific view

test/         
  models       # minitest
  routes       # rack-test
  acceptance  # capybara + minitest

Setup

Install Ruby 1.9.3 (if necessary). RVM is optional, but highly recommended

rvm install ruby-1.9.3-p125
git clone https://github.com/oren/sinatra-template.git
cd sinatra-template (it will create sinatra-template gemset)

Install QT (needed for capybara-webkit)

Install bundler

gem install bundler

Install the gems

bundle install --without production staging

View all available rake commands

rake -T

rake                  # Run all tests
rake test:acceptance  # Run acceptance tests
rake test:models      # Run models tests
rake test:routes      # Run routes tests
rake yard             # Generate YARD Documentation

Run the server

shotgun

Go to http://127.0.0.1:9393

More Repositories

1

docker-cordova

Docker container for Cordova development
97
star
2

node-website-template

Template for node.js website - fast, modular and not using frameworks
CSS
91
star
3

alpine-nginx

Minimalist Nginx image based on Alpine linux (6 MB)
Nginx
64
star
4

docker-nativescript

NativeScript in Docker
40
star
5

pokemon

Evolving Graphs and Pokemon
Go
22
star
6

pwa-talk

Presentation at WebDevCon 2017 in Berlin
JavaScript
11
star
7

multi-sites

splitting a big website into smaller sites
JavaScript
10
star
8

eliza-bot

JavasScript bot based on Eliza
JavaScript
9
star
9

cayley-postgres

8
star
10

mithril-frp

Integrate FRP with Mithril using kefir.js
JavaScript
8
star
11

titan

Getting started with Titan Database and Node.js
Shell
5
star
12

docker-crash-course

Docker crash course
HTML
4
star
13

user

Go
4
star
14

cayley-classes

Classes for teaching of Cayley Database
4
star
15

cayley-docs

Go
4
star
16

digital-ocean

Docker image for provisioning a Digital Ocean Server
Vim Script
3
star
17

angular.js-presentation

Angular.js presentation
JavaScript
3
star
18

svelte-router-example

HTML
3
star
19

oren.github.io

HTML
3
star
20

node.js-presentation

node.js - ignite style presentation
JavaScript
3
star
21

alpine-ansible

Ansible Docker Image based on Alpine Linux (266 MB)
Shell
3
star
22

alpine-iojs

Minimalist io.js Docker Image (22 MB) based on Alpine Linux
JavaScript
3
star
23

configs

configs
Vim Script
2
star
24

sinatra-examples

Demonstrating different features of Sinatra
Ruby
2
star
25

anvil-connect-docker

anvil-connect on docker
HTML
2
star
26

deno-examples

TypeScript
2
star
27

adventure-time

2
star
28

domains-examples

Examples for using domains
JavaScript
2
star
29

modular-client-side

Modular approach for building client-side Javascript application
JavaScript
2
star
30

hello-flatbuffers

Tutorial: Use FlatBuffers in Go
Go
2
star
31

wiki

DokuWiki with Docker
Shell
2
star
32

mithril-examples

JavaScript
2
star
33

cayley-tutorial

Book for the open-source Cayley graph database
2
star
34

manage-keys

Manage ssh keys with ansible
1
star
35

javascript-best-practices

1
star
36

convox-example-go

Go app configured for Convox
Go
1
star
37

redux-starter

JavaScript
1
star
38

ballerina

Ballerina
1
star
39

aws-solution-architect-associate

JavaScript
1
star
40

jingjs-talk

my talk from jingjs.org conference
JavaScript
1
star
41

mean-drone

JavaScript
1
star
42

adventure-graphs

Introduction to Graph Databases
HTML
1
star
43

standard-package-layout

Go web service modeled after the Standard Package Layout
Go
1
star
44

elm-tutorial

Elm
1
star
45

orientdb-in-docker

Dockerized orientDB
Shell
1
star
46

search

Go
1
star
47

push-notification

Apple and Android push notification service
JavaScript
1
star
48

groups

Google Groups clone using LevelDB.
JavaScript
1
star
49

LOUDBOT

Get random tweet from @LOUDBOT
JavaScript
1
star
50

react-tutorial

JavaScript
1
star
51

clean-js

how to organize javascript code
JavaScript
1
star
52

nats-demo

Demo of NATS - a messaging system for distributed systems
Go
1
star
53

mycroft-web

Python
1
star
54

docker-ionic

1
star
55

hugo-blog

Hugo using docker
CSS
1
star
56

dotfiles

dotfiles
Vim Script
1
star
57

titan-gremlin-client

reproducing an error with gremlin-client
Shell
1
star
58

lwes-emitter

Emitting LWES events in Node.js
JavaScript
1
star
59

crystal-examples

Crystal
1
star
60

nginx-node

nginx and node.js in the same container
Nginx
1
star
61

npm-talk

NPM Presentation
JavaScript
1
star
62

embed-cayley

Go
1
star
63

website-generator

Static Site Generator
Crystal
1
star
64

weighmyplate

fast, intuitive and mobile friendly calorie counting
JavaScript
1
star
65

modular-express

JavaScript
1
star