Skip to content

cloudshopt/product-service

Repository files navigation

product-service

  • Purpose: Product catalog (list + detail).
  • Base path: /api/products

Create product database

kubectl -n cloudshopt exec -it cloudshopt-mysql-0 -- bash

# mysql -u root -prootpass

CREATE DATABASE cloudshopt_products CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'users'@'%' IDENTIFIED BY 'CHANGE_ME_PASSWORD';
GRANT ALL PRIVILEGES ON cloudshopt_products.* TO 'users'@'%';
FLUSH PRIVILEGES;

Migrations

kubectl exec -n cloudshopt -it deploy/product-service -c app -- sh
# php artisan migrate

GraphQL (Lighthouse)

This service exposes a GraphQL API (powered by Lighthouse) for querying product data.

Endpoint

  • POST /api/products/graphql

Schema

type Product {
  id: ID!
  name: String!
  description: String
  price: Float!
}

type Query {
  products: [Product!]! @all
  product(id: ID! @whereKey): Product @find
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages