Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARC-149 - fix doc generate issue #17

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 150 additions & 0 deletions scaffolder-templates/microservice-repo-bootstrap/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
<p align="center">
<a href="https://sourcefuse.github.io/arc-docs/arc-api-docs" target="blank"><img src="https://github.com/sourcefuse/loopback4-microservice-catalog/blob/master/docs/assets/logo-dark-bg.png?raw=true" width="180" alt="ARC Logo" /></a>
</p>

<p align="center">
ARC by SourceFuse is an open-source Rapid Application Development framework for developing cloud-native enterprise applications, utilizing prebuilt microservices and standardized architectures for deployment on private and public clouds.
</p>

<p align="center">
<a href="https://sonarcloud.io/summary/new_code?id=sourcefuse_loopback4-microservice-catalog" target="_blank">
<img alt="Sonar Quality Gate" src="https://img.shields.io/sonar/quality_gate/sourcefuse_loopback4-microservice-catalog?server=https%3A%2F%2Fsonarcloud.io&style=for-the-badge">
</a>
<a href="https://app.snyk.io/org/ashishkaushik/reporting?context[page]=issues-detail&project_target=%255B%2522sourcefuse%252Floopback4-microservice-catalog%2522%255D&project_origin=%255B%2522github%2522%255D&issue_status=%255B%2522Open%2522%255D&issue_by=Severity&table_issues_detail_cols=SCORE%257CCVE%257CCWE%257CPROJECT%257CEXPLOIT%2520MATURITY%257CAUTO%2520FIXABLE%257CINTRODUCED%257CSNYK%2520PRODUCT&v=1">
<img alt="Synk Status" src="https://img.shields.io/badge/SYNK_SECURITY-MONITORED-GREEN?style=for-the-badge">
</a>
<a href="./LICENSE">
<img src="https://img.shields.io/github/license/sourcefuse/loopback4-microservice-catalog?style=for-the-badge" alt="License" />
</a>
<a href="https://github.com/sourcefuse/loopback4-microservice-catalog/graphs/contributors" target="_blank">
<img alt="GitHub contributors" src="https://img.shields.io/github/contributors/sourcefuse/loopback4-microservice-catalog?style=for-the-badge">
</a>
<a href="https://www.npmjs.com/~sourceloop" target="_blank">
<img alt="sourceloop core downloads" src="https://img.shields.io/npm/dm/@sourceloop/core?style=for-the-badge">
</a>
<a href="https://loopback.io/" target="_blank">
<img alt="Pb Loopback" src="https://img.shields.io/badge/Powered%20by-Loopback 4-brightgreen?style=for-the-badge" />
</a>
<a href="https://nestjs.com/" target="_blank">
<img alt="Pb Loopback" src="https://img.shields.io/badge/Compatible%20With-NestJS-brightgreen?style=for-the-badge" />
</a>

</p>

## IMPORTANT NOTE

