TopGit
GitHub Repo Review

YApi: Self-Hosted API Management Platform

YMFE/yapi
YTopGit review image for YMFE/yapi
Review by Topgit.dev for YMFE/yapi, with GitHub repository stats and README context.
Quick verdict

YApi is a self-hosted API management platform built by the YMFE team to give frontend, backend, and QA one place to define, mock, and test API interfaces. Its mock-expectation feature returns a specific canned response per request-filter rule instead of only random JSON. The tradeoff: you run and patch a Node.js and MongoDB service yourself โ€” there's no official Docker image.

Stars
โ˜… 27.7k
Forks
โ‘‚ 4.8k
Contributors
๐Ÿ‘ฅ 116
Language
JavaScript
License
Apache-2.0
Topic
API
Updated
Aug 2024

Why teams need a dedicated API management platform

Once an API has more than a couple of endpoints, three groups need the same information in three different formats: backend engineers know the real response shape, frontend engineers need a fake version of it before the endpoint ships, and QA needs a definition precise enough to script an assertion against. A shared doc or a pile of Postman collections passed around in chat drifts out of date within a sprint, and nobody notices until a request breaks in staging. YApi's approach is to make the interface definition itself the one artifact all three groups read and write, with the mock server and the test runner built directly on top of that same definition instead of living as separate tools someone has to keep in sync.

What is YApi

YApi is a self-hosted, visual API management platform the YMFE team built to connect frontend, backend, and QA around one shared interface definition. Each API gets a page describing its request/response shape in Json5, a Postman-style debug console, and a mock endpoint generated from that definition via Mock.js. You run it on your own infrastructure, backed by MongoDB, so interface data never leaves your network.

Core features of YApi

  • โœ“Interface response shape and docs are defined once, in Json5, and both the mock endpoint and the documentation page read from that same definition.
  • โœ“MockServer supports plain random mocking plus a 'mock expectation' mode that matches specific request-filter rules and returns a fixed expected response for each one.
  • โœ“Built-in Postman-style debug console for calling an endpoint and inspecting the response without leaving YApi.
  • โœ“Automated testing with assertions against the response, so a broken contract can fail a check instead of surfacing in the frontend.
  • โœ“Data import from Postman collections, HAR files, and Swagger data, so an existing collection doesn't have to be rebuilt by hand.
  • โœ“Flat permission model that the README describes as scaling to large, multi-team projects while staying easy to use for smaller ones.
  • โœ“Runs entirely inside your own network, so interface data never touches a third-party server.
  • โœ“A community plugin ecosystem covering SSO, CAS, and OAuth2 login, GitLab sync, and DingTalk bot notifications, built by outside contributors.
How this repository's GitHub stars have grown over time. Source: star-history.com.View the star history โ†—

Deploying YApi with yapi-cli

Deployment goes through YApi's own CLI. Install it with `npm install -g yapi-cli --registry https://registry.npm.taobao.org` โ€” note the registry flag points at Taobao's npm mirror, which is the exact command the README ships, so confirm that mirror is reachable from your network before you rely on it. Running `yapi server` launches a visual setup wizard: fill in the configuration, click through the deploy steps, and it writes out the site. Start the server itself with `node {site-path}/server/app.js`, then open the site in a browser and log in with the admin email you set during setup โ€” the default password is `ymfe.org`, changeable afterward from your profile. Requirements are Node.js 7.6+, MongoDB 2.6+, and git on the host. For process management, install pm2 globally and run `pm2 start "vendors/server/app.js" --name yapi`, with `pm2 info yapi`, `pm2 stop yapi`, and `pm2 restart yapi` for day-to-day control. Upgrades run through the same CLI: `yapi ls` lists available versions, `yapi update` moves to the latest, and `yapi update -v {version}` targets a specific one; the README says an upgrade only re-syncs the vendors directory and leaves existing project data alone. The README also links out to several unofficial Docker and docker-compose setups if you'd rather containerize it, though none of them are maintained by the core project.

