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.mdThe file you are readingLICENSELicense to use and create derivative works from the softwarepackage.jsonNPM configuration fileDockerfileBuild file for Docker imagesbin/Directory containing development scriptsbin/buildBuilds the project's container imagebin/runStarts a container and runssrc/index.cjsbin/testStarts a container and runs all teststest/Directory containing integration testssrc/Directory containing project codesrc/index.cjsApplication's main entry pointsrc/build-variables.cjsDefault values for build variables during development.dockerignoreFiles that should be ignored when building images.gitignoreFiles that should be ignored in git commits.nvmrcContains the expected version of the NodeJS runtime, used by nvm.prettierrc.jsonAutoformatter/linter configuration/rulesbuild-variables.cjsGenerates JavaScript code containing build-time valuespackage-lock.jsonNPM 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:
testruns all tests on local machine.bin/testruns this in a Docker containerprepareused by husky for hook managementformatformats 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