Skip to main content
  1. All Posts/

ecommerce-typescript-api

eCommerce TypeScript

ecommerce-typescript-api

An eCommerce API using Typescript + PostgreSQL with TypeORM

Description

An API that allows Users to create and buy Products

How to run

To run this API all you will need to have installed is: docker
After cloning this repository and entering its directory, run the command:

docker compose up

Entities

User

id: uuid(PK);

name: string;

email: string;

password: string;

document: string;

created_at: date;

updated_at: date;

Product

id: uuid (PK)

name: string

email: string

password: string

document: string

created_at: date

updated_at: date

Transactions

id: uuid (PK)

product_id: uuid (FK)

owner_id: uuid (FK)

buyer_id: uuid (FK)

price: number

method: string (debit/credit)

created_at: date

updated_at: date

ConfirmationEmail

id: uuid (PK)

product_id: uuid (FK)

owner_id: uuid (FK)

buyer_id: uuid (FK)

price: number

method: string (debit/credit)

created_at: date

updated_at: date

Functional Requirements

  • Users must be able to be registered
  • Users must be authenticateds (login)
  • Users may register Products
  • Users may see all stored Products
  • Users may be able to see all products from a specific User
  • Users may be able to buy a Product
  • Users must receive an confirmation email when registered
  • Users must be able to confirm their email

Business Rules

  • Users cannot be registered with an already existing document/email
  • User’s password can not be returned
  • Users cant register Products when unauthenticated
  • Users cant buy their own Products
  • When a User buy a Product, the Product must have its status changed to sold
  • Users cant be authenticated without confirming their email