Create architecture and integrate with rails