ruby on rails - General advice and recommended folder structure - Sinatra -
how structure simple sinatra app?
i'm making right , want app have these features:
- the "app" more of admin dashboard information inside it. app access information via rest. have not created dashboard yet, getting of things database
- sessions , authentication (have not implemented yet)
- you can upload pictures, , other other app can display pictures
- i have created testing file using rspec
- 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
Post a Comment