@blitzm/doccy

Doccy is a documentation tool for GRPC APIs.

Usage no npm install needed!

<script type="module">
  import blitzmDoccy from 'https://cdn.skypack.dev/@blitzm/doccy';
</script>

README

doccy

Overview

Doccy is a documentation tool for GRPC APIs.

Doccy includes a CLI program that can be used to generate a static JSON file that represents your GRPC Proto Spec.

Doccy also includes a React component that can use the generated JSON file to render documentation inside your website.

See the "./example" directory to see a minimal React application that shows the Doccy's <DoccyPage protojson={require('../doccyprotos.json')} /> component.

Creating a doccyprotos.json file

npm install @blitzm/doccy

# see usage
./node_modules/.bin/doccy --help

# generate a doccyprotos.json file from
# a directory containing .proto files
./node_modules/.bin/doccy -o doccyprotos.json ./path/to/protos/**/*.proto

Using the React Component

import { DoccyPage } from '@blitzm/doccy';

export function Documentation() {
  return (
    <DoccyPage protojson={require('./doccyprotos.json')} />
  );
}

System Requirements

Development

To develop doccy you can use the "./example" project.

There's an included script called ./doccy.sh that runs the doccy CLI from source using ts-node.

You can use this script to run the doccy CLI from source to generate test doccyprotos.json files.

The example project is a small React app that imports DoccyPage from the lib directory.

To develop the <DoccyPage /> component you can run the example app:

cd ./example
./doccy.sh -o doccyprotos.json ../../path/to/some/protos/**/*.proto
npm install
npm start

Running the Docker Image Locally

# build the image
docker build -t website .

# run the container (localhost:3000)
docker run --rm -it -p 3000:80 website`