A simple, responsive web application to take notes, built with JavaScript ES6, designed as starting point to build complex web applications. Each application in the system can be run independently with Docker or npm. Unit, integration and end-to-end (e2e) tests are available. Development, release, integration and e2e test environments can be simulated with Docker Compose.
A new note can be created in a few simple steps:
The diagram below outlines the network created by Docker Compose for development and release environments, including application connections, ports, routes and tools:
Docker must be installed.
docker-compose -f dev.yaml up
docker-compose -f release.yaml up
docker-compose -f integration-tests.yaml up --exit-code-from integration
docker-compose -f e2e-tests.yaml up --no-attach node-chrome --exit-code-from e2e
Node.js v14.19.0 and Docker must be installed.
npm run dev
npm run start
npm run integration-tests
npm run e2e-tests
Find detailed instructions on how to run each application within the Application docs.
- Container orchestration for scale
- Automated test pyramid
- Blueprint for automated tests with CircleCI
- Full stack system built with JavaScript
- Starting point for more complicated use cases
Leveraging the power of Containers, the system and its applications can be deployed as-is to any cloud provider that supports Docker. It is encouraged to leverage the provided Docker Compose files, which simulate how the system & its applications run independently and together to facilitate multi-environment hosting, deployment and automation.
Docker Compose is used to simulate the system in different environments, creating a clone on your computer of how the system and its applications would run on a cloud. Leveraging Docker Compose, it is easier to troubleshoot multi-application systems outside of the cloud, while serving as a foundation for the cloud network that must be in place for the system to work on the cloud.
The diagram below outlines the network created by Docker Compose for development and release environments, including application connections, ports, routes and tools:
Using Docker Compose, a network can be spun up to simulate system and applications required to run integration (or service) tests. Unlike development, release and e2e test environments, the integration tests environment only contains a partial system orchestration, as only the API and Database are required.
The diagram below outlines the network created by Docker Compose for the integration tests environment, including application connections, ports, routes and tools:
A Docker Compose network is provided, simulating the system and applications that are needed to run e2e (or UI) tests. The e2e tests environment has the most complex container orchestration out of all other provided environments, as it requires an application to run the tests (nightwatch), a hub to spin up browsers (selenium hub) and a browser (node-chrome).
The diagram below outlines the full network required for the e2e tests environment, including application connections, ports, routes and tools:
Following Mike Cohn's test pyramid approach to automated testing, the system contains a "well-rounded" test portfolio, which aims to cover all critical areas of the system with automated tests.
The test pyramid paradigm encourages developers to build more unit tests (since they are small and fast), than service (or integration) tests, and more service tests than UI (or e2e) tests (which are slow and heavy).
Staying true to the test pyramid paradigm, the system provides over 95% unit test coverage, but only critical features are covered by integration and e2e tests. The goal is to provide a starting point for developers to extend tests as required.
Leveraging CircleCI, unit tests for each application (except for the database) are run on every new commit to Github. Once unit tests have passed, integration tests are run, validating API and Database changes. After integration tests pass, e2e tests are run, validating that the UI, API and Database work together as expected with the new changes.
Following the fail-fast automated testing approach, the system provides a starting point (or blueprint / boilerplate) as-is for more complex automated testing requirements.
Each application in the system uses JavaScript, with the exception of the PostgreSQL database. Leveraging (mostly) a single programming language for all applications of the system has numerous advantages, including:
- Cross-functional engineering - seamlessly switch between application and test code, because all code looks alike!
- Common design patterns - consistent design patterns and coding styles between applications facilitates readability, maintenance and extendability
- Easier to staff and scale - hiring and training engineers on for a single programming language is easier than (the more common) multi-language software stacks
- Large community - all tools, libraries and frameworks used in the system have large open source communities
The system and its applications can be re-used as a starting point (or blueprint / boilerplate) for more complex systems and applications. Each application provides common design patterns that can be leveraged to facilitate development of new features. All applications are containerized with Docker, ready to be deployed as-is to any cloud provider with Docker support.
UI
API
Database
Integration tests
End to end tests
Node.js
Docker
Docker Compose
CircleCI
React
Express.js
Swagger
PostgreSQL
Jest
Supertest
Nightwatch
Selenium
Our commits follow the Angular commit styleguide. Each commit should be carefully thought out and only contain files affected within the scope of the commit message.
A branch's name should reference a story and the type of work being committed.
Each pull request must pass a review from another contributor and all automated tests.
Feel free to open an issue ticket, please leave a screenshot and a detailed instructions on how to replicate the issue.
This repository is protected under the MIT License.