Skip to content

Latest commit

 

History

History
380 lines (237 loc) · 7.95 KB

README.md

File metadata and controls

380 lines (237 loc) · 7.95 KB
logo

The Ultimate boilerplate

A Boilerplate for Microservices NodeJS Architecture

Note

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

📷 Screenshots

screenshot

👾 Tech Stack

Client
Server
MongoDB available Databases per microservice
DevOps

👾 Available Microservices

Front end
Back end
Packages

🎯 Features (so far)

  • Eventing with Apache Kafka

  • Authentication

    • Role management
    • Token management
  • Forms

    • React hook form components
    • Raw form components

🔑 Environment Variables

To run this project, you will need to add the following environment variables to your .env file for every app

PORT

🔑 Environment Variables per project

CRA

PORT

express

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

Eventing

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

🛠️ Getting Started

‼️ Prerequisites

This project uses Yarn as package manager and docker for development.

npm install --global yarn

⚙️ Installation

Install project with yarn

yarn

⚙️ Adding dependency to a project

Install project with yarn

yarn workspace <project-name> add [-D] <dependency>

🔬 Running global Tests

To run tests, run the following command

yarn test

🔬 Running project Tests

To run tests, run the following command

yarn workspace <project> test -watch

⚙️ Run Locally

Clone the project

Go to the project directory

Install dependencies

Start the docker containers

make compose-dev

Start the server

yarn start

📥 Adding Package to app

To add a package to an app, please follow this guide.

🚩 Deployment and build

Follow this guide to build all apps in projects.

👀 Usage

Work in progress...

🌍 Roadmap

Work in progress...

⚠️ License

All code in this repository is licensed under the MIT License.