Docusaurus API Integrator
This skill helps integrate the RAGAI Book Backend API into a Docusaurus documentation site. It automates the creation of the API service, the Chat Widget component, and provides guidance on configuration.
What This Skill Does
- •Creates
src/services/api.jsfor backend communication - •Creates
src/components/ChatWidget/index.jsfor the UI - •Configures Docusaurus for API integration
- •Provides guidance on environment variables and CORS
What This Skill Does NOT Do
- •Modify the backend code
- •Deploy the backend server
- •Setup the database
Before Implementation
Gather context to ensure successful implementation:
| Source | Gather |
|---|---|
| Codebase | Check if src/services and src/components directories exist. |
| Conversation | Confirm if the user wants to use the default localhost:8000 or a deployed URL. |
| Skill References | Use references/integration_guide.md for specific implementation details. |
Ensure all required context is gathered before implementing.
Workflow
- •Verify Structure: Ensure the Docusaurus project structure is standard (
src/exists). - •Create Service: Copy
assets/api.jstosrc/services/api.js. - •Create Component: Copy
assets/ChatWidget.jstosrc/components/ChatWidget/index.js. - •Environment Setup: Advise user on
docusaurus.config.jscustomFieldsfor API URL if needed. - •Usage Guide: Show how to embed
<ChatWidget />in markdown.
Reference Files
| File | When to Read |
|---|---|
references/integration_guide.md | For detailed API endpoints, payload structures, and troubleshooting. |
assets/api.js | The source code for the API service. |
assets/ChatWidget.js | The source code for the Chat Widget component. |
Output Checklist
- •
src/services/api.jscreated - •
src/components/ChatWidget/index.jscreated - • User informed about CORS and Environment Variables