shortpoet / shopping-cart-playground

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

shopping-cart-playground

This is a shopping cart playground.

It uses React for the frontend and SQL, TypeORM, and Express for the backend.

Can be run using docker.

usage

  • install dependencies
yarn install
  • launch rest api
yarn start:rest
  • launch rest api
yarn start:graph
  • run tests
yarn test
  • setup docker containers using compose
./docker/build.sh
  • run docker containers
docker-compose up
  • take down containers and wipe docker volumes
./docker/wipe.sh
  • shell into database
./docker/db-shell.sh
  • run client tests in container
./docker/client-run-test.sh
  • run server tests in container
./docker/server-run-test.sh
  • shell into client using docker run
./docker/client-run-shell.sh
  • or into running container using docker exec (use 'u' script for ubuntu)
./docker/client-a-shell.sh

server setup

mkdir server && cd server
yarn init
yarn add --dev typeorm reflect-metadata @types/node mssql ts-jest @types/jest express express-graphql graphql @types/cors @types/express class-validator cors ts-node-dev type-graphql
  • mssql
yarn add --dev mssql

client setup

mkdir client && mkdir client/{src,dist} && cd server
yarn init
yarn add --dev webpack webpack-cli react react-dom @types/react @types/react-dom @types/node typescript ts-loader source-map-loader chalk html-webpack-plugin webpack-hot-middleware webpack-dev-server ts-node dotenv tslint tslint-react tslint-config-prettier web-vitals
yarn add axios styled-components react react-dom react-router-dom
tsc --init
touch {server,webpack.config}.js
mkdir src/app && mkdir src/app/components
touch src/app/{App,index}.tsx
touch src/app/components/StoreFront.tsx
mkdir public && touch public/index.html

azure

About


Languages

Language:TypeScript 70.9%Language:Shell 12.6%Language:TSQL 11.8%Language:HTML 2.6%Language:JavaScript 2.1%