vutran1710 / SweetDeals

Demonstrating FullStack JavaScript/TypeScript Application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Table of Contents

  1. Introduction

  2. Features

  3. Development & CICD Strategy Flow

    1. Development
    2. PullRequest & CICD
  4. Deployment Tutorial

  5. A great Medium Story...

Introduction

SweetDeals is a complete heavy Javascript/Typescript-oriented application, built for demonstration & educational purposes.

Features

  • The full circle of software development

  • A complete, or full-stack so to say, javascript application

    • TypeScript integration - the benefit & the tax
    • How Fuse-Box can be an agreeable alternative to webpack
    • Mongodb, ExpressJS, React Server-side Rendering
  • Testing a full-stack javasript application

  • QA/QC, what to do from the point of the developers

  • DevOps workflow, including CICD and Deployment

Development & CICD Strategy Flow

Quality Control CheckList

  • Branch master must be strictly protected!
  • Feature implementation must be carried out on a separate branch
  • Each commit must be linted locally
  • If dev tries to commit on master branch, use husky to auto switch to a new feature-branch
  • To merge to master branch, a PullRequest must be submitted
  • Implement frontend test with Mocha & React-testing-library

CICD Implementation CheckList

  • Each Pull-Request will be verifed with automation of testing & bundling
  • If successful, allow to merge to Master
  • Deploy with Kubernetes
  • Auto deploy upon merging to master

Deployment Tutorial

Prepare the very first image for the initial deployment with kubernetes

$ docker login
$ docker build -t vutrio/sweetdeals-image-demo:latest .
$ docker push vutrio/sweetdeals-image-demo:latest

Save the K8s DigitalOcean config as ~/.kube/config Check if config is properly set?

$ kubectl config view

PS: dont forget to save the config/secret files to SemaphoreCI Secrets If ok, set Database Secret for K8s Database service

$ kubectl create secret generic prod-db-secret --from-literal=user=root --from-literal=password=1234 --from-literal=dbname=prod

Create Docker secret namely regcred for K8s to pull the private image

$ kubectl create secret docker-registry regcred --docker-server=https://index.docker.io/v1/ --docker-username=DOCKER_USER --docker-password=DOCKER_PASSWORD --docker-email=DOCKER_EMAIL

Apply with K8 to launch the fucking App

$ kubectl apply -f k8s/

A great Medium Story

to be done... once project finished.

About

Demonstrating FullStack JavaScript/TypeScript Application


Languages

Language:TypeScript 75.4%Language:SCSS 20.6%Language:HTML 1.5%Language:Shell 1.5%Language:JavaScript 0.7%Language:Dockerfile 0.3%