@backstage-community/plugin-tech-radar-backend
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

tech-radar

Welcome to the tech-radar backend plugin!

This plugin is an optional accompaniment the the tech-radar plugin. It uses the URL Reader service to retrieve tech radar response data from a URL, which must be provided in the config. This means a definition file can be stored in GitHub, versioned, and potentially consumed by other systems along with Backstage (and as long as Github is present in the integrations section of app-config.yaml, urlReader will handle authentication). The file must contain TechRadarLoaderResponse data in JSON format - can use this sample as a reference.

If using this plugin, make a modification to app-config.yaml to describe the source JSON:

techRadar:
  url: https://github.com/backstage/community-plugins/blob/main/workspaces/tech-radar/plugins/tech-radar-common/src/sampleTechRadarResponse.json

If you are storing the JSON file in a private repository, you will need to configure the proper integration in the app-config.yaml file. For more information on how to configure integrations, see the Backstage documentation.

Integrating into a backstage instance

This plugin needs to be added to an existing backstage instance.

# From your Backstage root directory
yarn --cwd packages/backend add @backstage-community/plugin-tech-radar-backend

New Backend System

The Tech Radar backend plugin has support for the new backend system, here's how you can set that up:

In your packages/backend/src/index.ts make the following changes:

  import { createBackend } from '@backstage/backend-defaults';
  const backend = createBackend();
  // ... other feature additions
+ backend.add(import('@backstage-community/plugin-tech-radar-backend'));
  backend.start();

Legacy Backend System

If still using the legacy backend, do the following:

Creating a src/plugins/techRadar.ts file and adding a reference to it to src/index.ts in the backend package.

techRadar.ts

import { createRouter } from '@backstage-community/plugin-tech-radar-backend';
import { Router } from 'express';
import { PluginEnvironment } from '../types';

export default async function createPlugin(
  env: PluginEnvironment,
): Promise<Router> {
  return await createRouter({
    logger: env.logger,
    config: env.config,
    reader: env.reader,
  });
}

src/index.ts

@@ -50,6 +50,7 @@ import scaffolder from './plugins/scaffolder';
 import proxy from './plugins/proxy';
 import search from './plugins/search';
 import techdocs from './plugins/techdocs';
+import techRadar from './plugins/techRadar';
 import techInsights from './plugins/techInsights';
 import todo from './plugins/todo';
 import graphql from './plugins/graphql';
@@ -133,6 +134,7 @@ async function main() {
     createEnv('tech-insights'),
   );
   const permissionEnv = useHotMemoize(module, () => createEnv('permission'));
+  const techRadarEnv = useHotMemoize(module, () => createEnv('techRadar'));

   const apiRouter = Router();
   apiRouter.use('/catalog', await catalog(catalogEnv));
@@ -152,6 +154,7 @@ async function main() {
   apiRouter.use('/badges', await badges(badgesEnv));
   apiRouter.use('/jenkins', await jenkins(jenkinsEnv));
   apiRouter.use('/permission', await permission(permissionEnv));
+  apiRouter.use('/tech-radar', await techRadar(techRadarEnv));
   apiRouter.use(notFoundHandler());

   const service = createServiceBuilder(module)

Readme

Keywords

none

Package Sidebar

Install

npm i @backstage-community/plugin-tech-radar-backend

Homepage

backstage.io

Weekly Downloads

1,599

Version

1.0.0

License

Apache-2.0

Unpacked Size

21.7 kB

Total Files

13

Last publish

Collaborators

  • patriko