A Boilerplate for Microservices NodeJS Architecture
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
- π Table of Contents
- π About the Project
- π οΈ Getting Started
- π Usage
- π Roadmap
β οΈ License
Client
Server
MongoDB available Databases per microservice
DevOps
Packages
- node
- browser
- SDK/node
- SDK/browser
- config
-
Eventing with Apache Kafka
-
Authentication
- Role management
- Token management
-
Forms
- React hook form components
- Raw form components
To run this project, you will need to add the following environment variables to your .env file for every app
PORT
PORT
PORT
DATABASE_URI
ACCESS_TOKEN_SECRET_KEY
REFRESH_TOKEN_SECRET_KEY
TOKEN_EXPIRES_IN
REFRESH_TOKEN_EXPIRES_IN
NUMBER_OF_AUTH_TRIALS
KAFKA_BROKERS
MICROSERVICE_NAME
For eveventing this project uses the open source project Apache Kafka
For the client we use the one made by Confluent the co-authors of apache kafka Apache Kafka Node.js client
For each microservice a package under the packages/node/events
folder is created that exposes a Producer class and a Consumer class.
Further details can be found at the README.md
This project uses Yarn as package manager and docker for development.
npm install --global yarn
Install project with yarn
yarn
Install project with yarn
yarn workspace <project-name> add [-D] <dependency>
To run tests, run the following command
yarn test
To run tests, run the following command
yarn workspace <project> test -watch
Clone the project
Go to the project directory
Install dependencies
Start the docker containers
make compose-dev
Start the server
yarn start
To add a package to an app, please follow this guide.
Follow this guide to build all apps in projects.
Work in progress...
Work in progress...
All code in this repository is licensed under the MIT License.