rsnext/examples/with-redis
Nick Babcock 5629223407
Update examples to use React 17 (#26133)
[With next 11 requiring react 17](https://nextjs.org/blog/next-11#upgrade-guide), most of the examples
need to be updated, so the following snippet updated all the examples to
a compatible react version.

```bash
cd examples/
fd -g 'package.json' | xargs sed -r -i 's/"react": ".*"/"react": "^17.0.2"/
fd -g 'package.json' | xargs sed -r -i 's/"react-dom": ".*"/"react-dom": "^17.0.2"/'

# exclude experimental react version
git checkout with-reason-relay/package.json
```
2021-06-16 16:43:26 +00:00
..
lib Update Redis example to use Tailwind. (#23131) 2021-03-17 21:11:57 +00:00
pages Update Redis example to use Tailwind. (#23131) 2021-03-17 21:11:57 +00:00
public Update Redis example to use Tailwind. (#23131) 2021-03-17 21:11:57 +00:00
styles Update Redis example to use Tailwind. (#23131) 2021-03-17 21:11:57 +00:00
.gitignore example application on Redis (Lambda.store) (#15532) 2020-08-07 01:34:02 +00:00
package.json Update examples to use React 17 (#26133) 2021-06-16 16:43:26 +00:00
postcss.config.js Update Redis example to use Tailwind. (#23131) 2021-03-17 21:11:57 +00:00
README.md Update Redis example to use Tailwind. (#23131) 2021-03-17 21:11:57 +00:00
tailwind.config.js Update Redis example to use Tailwind. (#23131) 2021-03-17 21:11:57 +00:00

Redis Example (with Upstash)

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:

  • Users can add and upvote items (features in the roadmap)
  • Users can enter their email addresses to be notified about the released items.
  • The API records the ip-addresses of the voters, so it does not allow multiple votes on the same item from the same IP address.

Demo

Deploy Your Own

This examples uses Upstash (Serverless Redis Database) as its data storage. During deployment, you will be asked to connect with Upstash. The integration will help you create a free Redis database and link it to your Vercel project automatically.

Deploy with Vercel

How to use

Execute create-next-app with npm or Yarn to bootstrap the example:

npx create-next-app --example with-redis roadmap
# or
yarn create next-app --example with-redis roadmap

Deploy it to the cloud with Vercel (Documentation).