/chubbyts-petstore

An api skeleton using mongodb for chubbyts-framework.

Primary LanguageTypeScriptMIT LicenseMIT

chubbyts-petstore

CI Coverage Status

bugs code_smells coverage duplicated_lines_density ncloc sqale_rating alert_status reliability_rating security_rating sqale_index vulnerabilities

Description

An api skeleton using mongodb for chubbyts-framework.

Requirements

Environment

Add the following environment variable to your system, for example within ~/.bashrc:

export USER_ID=$(id -u)
export GROUP_ID=$(id -g)

Docker

docker-compose up -d
docker-compose exec node bash

Installation

npm install
npm start

Urls

Pet

Structure

Command

Commands is code that is meant to be executed on command line.

Handler

Handler alias Controller, or Controller actions to be more precise.

Model

Models, entities, documents what ever fits your purpose the best.

Repository

Repositories get data from storages like databases, elasticsearch, redis or whereever your models are stored or cached.

ServiceFactory

Service factories are the glue code of the dependeny injection container.

Deployment

Setup

Deployment

cd pulumi
npm install
pulumi config set digitalocean:token XXXXXXXXXXXXXX --secret
pulumi config set chubbyts-petstore:certManagerEmail XXXXXXXXXXXXXX --secret
pulumi up

Docker registry login

doctl registry login

Kubectl config

doctl kubernetes clusters list
doctl kubernetes clusters kubeconfig save <clustername>

Important kubectl commands

# lists all deployments: container definition(s) which provide(s) howto start a pod
kubectl get deployments

# show the current deployment definition
kubectl get deployment <deploymentname> -o yaml

# edit the current deployment defintion (should be done via code change and pulumi up, and not inline)
kubectl edit deployment <deploymentname>

# lists all pods: container(s) which provide(s) one application for example the cms
kubectl get pods

# show the current pod definition (do not edit!)
kubectl get pod <podname> -o yaml

# enter a pod
kubectl exec -it <podname> -- /bin/bash

Copyright

2023 Dominik Zogg