Rolando Andrade
Back to projects

Built in 2020

Shopy

E-commerce Platform

Shopy preview

E-commerce developed as Software Development course. I developed the service layer of the application.

A card payment passes through banks, processors and clearinghouses. Each one takes a cut. Each one adds delays. In 2020, our Software Development course gave us a challenge. Build an online store that skips all of them.

Shopy was our answer. It is an e-commerce application that accepts cryptocurrency payments directly. No intermediaries and no waiting for bank approvals. Buyers and sellers connect through blockchain technology.

I was responsible for the service layer, the backend logic that made everything work.

A store paid in crypto

Shopy has everything an online store needs. Users browse products, add them to a cart and buy them. Sellers list products, manage inventory and receive payments.

The difference is how people pay. Instead of credit cards or bank transfers, Shopy accepts cryptocurrency. Users pay with Bitcoin or other supported coins. The platform handles conversion, verification and settlement.

The frontend is a Vue.js application with product catalogs, a shopping cart and a checkout flow. The backend is NestJS running on Node.js. It offers REST APIs for everything the frontend needs.

How we split the code

We split the codebase in two. The client application lives in one folder and the server in another. Both use TypeScript, which checks types before the code runs.

NestJS gave us a modular structure. Each domain idea became its own module: products, users, carts, payments, categories and reviews. Each module had its own controller, service and entity.

The controller receives HTTP requests. The service holds the business logic. The entity describes the database structure. This split kept the code organized as it grew.

For the database, we chose PostgreSQL with TypeORM. TypeORM is an ORM, a tool that maps database tables to code. It let us define entities as TypeScript classes. It also handled migrations, the scripts that change the database structure. When we changed a model, we ran a command and the database updated itself.

My part: the rules

My job was the service layer. This is where the business rules live. When a user adds something to the cart, the service checks the stock. At checkout, it calculates the totals. When payment arrives, it updates the order status.

The cart service was one of the harder pieces. It tracked products for each user, handled quantity changes and calculated subtotals. It also checked that items were still available. All of that while keeping the data consistent.

The product service managed the catalog. It created products, updated prices, managed images and sorted products into categories. Every operation needed proper validation and error handling.

The user service handled login and profiles. We added Google OAuth for social login. We also supported email and password sign up, with bcrypt to hash the passwords.

Paying through Coingate

The interesting part was cryptocurrency payments. We used Coingate, a payment gateway for crypto transactions.

Coingate has a sandbox for testing. No real money moves, but the API behaves like production. We could build and test without any financial risk.

The payment works in five steps:

  1. The user completes checkout.
  2. We create an order in Coingate.
  3. Coingate returns a payment URL.
  4. The user pays at that URL.
  5. Coingate tells us when the payment is confirmed.

Webhooks made the last step possible. A webhook is an HTTP request Coingate sends to our server when a payment status changes. That meant our server needed a public URL. During development, we used ngrok to expose our local servers to the internet.

The payment service tracked each order’s state: pending, paid, expired or failed. Each state led to different actions. A successful payment updated inventory and notified the seller. A failed payment released the reserved stock.

Same database for everyone

TypeORM let us design the schema with decorators, labels written above each class and field. Each entity defined its columns, relationships and constraints. The ORM wrote the SQL for us.

We had entities for users, products, categories, carts, orders and payments. Relationships linked them. A user has many orders. An order has many products. A product belongs to categories.

Migrations kept everyone in sync. When someone changed an entity, they generated a migration file with the SQL to update the database. Running all migrations on an empty database rebuilt the full schema.

This saved hours of debugging. We had no more “it works on my machine” problems. Everyone ran the same migrations and got the same database.

Who can do what

Security mattered, even in a course project. We used JWT tokens for login. A JWT is a signed token that proves who the user is. Users log in once, get a token and send it with every request after that.

Passport.js handled the login strategies. One strategy checked JWT tokens. Another handled Google OAuth. The service layer did not care how users logged in. It just received verified user objects.

We also added role based access. Regular users browse and buy. Sellers list products. Admins manage the platform. Every endpoint checked permissions before doing anything.

Sensitive operations needed extra checks: changing passwords, deleting accounts and processing refunds. The service layer enforced these rules the same way everywhere.

Emails from templates

Transactional emails kept users informed with order confirmations, payment receipts and shipping updates. We used SendGrid to deliver them.

The mail service used templates. These were HTML files with placeholders for the details. To send an email, we loaded the template and filled in the blanks, like the order number and the total.

This kept email content easy to manage. Designers could change templates without touching code. Developers could add new email types without designing HTML.

Code others depend on

Shopy taught me how to structure a real backend. Making it work was not enough. It had to be easy to maintain, and the modular structure paid off as the code grew.

TypeScript caught errors before they reached production. The ORM made database work simpler. The framework pushed us toward good patterns. These tools exist because they solve real problems.

Crypto payments showed me a different model. There are no chargebacks and no processing delays. The tradeoffs differ from traditional systems. It is worth understanding, even when it is not always practical.

Most of all, I learned to share responsibility on a team project. My service layer depended on other people’s work, and their features depended on mine. We had to talk, coordinate and agree.


If you’re building e-commerce systems or working with cryptocurrency integrations, I’d be happy to share more details.

Interested in working together? Check out my services and pricing to see how we can collaborate on your next project. Let's Build