Skip to content

yugienter/i-commerce-project

Repository files navigation

nest-i-commerce-project

Built With

Folder Structure Conventions

Folder structure options and naming conventions for software projects

A typical top-level directory layout

.
├── ...
├── src/                                  # Source files
│   ├── brands/                           # Brands Module
│   ├── common/                           # Application-wide shared classes
│   ├── config/                           # Application-wide configuration variables
│   ├── consumer/                         # Kafka Consumer Module
│   ├── es/                               # ElasticSearch Module
│   ├── interceptors/                     # Application-wide Interceptors
│   ├── kafka/                            # Kafka Abstraction Module
│   ├── producer                          # Kafka Producer Module
│   ├── products/                         # Products Module
│   └── app.module.ts                     # Root Module
│   └── main.ts                           # The entry point of application
├── test/                                 # Automated end-to-end testing module
├── Dockerfile                            # Dockerfile for API service
├── docker-compose.yml                    # Compose config file defining container services
├── package.json                          # Config of npm
├── package-log.json                      # Log of Config of npm -  need it to run docker
└── README.md

System Architecture

The formal description and representation of this application.

System

  • Entity relationship diagram

System Components

  • Sequence diagram for API

Sequence Diagram

Installation and Running

  1. Clone source

  2. Navigate to source code directory

cd i-commerce-project/
  1. Start docker comporse
docker-compose up
  1. Stop docker comporse when done
press Ctrl+C
docker-compose down

Usage

Brands

  1. Add brands
curl -H  "accept: application/json" \
-H  "Content-Type: application/json" \
-d "{\"name\":\"New Brand\",\"address\":\"USA\"}" \
-X POST http://localhost:3000/brands
  1. Get All Branch
curl -H  "accept: application/json" -X GET http://localhost:3000/brands
  1. Get brand by Id
curl -H "accept: application/json" \
-X GET http://localhost:3000/brands/{$brandId}
  1. Delete brand
curl -H  "accept: application/json" -X DELETE http://localhost:3000/brands/${brandId}

Product

  1. Create Product
curl -H  "accept: application/json" \
-H  "Content-Type: application/json" \
-d "{\"name\":\"New Product\",\"status\":\"AVAILABLE\",\"price\":1000,\"color\":\"red\",\"brandId\":${brandId}}"\
-X POST http://localhost:3000/products
  1. Get ALL Product
curl -H  "accept: application/json" -X GET http://localhost:3000/products
  1. Get Product By ID
curl -H "accept: application/json" -H "Content-Type: application/json" -X GET http://localhost:3000/products/{$productId}
  1. Delete Product
curl -H  "accept: application/json" -X DELETE http://localhost:3000/products/${productId}

Search

Search by criterion : - color, name, brand value : filter

curl -H "accept: application/json" -X GET http://localhost:3000/search?criterion=color&value=red

Get all of search by client

curl -H  "accept: application/json" -X GET http://localhost:3000/sales-topic

Elasticsearch

http://localhost:9200/

Kibana

http://localhost:5601/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published