Template name
Roadmap voting app with Next.js.
This example showcases how to use Redis as a data store in a Next.js project.
The example is a roadmap voting application where users can enter and vote for feature requests. It features the following:
This example uses Upstash (Serverless Redis) as its data store, through the @upstash/redis client. The Deploy button installs the Upstash integration from the Vercel Marketplace, which creates a Redis database and adds its credentials to your project.
Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:
npx create-next-app --example with-redis roadmapyarn create next-app --example with-redis roadmappnpm create next-app --example with-redis roadmapDeploy it to the cloud with Vercel (Documentation).
To run it locally, create a database in the Upstash Console, copy .env.example to .env.local, and fill in UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN. If you deployed with the button, vercel env pull writes the credentials for you; Redis.fromEnv() reads either the UPSTASH_REDIS_REST_* or the KV_REST_API_* names the integration provides.
