关于
Demo app for the API Platform framework
网站与应用开发可以做什么
- Bringing your Own Model - Search usage
- Model Scaffolding - Search usage
- Plugging the Persistence System - Search usage
- Exposing Enums with API Platform - Search usage
实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文
API Platform - Demo
This application is a demonstration for the API Platform Framework. Try it online at https://demo.api-platform.com.
Install
Read the official "Getting Started" guide.
$ git clone https://github.com/api-platform/demo.git
$ cd demo
$ docker compose up --wait
You can now go to https://localhost
Authentication and usage:
- Admin: the credentials are shown on https://localhost/admin You can create a Book with
https://openlibrary.org/books/OL2055137M.jsonas value for Book Reference - API:
- endpoints without the
/adminprefix are public and can be called without further step - endpoints with the
/adminprefix require an authentication: open https://localhost/docs then check the “openid” option under “Scopes” and click on “Authorize”. If you are not yet logged in on the API then log in with the credentials, and finally click on “Close”. You can now perform authenticated requests through the API, like listing books onGET /admin/books
- endpoints without the
Using the demo from an AI client (MCP)
The API exposes a Model Context Protocol server on https://localhost/mcp:
search_books and get_book are public, add_review publishes a review on behalf of the authenticated user.
With Claude Code:
$ claude mcp add --transport http --client-id api-platform-mcp demo https://localhost/mcp
Then ask Claude to list the books written by Dan Simmons, and to post a 5/5 review on Hyperion. As this tool requires an
authentication, Claude Code asks you to sign in: run /mcp, select the demo server, then "Authenticate". Log in with
[email protected] (password Pa55w0rd) and grant the access: the review is published, and shows up live on the
book page of the PWA.
With MCP Inspector: run npx @modelcontextprotocol/inspector,
connect to https://localhost/mcp with the "Streamable HTTP" transport and api-platform-mcp as OAuth client ID.
[!NOTE] The Keycloak realm is only imported on its first start. If you started the project before the MCP client was added, recreate the Keycloak database:
docker compose rm -sf keycloak keycloak-database && docker volume rm demo_keycloak_db_data && docker compose up --wait.
What Can I Find In This Demo?
This demo application contains several things you may be interested:
Note: this demo application implements OpenID Connect Specification Support (using Keycloak). See usage in API and usage in PWA.
Contributing
Credits
Created by Kévin Dunglas. Commercial support available at Les-Tilleuls.coop.
探索相关项目
加载中…