Development
Architecture Overview
Flexydox splits the api generation process into two main parts:
- Create a unified documentation schema from the input configuration file which defines the api sources, custom pages, categories, and examples.
It will generate a
doc-schema.json
file, which schema is documented in the./docs/schemas/fxdx-doc-schema.md
file, and adoc-config.json
file which is an input configuration file for the renderer. - Render the documentation site using the schema. The renderer is an Astro site
that uses the
doc-config.json
anddoc-schema.json
files to generate the documentation site.
Prerequisites
- Node.js
- Pnpm
Installation
- Clone the repository
- Install dependencies
pnpm install
- Build the project
pnpm build
# build cli
pnpm build-cli
Running the tests
pnpm test
pnpm e2e
Development Workflow
flexydox -c ./fixtures/chess-game/flexydox.yaml build
# it should generate the doc-schema.json
# and doc-config.json in the ./_docs folder.
# Run the documentation site
pnpm dev
# It will run `dev` script
# from `packages/renderer/package.json`
# It will start the astro server at http://localhost:4321
# Renderer needs to have FXDX_DOC_CONFIG_FILE env variable set
# to the path of the generated doc-config.json file.
Project Structure
Files and Directories
docs
- Flexydox documentationexamples
- Example configurations and assets to showcase Flexydox featurespackages/*
- All libraries and application go herepackages/cli
- Flexydox cli applicationpackages/cli-e2e
- E2E tests for the cli apppackages/doc-provider
- Parses API schemas and generates unified DocSchema.packages/doc-schema
- Shared Typescript typespackages/logger
- logger librarypackages/renderer
- Astro site which renders a static documentation website from DocSchema.schemas
- JSON schemas to support the auto-completion in the configuration files.script
- Scripts to help with the development process- Dockerfile - Dockerfile to build the project