Strengths

  • โœ“Free and fully open source under Apache-2.0, with interface data staying on infrastructure you control.
  • โœ“The mock-expectation system returns a specific fixed response per request-filter rule, not just random JSON โ€” useful for scripting edge cases in tests.
  • โœ“Import paths for Postman, HAR, and Swagger data mean an existing collection doesn't have to be re-entered by hand.
  • โœ“Permission model stays flat and simple while the README describes it as holding up on large, multi-team projects.
  • โœ“A real plugin ecosystem beyond the core โ€” SSO/CAS/OAuth2 login, GitLab sync, DingTalk notifications โ€” built by outside contributors.

Known limitations of YApi

  • โ–ณMongoDB is the only supported datastore โ€” there's no alternative backend, so a team without existing Mongo infrastructure is standing up a new piece of infrastructure just to run YApi.
  • โ–ณNo official Docker image. The README links to several community-maintained Docker and docker-compose setups instead of a first-party one.
  • โ–ณThe documented install command pulls yapi-cli from the Taobao npm mirror, a detail clearly aimed at users in China โ€” worth swapping to the default npm registry if that mirror doesn't work for you.
  • โ–ณThe default admin password after setup is a fixed string (`ymfe.org`) that has to be changed manually โ€” an easy step to skip in a rushed deployment.
  • โ–ณThe README's minimum Node.js version (7.6+) is old, and nothing in it confirms compatibility with a current Node LTS release.

YApi alternatives

Frequently asked questions

Is YApi free and open source?

YApi is free and open source, licensed under Apache-2.0, and it's designed for on-premise deployment so your interface data stays on servers you control instead of a third-party cloud.

How do I deploy YApi on a local server?

Deploying YApi starts with installing the yapi-cli tool via npm, then running `yapi server` to launch a visual setup wizard. Once configured, start the app with `node {site-path}/server/app.js` and, optionally, manage the running process with pm2.

What are the system requirements for YApi?

YApi requires Node.js 7.6 or later, MongoDB 2.6 or later, and git installed on the host before you run the yapi-cli deployment wizard.

Can I import Swagger or Postman data into YApi?

YApi's import feature accepts Postman collections, HAR files, and Swagger data, so an existing API collection can be brought into YApi instead of rebuilt by hand.

Does YApi support mock server functionality?

YApi ships a MockServer that returns randomized mock data automatically, plus a mock-expectation mode that matches specific request-filter rules and returns a fixed response for each one.

What programming languages does YApi support for code generation?

YApi's ecosystem includes community code-generation tools for TypeScript (yapi-to-typescript) and JavaScript (yapi-gen-js-code), plus a separate community project, SwiftJSONModeler, that generates Swift model code from YApi interface definitions.

Best use cases

  • โ€ขKeeping one interface contract that frontend, backend, and QA all read from during active feature development.
  • โ€ขMocking a dependent API before the real backend endpoint exists, so frontend work isn't blocked on backend sequencing.
  • โ€ขRunning automated response assertions as a regression check when an API contract changes.
  • โ€ขMigrating an existing Postman or Swagger collection into a shared, internally hosted docs hub.
  • โ€ขEnterprise setups that need a permission model flexible enough for many teams and projects but simple enough not to need a dedicated admin.

Who should try it โ€” and who should skip

Try YApi if you're running a team where frontend, backend, and QA genuinely need the same interface definition and you're fine operating a Node.js and MongoDB service for it โ€” the mock-expectation feature in particular pays off once QA is writing real test scenarios instead of eyeballing random JSON. Skip it if you don't want to own a self-hosted service at all, or if your workflow is a single developer working solo and a lighter tool like json-server would cover the mocking need without the setup.

Related repositories

Source & attribution

Facts and feature details are drawn from the YMFE/yapi GitHub repository and its README (github.com/YMFE/yapi).

GitHub data ยท last synced Aug 15, 2026Reviewed by Henry
โ† Back to TopGit

Still deciding about yapi?

One click hands the question to an AI along with this page โ€” see what it says about yapi.

GitHub