Features a persistent cart across devices.
All products view.
Cart items are saved in localStorage.
- Created multi-product view and cart components managed through React-Redux & Sequelize and using localStorage
- Contributed to developing the relational database, models and API routes
A very challenging task was implementing the cart query to the database because it uses a through table referencing several other tables. A limitation for the project was that the cart items had to be part of the orders table. My group's solution implemented "orders_products" as a through table that linked "orders," "users," and "products." Cart items were then defined as non-completed orders.
Conceptually, everything made complete sense to my group members and to me. The hard part was finding the correct database query that merged results from all three. We beat our heads against the wall for about an hour minutes before deciding to ask for help from our senior instructor. I'm glad we did! He was eventually able to help us structure the query, but even he got stuck on documentation and dead ends a few times.
I learned a couple of valuable lessons: 1) That it's OK to ask for help. Doing so saved our team valuable time and helped to avoid undue frustration; and 2) that even more senior folks struggle with the complex issues, however can usually find the solution more quickly and correctly.