b47f0a52e8
## Documentation / Examples Update Convex to 0.1.9, now including specific deploy instructions for Vercel. - [x] Make sure the linting passes by running `pnpm lint` - [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
47 lines
1.5 KiB
Markdown
47 lines
1.5 KiB
Markdown
# Convex
|
|
|
|
This example demonstrates the Convex global state management framework.
|
|
|
|
## Deploy your own
|
|
|
|
Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example):
|
|
|
|
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/convex&project-name=convex&repository-name=convex)
|
|
|
|
## How to use
|
|
|
|
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/), or [pnpm](https://pnpm.io) to bootstrap the example:
|
|
|
|
```bash
|
|
npx create-next-app --example convex convex-app
|
|
# or
|
|
yarn create next-app --example convex convex-app
|
|
# or
|
|
pnpm create next-app --example convex convex-app
|
|
```
|
|
|
|
Log in to Convex,
|
|
|
|
```bash
|
|
npx convex login
|
|
```
|
|
|
|
initialize a new Convex project,
|
|
|
|
```bash
|
|
npx convex init
|
|
```
|
|
|
|
and then run the following two commands in two different terminals:
|
|
|
|
```bash
|
|
npx convex dev
|
|
```
|
|
|
|
```bash
|
|
npm run dev
|
|
```
|
|
|
|
Once everything is working, commit your code and deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
|
|
|
|
Use `npx convex deploy && npm run build` as the build command and set the `CONVEX_DEPLOY_KEY` environmental variable in Vercel ([Documentation](https://docs.convex.dev/getting-started/deployment/hosting/vercel)).
|