Skip to content

aloverso/dice-roller

Repository files navigation

Dice Roller

build

An Express/React/typescript bootstrapper app

View it live at http://rpgdiceroller.com

Getting Started

This typescript repo is structured with two primary sub-folders:

  • backend - the express API server
  • frontend - the react web UI

npm Dependencies

For npm dependencies:

./scripts/install-all.sh

Development

Start frontend dev server:

./scripts/frontend-start.sh

Start backend dev server:

./scripts/backend-start.sh

Run all jest tests, and linting:

./scripts/test-all.sh

Run cypress feature tests:

./scripts/feature-tests.sh

Fences

This repo uses good-fences to enforce module boundaries. Most importantly, the backend and frontend cannot import from each other.

Additionally, fences are used in the backend subdirectories to enforce dependency inversion. The routes and database folders depend on the interfaces defined in domain (only - not on each other), and domain is not allowed to import from any of these implementation directories.

Fences are enforced via a linting-like command that will fail when any violations are flagged:

npm --prefix=backend run fences
npm --prefix=frontend run fences

Pushing changes

Always push via ship-it (why?)

./scripts/ship-it.sh

CI/CD

We use circleci.

The pipeline is:

  1. npm install (frontend and backend)
  2. run all unit tests (frontend and backend)
  3. build code and run feature tests
  4. deploy to GCP environment

Deployment

Build frontend, build backend, compile all into one directory:

./scripts/build.sh

Start the production server (frontend & backend)

./scripts/prod-start.sh

Deploying to GCP

First, make sure that Google Cloud SDK is installed

Ensure you are logged in to the CLI and pointing to the correct project.

This script generates the app.yaml and deploys the app:

./scripts/deploy.sh

Generally, developers won't have to do this - we have automated deploys via CircleCI.

About

RPG dice roller & template react/node/typescript app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published