An Express/React/typescript bootstrapper app
View it live at http://rpgdiceroller.com
This typescript repo is structured with two primary sub-folders:
For npm dependencies:
./scripts/install-all.shStart frontend dev server:
./scripts/frontend-start.shStart backend dev server:
./scripts/backend-start.shRun all jest tests, and linting:
./scripts/test-all.shRun cypress feature tests:
./scripts/feature-tests.shThis 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 fencesAlways push via ship-it (why?)
./scripts/ship-it.shWe use circleci.
The pipeline is:
- npm install (frontend and backend)
- run all unit tests (frontend and backend)
- build code and run feature tests
- deploy to GCP environment
Build frontend, build backend, compile all into one directory:
./scripts/build.shStart the production server (frontend & backend)
./scripts/prod-start.shFirst, 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.shGenerally, developers won't have to do this - we have automated deploys via CircleCI.