Technology Stack
The modern approach for developing custom Mosaic services is supported by the technology choice which utilizes a service-oriented approach through microservices and microfrontends.
For a hassle-free setup and easy collaboration between the frontend and backend development process, Node.js and TypeScript are utilized. Moreover, GraphQL is used for the interface between the frontend and backend. Mosaic uses RabbitMQ for reliable inter-service communication.
Core Technologies
The following core technologies are used by Mosaic:
- Node.js - https://nodejs.org/ - JavaScript runtime, the most popular tool for running server-side applications
- Typescript - https://www.typescriptlang.org/ - extends JavaScript by adding types. A very valuable improvement to JavaScript for enterprise-scale applications. All Mosaic components are developed with TypeScript.
- GraphQL - https://graphql.org/ - a query language that allows clients to mutate and fetch exactly (and only) the data that they need. All Mosaic Services expose their APIs as GraphQL APIs. GraphQL offers clients a type-safe way to consume the APIs.
- RabbitMQ - https://www.rabbitmq.com/ - a message broker for reliable and flexible messaging to easily integrate multiple microservices
- React - https://reactjs.org/ - declarative and flexible JavaScript library for building complex UIs from small and isolated pieces
- Piral - https://www.piral.io/ - a framework enabling microfrontends
- PostgreSQL - https://www.postgresql.org/ - an open-source relational database with good support for JSON, column, and row-level security and many other features
- PostGraphile - https://www.graphile.org/postgraphile/ - a tool that exposes PostgreSQL database as a GraphQL API in a simple way
Core technologies used by Mosaic
3rd Party Tools
Selection of the 3rd party tools used in Mosaic development process:
- Visual Studio Code - https://code.visualstudio.com/ - free and source-code editor. Axinom recommends to use a set of extensions for optimal support for the technologies used
- Storybook - https://storybook.js.org/ - a tool for developing UI components in isolation and testing them on the fly. (Mosaic Storybook: https://mosaic-storybook.axinom.net/)
- Typedocs - https://typedoc.org/ - Documentation generator for TypeScript projects. (Mosaic Typedocs: https://mosaic-typedocs.axinom.net/)
- Jest - https://jestjs.io/ - JavaScript Testing Framework, well-integrated with TypeScript, Node.js, and React
- Yarn - https://yarnpkg.com/ - package manager with some advantages compared to NPM, especially for big projects.
- eslint https://eslint.org + prettier https://prettier.io/ - Linting and code formatting tools to ensure consistent code style and quality.
- Express - https://expressjs.com/ - Web framework for Node.js.
- Zapatos - https://jawj.github.io/zapatos/ - Zero-boilerplate TypeScript ORM for PostgreSQL.
- Graphile-migrate - https://github.com/graphile/migrate - Declarative database schema migration tool.
- Graphile-worker - https://github.com/graphile/worker - High-performance Node.js/PostgreSQL job queue.
- Graphql codegen - https://graphql-code-generator.com/ - Generates code from GraphQL schemas and operations.
- Rascal - https://www.npmjs.com/package/rascal - Enterprise messaging for Node.js using RabbitMQ.
Patterns and Techniques
Mosaic is much more than a combination of all the used technologies and tools. They are used in a specific way, aimed for efficient application development and to reduce the time-to-market.
Developers can concentrate on what matters for their business and don’t need to worry about secondary details. You will find a lot of development patterns throughout Mosaic documentation. Some of them are listed below:
- Microservices - fully decoupled services that allow API-first approach and effective scalability
- Microfrontends - fully decoupled workflows to enable domain-scoped development and deployment
- Transactional Inbox/Outbox - ensures reliable messaging by managing transactions between services in distributed systems.
- Event-Driven Architecture - systems communicate asynchronously through events, promoting loose coupling and scalability.
- Circuit Breaker - prevents cascading failures in distributed systems by failing fast and recovering quickly.
- Tripwire - a mechanism to detect and prevent usage of deprecated elements.