How ymfe/yapi works
YApi is a collaborative API-management platform: users sign in, organize groups and projects, define and maintain interface documentation, then test interfaces or serve mocks. The server exposes API routes and plugin capabilities, while MongoDB is the documented deployment datastore. Additional branches cover data import/export, Swagger synchronization, wiki documentation, and usage statistics. The excerpts establish application startup, route registration, and several plugin-controller responsibilities; many core controller and client implementations were not sampled, so unverified connections are omitted or marked dashed.
Main entry points: Application.js Client application · router.js API router · app.js Koa application · Interface Interface editor
Components 23
Web application
- Client application
client/Application.js - Home and projects
client/containers/Home/Home.js - Project workspace
client/containers/Project - Group management
client/containers/Group - Interface editor
client/containers/Project/Interface - Interface testing
client/containers/Project/Interface/InterfaceList/Run/Run.js
API platform
- Koa application
server/app.js - API router
server/router.js - User API
server/controllers/user.js - Project API
server/controllers/project.js - Interface API
server/controllers/interface.js - Test collections
server/controllers/interfaceCol.js - Mock server
server/middleware/mockServer.js - Markdown rendering
common/markdown.js
Product extensions
- Mock expectations
exts/yapi-plugin-advanced-mock/controller.js - API import
exts/yapi-plugin-import-swagger - API export
exts/yapi-plugin-export-data/controller.js - OpenAPI export
exts/yapi-plugin-export-swagger2-data/controller.js - Swagger auto-sync
exts/yapi-plugin-swagger-auto-sync/controller/syncController.js - Project wiki
exts/yapi-plugin-wiki/controller.js - Usage statistics
exts/yapi-plugin-statistics/controller.js
Persistence
- MongoDB
Other components
- Platform user
Connections 23
- Platform user → Client application: uses
README.md - Client application → Home and projects: routes to
client/Application.js - Client application → Group management: routes to
client/Application.js - Client application → Project workspace: routes to
client/Application.js - Home and projects → Project workspace: opens
- Project workspace → Interface editor: manages
- Interface editor → Interface testing: runs
- Client application → Koa application: requests
- Koa application → API router: mounts
server/app.js - API router → User API: dispatches
server/router.js - API router → Project API: dispatches
server/router.js - API router → Interface API: dispatches
server/router.js - API router → Test collections: dispatches
server/router.js - Koa application → Mock server: installs
server/app.js - Interface editor → API import: imports formats
- Platform user → Mock expectations: configures expectations
- Platform user → API export: exports documentation
- Platform user → OpenAPI export: exports OpenAPI
- Platform user → Swagger auto-sync: configures sync
- Platform user → Project wiki: edits wiki
- Platform user → Usage statistics: views statistics
- API export → Markdown rendering: renders markdown
exts/yapi-plugin-export-data/controller.js - Koa application → MongoDB: connects to