Folder structure options and naming conventions for software projects
.
├── ...
├── 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
The formal description and representation of this application.
- Entity relationship diagram
- Sequence diagram for API
-
Clone source
-
Navigate to source code directory
cd i-commerce-project/
- Start docker comporse
docker-compose up
- Stop docker comporse when done
press Ctrl+C
docker-compose down
- Add brands
curl -H "accept: application/json" \
-H "Content-Type: application/json" \
-d "{\"name\":\"New Brand\",\"address\":\"USA\"}" \
-X POST http://localhost:3000/brands
- Get All Branch
curl -H "accept: application/json" -X GET http://localhost:3000/brands
- Get brand by Id
curl -H "accept: application/json" \
-X GET http://localhost:3000/brands/{$brandId}
- Delete brand
curl -H "accept: application/json" -X DELETE http://localhost:3000/brands/${brandId}
- 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
- Get ALL Product
curl -H "accept: application/json" -X GET http://localhost:3000/products
- Get Product By ID
curl -H "accept: application/json" -H "Content-Type: application/json" -X GET http://localhost:3000/products/{$productId}
- Delete Product
curl -H "accept: application/json" -X DELETE http://localhost:3000/products/${productId}
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/