ruby on rails - General advice and recommended folder structure - Sinatra -


how structure simple sinatra app?

i'm making right , want app have these features:

  1. the "app" more of admin dashboard information inside it. app access information via rest. have not created dashboard yet, getting of things database
  2. sessions , authentication (have not implemented yet)
  3. you can upload pictures, , other other app can display pictures
  4. i have created testing file using rspec
  5. reports generation via prawn

currently setup this:

app.rb test_app.rb 

because have literally app , testing file. far have used datamapper orm, sqlite database. first ruby/sinatra project, , advice welcome - other libraries should using, should put stuff config.ru, etc.

sinatra not opinionated when comes file structure, can place files like. when first started dropped in top level, on time reading how people structure code, reading on source code of gems i've broken code smaller .rb files fulfill specific function , places of them under /lib, it's convention carried on rails perhaps not have of magic associated in rails. if use scss or coffee script depend on folders exist, discover on time (and can reconfigure them wish) , figure out works best you.

if write restful api, check out grape - https://github.com/intridea/grape

you find sinatra-contrib useful - https://github.com/sinatra/sinatra-contrib

as config.ru - https://github.com/rack/rack/wiki/%28tutorial%29-rackup-howto


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -