A ruby on rails custom ecommerce I maintain from 2013

On this post I am going to talk about my family eshop which is related to flowers. The url is fyta.gr and it is a custom eshop I created based on ruby on rails. The initial version was 3.2 and ruby 1.9.3.

I created this eshop as a motivation from Depot, the eshop demo from the ruby on rails core book and as a way to help my parents sell online. I still remember the first version which was built in two months of development without many features and then rails 4.0 came. I had to make a decision, either try to update from 3.2 to 4.0 or do something which is common in small codebases: Create a new rails app, transfer the app and any other configuration file. I went with the latter option, created another repository and started transfering parts. Thankfully It went well, but if I would do it now (and if you plan to do it), I would follow the update path and go one by one to see what changed.

All these years, I am adding some features here and there. Some features were: facebook integration with tabs, an auto-banner creation for affiliates, better statistics using chartkick, the ahoy gem for tracking actions and (surprise, surprise!) adding elasticsearch. That's the good and the bad thing when you have a toy project, you can try crazy things. I wanted to learn a bit more about elasticsearch so why not? Later, I found out the pain of manually indexing (yes dynamic indexing wasn't a thing back then) and that elasticsearch needed more than 2GB RAM to run smoothly. Only recently, I completely removed it and I felt good again. Adding external dependencies on a project has to be an absolute necessity, especially if you are going to maintain and update it for a long time.

From one side, it was my eshop so even if I destroyed accidentally something, I could take full responsibility and nobody else would got hurt other than me and my family business (and I wouldn't get fired). But on the other side, I was responsible for everything and I was the only developer. It is a big pain to be the only developer and having full responsibility for a project, even if it is a small one.

So, after all these years, I have managed to update the eshop to a viable rails version and try any idea I had in mind. I have learned that I should not add gems for js libraries (yes that was a common thing) and now I can appreciate how awesome turbo, the new way of rails 7. Of course I had to pass from sprockets to webpacker with super big node_modules and broken js packages but javascript's jenga tower is a story for another post.

Another thing I had to learn was the database architecture of an eshop. I had to look into eshop databases like on spree and solidus, woocommerce and even magento to see how they do it. After a lot of thinking, I created a specific simpler architecture for it which I am happy with to maintain. It's not only about how you store the carts, products, prototype-products, but it has to do on how you handle different promotion and coupons and how to store the transfer costs.

A flowershop is a very unique kind of eshop, it has many exceptions regarding the database, as flowers is a very unique type of product. You can't send it all over the world, the transfer is very demanding and difficult so you have to calculate it by khm. I had to manually create a khm calculator and do a research because if you want to send somewhere which you will pay toll fees, you have to calculate it extra. I also had to go in many other fields like advertising, listening customers and trying ecommerce features. It is a nice journey and I recommend you to create a toy project for yourself and try things.

The git repository of the project is a story by itself. You see how you wrote 8 years ago and how you are writing now. Everything is different, from the commit messages up to the code cleaness. So what's ahead for this eshop? I am going to update ti soon enough. I will add two languages, fix some parts here and there. We are preparing a new custom eshop on rails 7 with turbo, a much more elegant design and a new database architecture for having more product variants. This codebase hasn't been changed much the last 8.5 years but soon I'll have to do the migration and keep up with the SEO rules not to break anything. Thank you for reading so far, I'll keep up with the updates of the new eshop through this blog.
Max one mail per week.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.