Skip to content

nmmugia/nodejs-hapi-api

Repository files navigation

Nodejs Hapi API

This repository contains the implementation for simple e-commerce API based on jubelio store data

ERD

erd

note on ERD

So while the product and adjustment_transaction are quite straightforward, but on the product_stock, we use irreversible historical-based data, means that every stock move must be recorded and had to be sequential (old data should not be updated directly since it tamper with the data consistency).

Why we do this rather than just adding qty column and update it directly? because, for example, as a business owner, I want to know the historical data to make sure it's consistent and to make sure there are no data tampering from employee or another person

Structure

structure

API docs

Postman link

Installation using docker (recommended)

docker-compose up

Installation using yarn

yarn install
yarn tsc
yarn migrate
yarn serve

Requirements (without docker)

  • Postgresql
  • Redis

Note

you may change the configuration/environments that is set, on docker-compose file

Scripts

compile to js

yarn tsc

compile and migrate the database migration

yarn migrate

serve the backend app

yarn serve

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published