From v5 onwards our cli now supports workspaces, transfering the responsibility of managing dependencies from lerna to npm. We will be providing support for our older version v4 till 30th June 2024. For more details on how to migrate from older versions of lerna to latest lerna v7 [click here](https://lerna.js.org/docs/legacy-package-management).

# ARC API

ARC API (aka Sourceloop), is a collection of pre-built microservices designed to accelerate the development timeline for enterprise projects. These services address common challenges encountered by large enterprises during the development of cloud-native platforms for digital transformation initiatives or new product creation.Implemented as [LoopBack Extensions](https://loopback.io/doc/en/lb4/Extending-LoopBack-4.html), ARC API services can be seamlessly integrated into existing LoopBack or NestJS applications or generated as standalone services using the LoopBack Command-line interface.

> Watch our [introduction video](https://youtu.be/7_mReOx8RT0) to know more about ARC API.

## Getting Started

The easiest way to get started with ARC API is to use its command line interface which can be installed using `npm install -g @sourceloop/cli`. The cli provides quick ways to scaffold a monorepo project, add microservices provided by sourceloop to your projects and many other useful stuff.

> Checkout this step by step tutorial [here](packages/cli/tutorial.md).

## Pre-built Micro-services

There are currently 14 Microservices provided and actively maintained:

1. [Authentication Service](services/authentication-service)
2. [Audit Service](services/audit-service)
3. [OIDC Service](services/oidc-service)
4. [In-Mail Service](services/in-mail-service)
5. [Notification Service](services/notification-service)
6. [Scheduler Service](services/scheduler-service)
7. [Video Conferencing Service](services/video-conferencing-service)
8. [BPMN Service](services/bpmn-service)
9. [Chat Service](services/chat-service)
10. [Feature Toggle Service](services/feature-toggle-service)
11. [User Service](services/user-tenant-service)
12. [Payment Service](services/payment-service)
13. [Survey Service](services/survey-service)
14. [Search Service](services/search-service)

## Other Extensions

ARC API utilizes many LoopBack extensions in the micro-services provided, which are actively maintained by the ARC team.

<table>
<tr>
<th>Package Name</th>
<th>Repo</th>
<th>NPM</th>
</tr>
<tr>
<td>loopback4-authentication</td>
<td><a href="https://github.com/sourcefuse/loopback4-authentication">GitHub</a></td>
<td><a href="https://npmjs.com/package/loopback4-authentication">NPM</a></td>
</tr>
<tr>
<td>loopback4-authorization</td>
<td><a href="https://github.com/sourcefuse/loopback4-authorization">GitHub</a></td>
<td><a href="https://npmjs.com/package/loopback4-authorization">NPM</a></td>
</tr>
<tr>
<td>loopback4-ratelimiter</td>
<td><a href="https://github.com/sourcefuse/loopback4-ratelimiter">GitHub</a></td>
<td><a href="https://npmjs.com/package/loopback4-ratelimiter">NPM</a></td>
</tr>
<tr>
<td>loopback4-s3</td>
<td><a href="https://github.com/sourcefuse/loopback4-s3">GitHub</a></td>
<td><a href="https://npmjs.com/package/loopback4-s3">NPM</a></td>
</tr>
<tr>
<td>loopback4-soft-delete</td>
<td><a href="https://github.com/sourcefuse/loopback4-soft-delete">GitHub</a></td>
<td><a href="https://npmjs.com/package/loopback4-soft-delete">NPM</a></td>
</tr>
<tr>
<td>loopback4-kafka-client</td>
<td><a href="https://github.com/sourcefuse/loopback4-kafka-client">GitHub</a></td>
<td><a href="https://npmjs.com/package/loopback4-kafka-client">NPM</a></td>
</tr>
<tr>
<td>loopback4-helmet</td>
<td><a href="https://github.com/sourcefuse/loopback4-helmet">GitHub</a></td>
<td><a href="https://npmjs.com/package/loopback4-helmet">NPM</a></td>
</tr>
<tr>
<td>loopback4-notifications</td>
<td><a href="https://github.com/sourcefuse/loopback4-notifications">GitHub</a></td>
<td><a href="https://npmjs.com/package/loopback4-notifications">NPM</a></td>
</tr>
<tr>
<td>@sourceloop/audit-log</td>
<td><a href="https://github.com/sourcefuse/loopback4-audit-log">GitHub</a></td>
<td><a href="https://npmjs.com/package/@sourceloop/audit-log">NPM</a></td>
</tr>
<tr>
<td>@sourceloop/vault</td>
<td><a href="https://github.com/sourcefuse/loopback4-vault">GitHub</a></td>
<td><a href="https://npmjs.com/package/@sourceloop/vault">NPM</a></td>
</tr>
<tr>
<td>@loopback/sequelize</td>
<td><a href="https://github.com/loopbackio/loopback-next/tree/master/extensions/sequelize">GitHub</a></td>
<td><a href="https://npmjs.com/package/@loopback/sequelize">NPM</a></td>
</tr>
</table>

## Example Implementations

The [sandbox](./sandbox/) folder contains example applications and docker files that can be run independently to see the services in action. You can use [Docker Compose](https://docs.docker.com/compose/) to run the sandbox applications.

## Issues

If you've noticed a bug or have a question or have a feature request, [search the issue tracker](https://github.com/sourcefuse/loopback4-microservice-catalog/issues) to see if someone else in the community has already created a ticket. If not, go ahead and [make one](https://github.com/sourcefuse/loopback4-microservice-catalog/issues/new/choose)! All feature requests are welcome. Implementation time may vary. Feel free to contribute the same, if you can. If you think this project is useful, please star it. Appreciation really helps in keeping this open source project alive.

## Consulting

Let's talk about accelerating your next project with ARC API:

https://www.sourcefuse.com/lets-talk/


135 changes: 135 additions & 0 deletions scaffolder-templates/microservice-repo-bootstrap/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# <%= name %>

[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

## Getting Started

We develop all microservices in the same repository using monorepo concept. To setup the base of the project we are using [Lerna](https://github.com/lerna/lerna). Lerna is useful to manage monorepos.

## Developing

For development guidelines, refer [here](https://github.com/sourcefuse/biz-book-api/tree/master/DEVELOPING.md)

## Commit message guidelines

A good commit message should describe what changed and why.

Our commit messages are formatted according to
[Conventional Commits](https://conventionalcommits.org/), we use
[commitlint](https://github.com/marionebl/commitlint) to verify and enforce this
convention. These rules lead to more readable messages that are easy to follow
when looking through the project history. But also, we use the git commit
messages to generate change logs when publishing new versions.

### Commit Message Format

Each commit message consists of a **header**, a **body** and a **footer**. The
header has a special format that includes a **type**, an optional **scope** and
a **subject**:

```text
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```

#### type

The **type** must be one of the following:

- **feat**: A new feature
- **fix**: A bug fix
- **docs**: Documentation only changes
- **style**: Changes that do not affect the meaning of the code (white-space,
formatting, missing semi-colons, etc)
- **refactor**: A code change that neither fixes a bug nor adds a feature
- **perf**: A code change that improves performance
- **test**: Adding missing or correcting existing tests
- **build**: Changes that affect the build system or external dependencies
- **ci**: Changes to our CI configuration files and scripts
- **chore**: Changes to the auxiliary tools and libraries such as documentation
generation
- **revert**: Reverts a previous commit

#### scope

The **scope** must be a list of one or more packages contained in this monorepo.
Each scope name must match a directory name in
[packages/](https://github.com/sourcefuse/biz-book-api/tree/master/packages),
e.g. `core` or [services/](https://github.com/sourcefuse/biz-book-api/tree/master/services).

_Note: If multiple packages are affected by a pull request, don't list the
scopes as the commit linter currently only supports only one scope being listed
at most._

#### subject

The **subject** contains succinct description of the change:

- use the imperative, present tense: "change" not "changed" nor "changes"
- don't capitalize first letter
- no dot (.) at the end

#### body

The **body** provides more details, it should include the motivation for the
change and contrast this with previous behavior.

Just as in the subject, use the imperative, present tense: "change" not
"changed" nor "changes"a

Paragraphs or bullet points are ok (must not exceed 100 characters per line).
Typically a hyphen or asterisk is used for the bullet, followed by a single
space, with blank lines in between.

#### references

Its mandatory to add references to JIRA ticket you are resolving as part of the commit.

#### footer (optional)

The **footer** should contain any information about Breaking Changes introduced
by this commit.

This section must start with the upper case text `BREAKING CHANGE` followed by a
colon (`:`) and a space (``). A description must be provided, describing what
has changed and how to migrate from older versions.

### Tools to help generate a commit message

This repository has [commitizen](https://github.com/commitizen/cz-cli) support
enabled. Commitizen can help you generate your commit messages automatically.

And to use it, simply call `git commit`. The tool will help
you generate a commit message that follows the above guidelines.

## Releases

We are using semantic versioning so, the release management and tagging is automated based on that.

Since, we are using a monorepo with lerna, each microservice will have independent versioning and release. For identifying which services changed in any build cycle and deploy only those services using CI/CD pipeline, use the below commands in order.

```sh
lerna changed -p --toposort --loglevel silent
```

This will give modified services for selective deployment. This needs to be done at beginning of CD process. This will skip migrations. So that needs to be run everytime. `lerna run db:migrate` .

Alternatively, We can also use `--since {commit-hash}` flag with `lerna run` command to let lerna know that execute the command only in the services which have changed since the commit hash provided.

Command for releasing tags

Pre-release

```sh
HUSKY_SKIP_HOOKS=1 lerna version --conventional-commits --conventional-prerelease
```

Release

```sh
HUSKY_SKIP_HOOKS=1 lerna version --conventional-commits --conventional-graduate
```
8 changes: 8 additions & 0 deletions scaffolder-templates/microservice-repo-bootstrap/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
site_name: ${{values.component_id | dump}}
site_description: ${{values.description | dump}}

nav:
- Introduction: index.md

plugins:
- techdocs-core
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ spec:
action: run:extension
input:
extensions: ${{ parameters.packages }}
- id: fetch-docs
name: Fetch Docs
action: fetch:plain
input:
targetPath: ./
url: https://github.com/sourcefuse/loopback4-microservice-catalog/blob/master/README.md
- id: publish
name: Publish
action: publish:github
Expand Down