Skip to content

Redstore microservice based, a simple implementation with docker containers.

License

Notifications You must be signed in to change notification settings

MuriloChianfa/Redstore-Microservice-Based

Repository files navigation

Welcome to the Redstore microservice based, a simple implementation with docker containers

Scrutinizer Code Quality Code Coverage Build Status Code Intelligence Status

How to setup the DEV environment:

git clone https://github.com/MuriloChianfa/Redstore-Microservice-Based.git
cd Redstore-Microservice-Based
cp .env.example .env && vi .env
Scripts/gen-ssl.sh
docker-compose build && docker-compose up -d
docker container exec -u 0 redstore-api composer install && \
docker container exec -u 0 redstore-web composer install

To setup the PROD environment use -f docker-compose.production.yml in two commands

Architecture:

Database schema:

Accessing database:

$ docker container exec -it redstore-database mysql -u root -p"simple-server" -D "redstore"

Short example of API endpoints

Base URL: https://REDSTORE_IP/api

  • GET /products
  • GET /products/{page}/{limit}
  • GET /products/{page}/{limit}/{order}/{direction}
  • GET /product/{id}
  • POST /product
  • POST /product-image/{id}
  • PATCH /product
  • DELETE /product-image/{id}

Getting data with Curl

$ curl -ks -X GET https://REDSTORE_IP/api/product/1 | jq .

Output

{
  "message": {
    "id": 1,
    "name": "example product",
    "value": 20,
    "description": "example product",
    "available": 1,
    "rate": 0,
    "collection_id": null,
    "category": {
      "id": 8,
      "name": "Others"
    },
    "ProductImage": []
  }
}

Frontend features

Add and exclude new products and there images