This week we further developed the e-commerce site with more core functionalities, including adding shopping cart, checkout order formation, order management, and deploying project onto Heroku.
This is by far the most complex project compare to the previous projects. I now have 7 models, 8 controllers, a mailer, an uploader, and vendor CSS files.
Some of the key learning this week came from being able to debug our code. I found
gem pry to be an extremely helpful tool to accomplish this. By entering the error code line-by-line, I can pinpoint exactly which line contains the error, and by trying variations of the code in console, I can figure out exactly what works. Pry has been the most powerful tool I've found in this class so far.
On the other hand, Heroku deployment is always a pain. I think I still need more practice with deploying onto Heroku in general, and getting used to the idea of development vs. production environment.
I didn't get Mail Gun to work because my account was suspended due to lack of business verification, and AWS also had problems with verifying my credit card address and my account was suspended. This is quite frustrating as using outside services means that there is no instant feedback and I'd have to wait for customer service to get back to me (probably after the weekend too).
I understand even better now why it is critical to leave out ample time for deployment because there's a lot more moving pieces once you're in the production phase of the project. I also have a better grip of how to add a post action, how to use various gems like aasm, roadie-rails, letter_opener, figaro, and fog. I also used a
case... where statement to write how to display various action buttons, and making it look quite organized like this:
I also began to summarize some key learnings into blog posts, some good ones from this week include:
I feel quite good about this week and the progress that's been made on the e-commerce project. I do feel quite stuck on deployment and hope to learn more about how to deploy going forward, particularly with regards to using Chinese services and possible integration with Wechat.