Boilerplate for any NodeJS application.
It can scarcely be denied that the supreme goal of all theory is to make the irreducible basic elements as simple and as few as possible without having to surrender the adequate representation of a single datum of experience.
~ Albert Einstein
Stage One is designed to bootstrap NodeJS applications by providing the minimum platform for performing test-driven development in a containerized environment.
- Git: The distributed collaboration platform.
- Docker: Linux container image builder and local runtime environment.
To build a container image run:
bin/build
To deploy a container to a local Docker daemon:
bin/run
To run all tests in a local container:
bin/test
Stage-One applications should follow the Semantic Versioning 2.0.0 specification.
An application's canonical version is found in its package.json
file. Please
keep this up-to-date.
README.md
The file you are readingLICENSE
License to use and create derivative works from the softwarepackage.json
NPM configuration fileDockerfile
Build file for Docker imagesbin/
Directory containing development scriptsbin/build
Builds the project's container imagebin/run
Starts a container and runssrc/index.cjs
bin/test
Starts a container and runs all teststest/
Directory containing integration testssrc/
Directory containing project codesrc/index.cjs
Application's main entry pointsrc/build-variables.cjs
Default values for build variables during development.dockerignore
Files that should be ignored when building images.gitignore
Files that should be ignored in git commits.nvmrc
Contains the expected version of the NodeJS runtime, used by nvm.prettierrc.json
Autoformatter/linter configuration/rulesbuild-variables.cjs
Generates JavaScript code containing build-time valuespackage-lock.json
NPM lock file.husky/
Directory containing husky git hook configuration
Inside the bin/
directory there are some scripts containing Docker commands
for building, running, and testing the application. Use these to develop and
deploy in a platform-neutral environment.
There are some scripts to be run via npm are defined in package.json
:
test
runs all tests on local machine.bin/test
runs this in a Docker containerprepare
used by husky for hook managementformat
formats code by rules defined in.prettierrc.json
The script build-variables.cjs
in the project root is run by Docker at build time. It generates src/build-variables.cjs
and injects values from the environment.
- Alpine Linux: Lightweight Linux distribution designed for containerization.
- NodeJS: JavaScript runtime and standard library
- npm: Package manager
- nvm: NodeJS version manager
- Husky: Git hook manager
- lint-staged: Runs linter against files staged in Git
- Prettier: JavaScript autoformatter
- Ava: Fast, concurrent, test runner