architecture - How to organize a Rails App -
for first time i'm creating quite complex rails app.
i'd know what's best way organize app folders. until now, i'd under 1 app (all models, controllers, etc) reading open source code realize put under different apps.
like example spree commerce. have general folder , inside have different apps (api, core, admin, etc). how done , best way it?
i'd pointed best way (a book, blog, anything) can understand how can architect app future maintenance.
thank you
as aside think title of question little confusing. rails, using convention on configuration, defines 'how organise rails app'. think question rather how architect application opposed rails-specific. maybe tweak title?
that aside, without knowing more detail project it's tricky question answer, i'll give go.
all applications should start off simple, if believe (like do) should start building the simplest thing possibly work. given this, since you're using rails, in likelihood simplest thing structure app vanilla rails 3 application. (i 'probably' because don't know specifics app) allow beta version of app , running pretty without worrying complexities @ stage in development of project not problem.
if need create xml or json-based api rails makes really easy using standard framework, allow spend more time thinking api design how code it, , it's api design important thing right in first instance.
similarly, admin site can part of same app in different namespace. if find later down line want separate app, can (maybe use awesome api designed facilitate this), why bother designing added complexity (and hence extended development time) in first place if don't have reason doing so?
once have app , running , people starting use it, start picture of bottlenecks , design improved. @ stage, if there's need, can start move parts of app scalable solutions, such running api standalone service, introducing caching, changing data stores , other improvements , optimisations.
even if app wildly successful (and hope is!) re-architecting application whist continuing run existing service still entirely possible, twitter have proved. stick knuth's statement , you'll alright.
regarding reading material, that's tricky one. me lot of xp , agile development classics taught me huge amount how approach program , app design. i'd check this stackoverflow topic book inspiration.
good luck!
Comments
Post a Comment