https://github.com/thatbeautifuldream/react-api-ref
OpenAPI Docs Viewer
https://github.com/thatbeautifuldream/react-api-ref
api-docs openapi swagger
Last synced: 11 months ago
JSON representation
OpenAPI Docs Viewer
- Host: GitHub
- URL: https://github.com/thatbeautifuldream/react-api-ref
- Owner: thatbeautifuldream
- Created: 2025-03-10T23:00:42.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-03-10T23:27:46.000Z (11 months ago)
- Last Synced: 2025-03-11T00:19:27.611Z (11 months ago)
- Topics: api-docs, openapi, swagger
- Language: TypeScript
- Homepage: https://api.milind.app
- Size: 126 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OpenAPI Documentation Viewer
This is a simple React application that renders OpenAPI/Swagger documentation using [@scalar/api-reference-react](https://github.com/scalar/scalar). The app allows you to view any OpenAPI specification by providing its URL.
## Features
- View OpenAPI/Swagger documentation in a modern, interactive interface
- Default documentation loaded from Scalar's Galaxy API
- Persists your last viewed API specification URL in localStorage
## View custom docs by running this script on your console with your openapi spec url
```js
const specUrl = "https://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/latest.yaml"; // replace with your spec url
localStorage.setItem("specUrl", specUrl);
```
## Getting Started
### Prerequisites
- Node.js (v14 or higher)
- npm or yarn
### Installation
1. Clone this repository:
```bash
git clone
cd
```
2. Install dependencies:
```bash
npm install
# or
yarn
```
3. Start the development server:
```bash
npm run dev
# or
yarn dev
```
The application will be available at `http://localhost:5173` by default.
## Usage
The application will load the Scalar Galaxy API documentation by default. To view a different OpenAPI specification:
1. Have your OpenAPI specification hosted somewhere accessible via URL
2. Update the URL in the application
3. The application will remember your last viewed specification URL
## Built With
- [React](https://reactjs.org/)
- [TypeScript](https://www.typescriptlang.org/)
- [Vite](https://vitejs.dev/)
- [@scalar/api-reference-react](https://github.com/scalar/scalar) - For rendering OpenAPI documentation
## License
This project is licensed under the MIT License.