An Express/React/typescript bootstrapper app
This typescript repo is structured with two primary sub-folders:
For npm dependencies:
./scripts/install-all.sh
If not already installed, install postgres
Create postgres local DB:
psql -c 'create database dicelocal;' -U postgres
Run database migrations:
./scripts/db-migrate.sh
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
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
npm --prefix=backend run db-migrate create [migration-name] -- --sql-file
Always push via ship-it (why?)
./scripts/ship-it.sh
We 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.sh
Start the production server (frontend & backend)
./scripts/prod-start.sh
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.