-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(create-client): rename Client Generator in Create Client (#1603)
* docs(create-client): rename Client Generator in Create Client * Update create-client/vuetify.md Co-authored-by: Alan Poulain <[email protected]> Co-authored-by: Alan Poulain <[email protected]>
- Loading branch information
1 parent
5ab0df4
commit 41937aa
Showing
34 changed files
with
194 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# Next.js Generator | ||
|
||
![List screenshot](images/nextjs/create-client-nextjs-list.png) | ||
|
||
The Next.js generator scaffolds components for Server Side Rendered applications using [Next.js](https://nextjs.org/). | ||
|
||
## Install | ||
|
||
The easiest way to get started is to install [the API Platform distribution](../distribution/index.md). | ||
It contains a Next.js skeleton generated with Create Next App, | ||
a development Docker container to serve the webapp, and all the API Platform components you may need, including an API server | ||
supporting Hydra and OpenAPI. | ||
|
||
If you use API Platform, jump to the next section! | ||
|
||
Alternatively, create a Next.js application by executing: | ||
|
||
```console | ||
# using pnpm (recommended) | ||
pnpm create next-app --typescript | ||
# or using npm | ||
npm init next-app --typescript | ||
# or using yarn | ||
yarn create next-app --typescript | ||
``` | ||
|
||
Install the required dependencies: | ||
|
||
```console | ||
# using pnpm | ||
pnpm install isomorphic-unfetch formik react-query | ||
# or using npm | ||
npm install isomorphic-unfetch formik react-query | ||
# or using yarn | ||
yarn add isomorphic-unfetch formik react-query | ||
``` | ||
|
||
## Generating Routes | ||
|
||
If you use the API Platform distribution, generating all the code you need for a given resource is as simple as running the following command: | ||
|
||
```console | ||
docker compose exec pwa \ | ||
pnpm create @api-platform/client --resource book -g next | ||
``` | ||
|
||
Omit the resource flag to generate files for all resource types exposed by the API. | ||
|
||
If you don't use the standalone installation, run the following command instead: | ||
|
||
```console | ||
# using pnpm | ||
pnpm create @api-platform/client https://demo.api-platform.com . --generator next --resource book | ||
# or using npm | ||
npm init @api-platform/client https://demo.api-platform.com . --generator next --resource book | ||
# or using yarn | ||
yarn create @api-platform/client https://demo.api-platform.com . --generator next --resource book | ||
``` | ||
|
||
Replace the URL by the entrypoint of your Hydra-enabled API. | ||
You can also use an OpenAPI documentation with `-f openapi3`. | ||
|
||
The code has been generated, and is ready to be executed! | ||
|
||
## Starting the Project | ||
|
||
You can launch the server with | ||
|
||
```console | ||
# using pnpm | ||
pnpm dev | ||
# or using npm | ||
npm run dev | ||
# or using yarn | ||
yarn dev | ||
``` | ||
|
||
Go to `http://localhost:3000/books/` to start using your app. | ||
|
||
## Screenshots | ||
|
||
![List](images/nextjs/create-client-nextjs-list.png) | ||
![Show](images/nextjs/create-client-nextjs-show.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.