I am building an application that should allow user to upload their themes to display the data in a custom way. Each theme should include all the necessary assets such as html template (using Liquid), css files, javascripts and images. The result should be very similar to what Shopify allow to do to their customers.
I am struggling to find the best way for the users to submit their themes and for the application to serve them back. Specifically, what are the best practices:
Thanks in advance.
The asset pipeline is primarily designed for serving fixed assets that are pre-compiled at deploy time. There is quite a lot of overhead in doing this, and I don't think it's suitable for serving dynamically editable content.
To attack this problem I would make a list of matrix of all the asset types on the system (user and static) and what the options are for each.
Next to each write possible storage options, e.g. filesystem raw, filesystem pipeline, database. Then work out the pros and cons for each approach, and the approximate complexity of each.
I don't think using the pipeline for this would be a best-practice unless you are really, really concerned about front-end performance; it would be a lot of work to get it going.
A mix of database/filesystem would probably be optimal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With