Shared code for public website and other applications.
This project uses Rush Stack and Heft for build and test orchestration. Rush has the benefit of providing incremental builds, which makes it useful for use in the monorepo context (time savings).
# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
source ~/.bashrc
# Install node14
nvm install 14
nvm use 14npm install --global pnpm
pnpm install --global @microsoft/rush @rushstack/heftrush update
rush build
# force rebuild by not using build cache
rush rebuildRun
$ rush updateafter installing new packages and fetching code from remote git repository.
| Project | Description | Source link |
|---|---|---|
| spacekatt.io | The International SpaceKatt Station website, used to host content and other projects |
Source link |
| Minesweeper | Minesweeper implementation, React 17 Hooks used as responsive application framework | Source link |
Each project is responsible for its own testing. All applications use heft (jest under the covers) as a test runner.
cd <app_dir>
heft testEach project is responsible for defining its own linting rules.
Generally, projects use ESLint and Prettier. (TSLint is now deprecated.)
pnpm install --global eslint prettierTo provide an artifact for CI/CD and ensure setup instructions are 100% discoverable and documented, a Dockerfile is present. The produced docker image may be used to serve the International SpaceKatt Station—and all bundled projects—locally at http://127.0.0.1/ (and accessible from your favorite browser).
The ngnix:alpine variant of NGINX is used to serve static assets from within a container. Static assests are built in the first stage, then copied over to the nginx:alpine base in the second stage, before finally configuring and exposing the nginx service.
Alpline allowed for the optimization of image size; a 668MB Docker image was reduced to 30.8MB through the use of a multi-stage, alpine-based build.
docker build -t spacekatt/spacekatt-io:latest .docker image ls
docker run -d -p 80:80 spacekatt/spacekatt-io:latestView site running from the container at http://127.0.0.1/ in your favorite browser.
# List running containers
docker ps
docker stop <container_name># List running containers
docker ps
docker exec -it <container_name> /bin/sh| Pipeline | Description | Badge |
|---|---|---|
| CI Pipeline | Continuous integration that runs on pull request and push to main. Builds, lints, and tests projects in monorepo. |
|
| CD Pipeline | Continuous delivery pipeline that runs on push to release/*. Releases public website. |
The author set up the CD pipeline using this tutorial;
Each project is responsible for their own observability strategies. Please refer to the Project Inventory for links to READMEs with the relevant information.