Building Shopping Cart for the User

Building Shopping Cart for the User

As you can see, the app is designed to let users be instantiated with a new cart meaning it is a one-to-one relationship. This means when a new user creates an account, a new cart will be created on our backend and that cart will be attached to that specific user by their user_id.

Every shopper needs a cart

For the Mod 3 project, we were given the task of building a Single Page Application (SPA)using JavaScript as the frontend and Ruby Rails API as the backend server. My partner and I came up with the idea to build an e-commerce site that sells PPE products (we need masks more than ever now, don’t we? 😷). First we mapped out the domain models and came up with the following logical diagram with has_many, belongs_to _and has_many_through_ relationships:

Image for post

Entity Relationship Diagram showing the 6 models for my app

As you can see, the app is designed to let users be instantiated with anewcart meaning it is a one-to-one relationship. This meanswhen a new user creates an account, a new cart will be created on our backend and that cart will be attached to that specific user by their user_id. Cool, isn’t it? Now when the user logs back in at any other time, we no longer have to create a new cart for this user; we can simply find 🔍 the pre-existing cart on our backend and grab that cart object. We save the trouble of creating hundreds and thousands of disposable carts.

code technology software-development rails javascript

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Offshore Software Development - Best Practices

To make the most out of the benefits of offshore software development, you should understand the crucial factors that affect offshore development.

Hire Ruby on Rails Developer | Hire RoR Developer

#1 Ruby on Rails development company. Hire Ruby on rails developer or a team to build secure, scalable and complex web solutions with a quick turnaround time.

5 Core Criteria for Selecting Software Development Company - TopDevelopers.co

Check out these five criteria for the selection of your software vendor, and you will never regret having the wrong quality product made for you.

Global Offshore Software Development in Next Decade 2030

**Quick Summary:** Looking at the current market size of the Global Offshore Software Development, the future seems to be on the pinnacle of success. With the pace of technological advancements, the next decade of software development, meetings...

Wrestling Betting Software Development | WWE Betting Software Developers

Wrestling betting software development solutions from expert Wrestling betting app and software development company delivers ultimate betting experience. Chat with us.