This repository contains a simplified documentation website for Flash's GraphQL API. The documentation is automatically generated from the GraphQL schema.
- Clean, straightforward landing page with key integration examples
- Complete API reference generated from GraphQL schema
- Links to interactive GraphQL explorer
- Automated schema updates via GitHub Actions
- Advanced search functionality across API documentation
- Multi-language code examples with copy-to-clipboard
- Authentication flow diagram
- Pagination for better navigation
- Version selector with support for multiple API versions
- Version comparison tool showing changes between versions
- Node.js (v14+)
- npm or yarn
-
Clone this repository:
git clone <repository-url> cd flash-api-docs -
Install dependencies:
npm install -
Build the documentation:
npm run buildTo build with versioning support:
npm run build:versions -
Start the local server:
npm run dev
The documentation will be available at http://localhost:3000.
- Fetch the latest schema and rebuild:
npm run build
The documentation is automatically updated daily via GitHub Actions when the API schema changes. See the .github/workflows/update-docs.yml file for details.
This project uses GitHub Actions to automatically build and deploy the documentation to DigitalOcean App Platform when changes are pushed to the main branch.
- When code is pushed to the
mainbranch, a GitHub Actions workflow is triggered - The workflow:
- Sets up a Node.js environment
- Installs dependencies
- Fetches the latest GraphQL schema from the Flash API
- Builds the static documentation site
- Deploys the built site to DigitalOcean App Platform
For full details on the deployment process, see DEPLOYMENT.md.
You can also manually trigger the deployment from the GitHub Actions tab in the repository.
- Configure
docs.flashapp.mein your DigitalOcean App Platform settings - Update DNS records to point to the DigitalOcean App Platform
- Enable HTTPS
The DigitalOcean App is configured as a static site with:
- Source: GitHub repository
- Build Command: Managed by GitHub Actions (see workflow)
- Output Directory:
public
-
src/- Source filesindex.html- Custom landing page templatejs/- JavaScript filesversion-manager.js- Version selector componentversion-router.js- Version routing systemversion-comparison.js- Version comparison tool
stylesheets/- CSS filesversion-selector.css- Styles for version selector
-
public/- Generated website filesindex.html- Landing page with integration examplesspec.html- Full API reference documentationstylesheets/- Generated CSSjavascripts/- Generated JavaScriptimages/- Logos and iconsv1.1.0/- Version 1.1.0 documentation (generated by build:versions)beta/- Beta version documentation (generated by build:versions)versions.json- Version manifest
-
schema.graphql- The current GraphQL schema definition -
schema.v1.1.0.graphql- Version 1.1.0 GraphQL schema -
schema.beta.graphql- Beta version GraphQL schema -
spectaql-config.yml- Configuration for SpectaQL -
build-versions.js- Script to build versioned documentation -
VERSION.md- Version information and changelog
To customize the documentation:
- Edit the
spectaql-config.ymlfile to update metadata and description - Modify the landing page in
src/index.html - Run
npm run buildto apply changes
To customize version information:
- Update the
versionsarray insrc/js/version-manager.js - Modify version details in
build-versions.js - Update
VERSION.mdto reflect changes - Run
npm run build:versionsto rebuild with versioning support
The documentation includes a powerful search feature that allows developers to quickly find specific types, queries, mutations, and fields within the API reference.
- The search functionality indexes all headings and descriptions in the documentation when the page loads
- As users type in the search box, results are filtered in real-time
- Results show the matched content with type information
- Clicking a result scrolls directly to that section of the documentation
- The selected section is highlighted briefly to make it easy to locate
The search is built with vanilla JavaScript and consists of several components:
- search-loader.js: Ensures the search is properly initialized
- search.js: Core search implementation with indexing and result filtering
- search.css: Styling for the search interface
The implementation uses debouncing to prevent excessive searching while typing, and includes highlighting of search results for better visibility.