This is an internal repository for PowerOffice that hosts the official documentation for the PowerOffice Go API. The repository contains a React-based web application that uses Swagger UI to display and interact with the PowerOffice Go API documentation.
The main purpose of this repository is to:
- Provide interactive API documentation for PowerOffice Go API
- Host OpenAPI/Swagger specifications for the API
- Deploy the documentation automatically to Azure Static Web Apps
- Maintain version-controlled API documentation accessible to internal teams and partners
- Frontend Framework: React 18 with Vite
- API Documentation: Swagger UI React
- Build Tool: Vite
- Deployment: Azure Static Web Apps
- CI/CD: GitHub Actions
.
├── .github/workflows/ # GitHub Actions workflows
├── src/ # React application source code
├── openapi/ # OpenAPI/Swagger specification files
│ ├── swagger.json # Main OpenAPI specification
│ └── SimplifySchemaNames.cjs # Script to simplify .NET type names
├── docs/ # Additional documentation assets
├── index.html # Main HTML entry point
├── package.json # Node.js dependencies and scripts
└── vite.config.js # Vite configuration
The repository uses GitHub Actions for automated building and deployment to Azure Static Web Apps. The workflow is defined in .github/workflows/azure-static-web-apps-gray-stone-017611203.yml.
The CI/CD pipeline is triggered on:
- Push events to the following branches:
main(production)dev(development)staging(staging environment)
- Pull request events (opened, synchronize, reopened, closed) targeting the
mainbranch
The workflow consists of two main jobs:
This job runs when code is pushed or a pull request is opened/updated:
- Checkout Code: Retrieves the repository code including submodules
- Setup Node.js: Installs Node.js 18 with npm caching for faster builds
- Simplify Schema Names: Runs a preprocessing script (
SimplifySchemaNames.cjs) that:- Processes the
swagger.jsonfile - Simplifies verbose .NET type names in the OpenAPI schemas
- Removes unnecessary namespace and assembly information
- Makes the API documentation more readable
- Processes the
- Install Dependencies: Runs both
npm installandnpm cisequentially to ensure all required packages are installed correctly - Build Application: Executes
npm run buildto:- Compile the React application
- Bundle assets using Vite
- Generate production-ready static files in the
dist/directory
- Deploy to Azure: Uses the Azure Static Web Apps deployment action to:
- Upload the built application from the
dist/directory - Deploy to Azure Static Web Apps
- Add deployment status comments on pull requests
- Upload the built application from the
This job runs when a pull request is closed:
- Removes the staging deployment associated with the pull request
- Cleans up temporary preview environments
The workflow uses the following secrets (configured in GitHub repository settings):
AZURE_STATIC_WEB_APPS_API_TOKEN_GRAY_STONE_017611203: Azure deployment token for authenticationGITHUB_TOKEN: Automatically provided by GitHub for PR comments and integrations
- Node.js 18 or higher
- npm (comes with Node.js)
-
Clone the repository:
git clone https://github.com/PowerOffice/go-api-documentation.git cd go-api-documentation -
Install dependencies:
npm install
-
(Optional) Simplify schema names in the OpenAPI specification:
node ./openapi/SimplifySchemaNames.cjs ./openapi/swagger.json
-
Start the development server:
npm run dev
-
Open your browser to the URL shown in the terminal (typically
http://localhost:5173)
To create a production build:
npm run buildThe built files will be in the dist/ directory.
To preview the production build locally:
npm run previewDeployments are handled automatically by GitHub Actions:
- Pushes to
maindeploy to the production environment - Pushes to
devandstagingdeploy to their respective environments - Pull requests create temporary preview deployments
Manual deployments are not typically necessary, but if needed, ensure you have the appropriate Azure credentials configured.
This is an internal PowerOffice repository. When contributing:
- Create a feature branch from
main - Make your changes
- Test locally using
npm run dev - Create a pull request targeting
main - The GitHub Actions workflow will automatically build and create a preview deployment
- After review and approval, merge to
mainto deploy to production
Note: Direct pushes to dev and staging branches will also trigger deployments to their respective environments.
For questions or issues related to this repository, please contact the PowerOffice development team.