-
Notifications
You must be signed in to change notification settings - Fork 307
chore: adds CLI to install docs #2205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
68d5c6e
f5edaf9
aaebc68
a1ea13c
2f09ee0
851a92b
dc726d5
0343611
f7f6d53
94211f3
8d8fe56
fa1dc6f
8b649a4
bd4b3a6
b25b756
30cab80
4b2aa4f
406a82d
730cf01
1edd5f0
2950396
1c9665b
7014a0d
540e33a
d1cabdd
dd218ee
7f2e16c
c694744
7a36ad8
49fed9b
8c8bd7c
84d71df
895cc9d
89dbd1e
868d419
2085f03
33718fc
7cb0731
8c103c3
b63cbb8
4669e51
8949a2c
27f6f7c
6d91705
be873ab
8d4e5ba
27dfd8d
0c317e1
7472fab
9b086a2
a822466
a7d7c0f
9c63573
38a103f
dbc9c35
b6aca5f
bb2da32
f0dbe48
03c8db4
684d7ab
9a1f5dc
ff79b22
a47e97e
8a3b5e9
7894313
00163ec
16cfdf5
402e8e9
0463efd
82406c3
9c960ec
f8ac7d7
c44d52d
b686b45
655646f
ee6c511
2515b12
3f76bd8
4367652
07d407b
99defad
1afb2f0
0f55eda
f8e92d4
5bdff31
715c83f
dd0c41f
5c98bdd
d70cce4
9f1318b
89b6e73
27c192b
b810195
9af6138
2bb217a
5279731
5424d25
dfc6d4c
7455b63
582f1eb
2d2c029
b2e2f29
5b3b007
3ba1b49
2e9a9a3
ccd8441
90a02af
fcf1140
44fa2fc
b2d6da6
2cb44b3
0b96316
4eb84b0
7c415e5
c05db4c
c8fea61
b007a0a
93766cf
c6f343f
f2b6ed6
9439793
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| --- | ||
| nav: | ||
| title: Extension Architecture | ||
| position: 1 | ||
| position: 10 | ||
| --- | ||
|
|
||
| # Extension Architecture | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| --- | ||
| nav: | ||
| title: Build and Watch Frontend | ||
| position: 40 | ||
| --- | ||
|
|
||
| # Build and Watch Frontend (Storefront & Administration) | ||
|
|
||
| Use these commands when developing or customizing the UI (Storefront or Administration), or developing extensions that affect the UI: | ||
|
|
||
| ```bash | ||
| # Build the administration (admin panel) | ||
| make build-administration | ||
|
|
||
| # Build the storefront (shop frontend) | ||
| make build-storefront | ||
|
|
||
| # Start a watcher to rebuild the Administration automatically when files change | ||
| make watch-admin | ||
|
|
||
| # Start a watcher for Storefront | ||
| make watch-storefront | ||
| ``` | ||
|
|
||
| ## Alternative: Run build and watch scripts without Make | ||
|
|
||
| You only need to run this step if you’re developing or customizing the frontend (Administration or Storefront). It compiles JavaScript and CSS assets so your changes are visible immediately. | ||
|
Check warning on line 27 in guides/development/extensions/frontend.md
|
||
|
|
||
| The created project contains bash scripts in the `bin/` folder to build and watch the Administration and Storefront. Run the following commands: | ||
|
|
||
| ```bash | ||
| ./bin/build-administration.sh | ||
| ./bin/build-storefront.sh | ||
| ./bin/watch-administration.sh | ||
| ./bin/watch-storefront.sh | ||
| ``` | ||
|
|
||
| Use these scripts to build the Administration and Storefront. The `watch` commands monitor changes to the Administration and Storefront and automatically rebuild them. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| --- | ||
| nav: | ||
| title: Authentication and API Requests | ||
| position: 20 | ||
| --- | ||
|
|
||
|
|
||
| # Authentication and API Requests | ||
|
|
||
| This guide builds on the [APIs](./index.md) guide and covers additional authentication details, practical request patterns, and troubleshooting for local development. | ||
|
|
||
| ## Local password-grant shortcut | ||
|
|
||
| The [APIs](./index.md) guide uses integrations with `client_credentials`, which should remain the default approach. | ||
|
|
||
| For local development only, you can also obtain an Admin API token with the default Administration credentials: | ||
|
|
||
| ```bash | ||
| curl -X POST "http://localhost:8000/api/oauth/token" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{ | ||
| "grant_type": "password", | ||
| "client_id": "administration", | ||
| "scopes": "write", | ||
| "username": "admin", | ||
| "password": "shopware" | ||
| }' | ||
| ``` | ||
|
|
||
| Example response: | ||
|
|
||
| ```json | ||
| { | ||
| "token_type": "Bearer", | ||
| "expires_in": 600, | ||
| "access_token": "...", | ||
| "refresh_token": "..." | ||
| } | ||
| ``` | ||
|
|
||
| Use this only as a local shortcut. For integrations and reproducible setups, prefer `client_credentials` as described in the [APIs](./index.md) guide. | ||
|
|
||
| ## Prefer search endpoints for real requests | ||
|
|
||
| For most real Admin API work, prefer search endpoints over simple entity listing routes. | ||
|
|
||
| Instead of: | ||
|
|
||
| ```bash | ||
| curl "http://localhost:8000/api/product" \ | ||
| -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ | ||
| -H "Content-Type: application/json" | ||
| ``` | ||
|
|
||
| use: | ||
|
|
||
| ```bash | ||
| curl -X POST "http://localhost:8000/api/search/product" \ | ||
| -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{}' | ||
| ``` | ||
|
|
||
| Search endpoints support: | ||
|
|
||
| - filtering | ||
| - sorting | ||
| - pagination | ||
| - associations | ||
|
|
||
| ## Download the OpenAPI schema | ||
|
|
||
| Shopware exposes OpenAPI schemas for both Admin API and Store API. These schemas are generated via PHP annotations using [swagger-php](https://github.com/zircote/swagger-php). When building custom endpoints, you can leverage these annotations to generate standardized documentation for them. | ||
|
|
||
| To work with the raw schema instead of the local browser reference, download it directly: | ||
|
|
||
| ```bash | ||
| curl -X GET "http://localhost:8000/api/_info/openapi3.json" \ | ||
| -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ | ||
| -o openapi.json | ||
| ``` | ||
|
|
||
| ::: warning | ||
| Due to security restrictions, your `APP_ENV` environment variable must be set to `dev` to access the specifications described below. | ||
| ::: | ||
|
|
||
| Raw schema endpoints: `/(api|store-api)/_info/openapi3.json`. | ||
|
|
||
| Entity schema endpoints: `/(api|store-api)/_info/open-api-schema.json`. | ||
|
|
||
| ## Troubleshooting local request failures | ||
|
|
||
| If you encounter errors like: | ||
|
|
||
| - `Table 'shopware.system_config' doesn't exist` | ||
| - `Table 'shopware.plugin' doesn't exist` | ||
| - `HTTP 500 on /api/_info/openapi3.json` | ||
|
|
||
| your database may not be initialized. | ||
|
|
||
| Run: | ||
|
|
||
| ```bash | ||
| docker compose exec web bin/console system:install --create-database --basic-setup | ||
| ``` | ||
|
|
||
| If issues persist: | ||
|
|
||
| ```bash | ||
| docker compose down -v | ||
| rm install.lock | ||
|
Check warning on line 111 in guides/development/integrations-api/auth-api-requests.md
|
||
| docker compose up -d | ||
| docker compose exec web bin/console system:install --create-database --basic-setup | ||
| ``` | ||
|
lasomethingsomething marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Next steps | ||
|
|
||
| Learn how to structure queries using: | ||
|
|
||
| - [Search Criteria](../integrations-api/search-criteria.md): encapsulates the entire search definition in one generic object | ||
| - [Request Headers](../integrations-api/request-headers.md): additional instructions | ||
| - [Partial Data Loading](../integrations-api/partial-data-loading.md) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| --- | ||
| nav: | ||
| title: Generated Reference | ||
| position: 30 | ||
| position: 60 | ||
|
|
||
| --- | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.