Enjoy our curated collection of examples and solutions. Use these patterns to build your own robust and scalable applications.
MIT License
Enjoy our curated collection of examples and solutions. Use these patterns to build your own robust and scalable applications. We're going to be shipping new examples weekly. Stay tuned!
Multiple examples are being featured in Vercel's Templates, visit that page for more advanced filtering options.
Examples that have front matter metadata will create a new Draft template in Contentful, for more steps on how to publish a template, read Publishing Templates.
To quickly start contributing with a new example, run the following commands:
pnpm i
pnpm new-example
If the script above isn't used, make sure the example complies with the following:
.gitignore
similar to plop-templates/example/.gitignore
package.json
similar to plop-templates/example/package.json (usage of Next.js is optional). The license should be MIT
README.md
similar to plop-templates/example/README.md. The example has to be able to include a demo URL (the Vercel team will deploy it!) and if it requires environment variables, it must have a .env.example
file and instructions on how to set them up. Take bot-protection-datadome as an example.
.eslintrc.json
similar to plop-templates/example/.eslintrc.json
@vercel/examples-ui
, its usage can be seen in the plop template
If you would like the example to be featured in vercel.com/templates then also add the front matter metadata to the top of the readme, like in bot-protection-datadome. To know all the possible values for each metadata take a look at internal/fields.json
.
If you want to add related templates to your template, copy the slug
from the other template into the relatedTemplates
field, for example for vercel.com/templates/next.js/monorepo-turborepo the slug is monorepo-turborepo
, as written in solutions/monorepo/README.md
We use Husky to manage the pre-commit Git hook in this repo. Husky configures hooks automatically during install, so you don't need to do anything special to get them working, but if it fails to install, you can run the following command to install it manually:
pnpm run prepare
Code changes automatically go through Prettier and ESLint when you make a commit, please do not skip these steps unless they're broken and in that case let us known by creating an issue.
If you have any questions or suggestions about the docs, feel free to open a discussion, or submit a PR with your suggestions!