Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

A basic demo example for integrating between Appwrite & Next.js πŸ’™

Notifications You must be signed in to change notification settings

appwrite/demo-todo-with-nextjs

Repository files navigation

πŸ”– Todo With Next.js

Easter Eggs Claimed

A simple todo app built with Appwrite and Next.js. This repository serves the purpose of demonstrating SSR and JWT usage in a Next.js application.

If you simply want to try out the App, go ahead and check out the demo at https://appwrite-todo-with-nextjs.vercel.app/

🎬 Getting Started

🀘 Install Appwrite

Follow our simple Installation Guide to get Appwrite up and running in no time. You can either deploy Appwrite on your local machine or, on any cloud provider of your choice.

Note: If you setup Appwrite on your local machine, you will need to create a public IP so that your hosted frontend can access it.

We need to make a few configuration changes to your Appwrite server.

  1. Add a new Web App in Appwrite and enter the endpoint of your website (localhost, <project-name>.vercel.app etc) Create Web App

  2. Create a new collection with the following properties

  • Rules Add the following rules to the collection.

Make sure that your key exactly matches the key in the images

Content Rule

IsComplete Rule

  • Permissions Add the following permissions to your collections. These permissions ensure that only registered users can access the collection.

Collection Permissions

πŸš€ Deploy the Front End

You have two options to deploy the front-end and we will cover both of them here. In either case, you will need to fill in these environment variables that help your frontend connect to Appwrite.

  • REACT_APP_ENDPOINT - Your Appwrite endpoint
  • REACT_APP_PROJECT - Your Appwrite project ID
  • REACT_APP_COLLECTION_ID - Your Appwrite collection ID
  • REACT_APP_DATABASE_ID - Your Appwrite database ID

Deploy to a Static Hosting Provider

Use the following buttons to deploy to your favourite hosting provider in one click! We support Vercel for Next.js. You will need to enter the environment variables above when prompted.

Deploy with Vercel

Run locally

Follow these instructions to run the demo app locally

$ git clone https://github.com/appwrite/todo-with-nextjs
$ cd todo-with-nextjs

Run the following command to generate your .env vars

$ cp .env.example .env

Now fill in the envrionment variables we discussed above in your .env

Now run the following commands and you should be good to go πŸ’ͺ🏼

$ npm install
$ npm run dev

πŸ€• Support

If you get stuck anywhere, hop onto one of our support channels in discord and we'd be delighted to help you out 🀝

😧 Help Wanted

Our access credentials were recently compromised and someone tried to ruin these demos. They decided to leave behind 15 easter eggs πŸ₯š for you to discover. If you find them, submit a PR cleaning up that section of the code (One PR per person across all the repos). You can track the number of claimed Easter Eggs using the badge at the top.

The first 15 people to get their PRs merged will receive some Appwrite Swags 🀩 . Just head over to our Discord channel and share your PR link with us.

UPDATE 17-11-2021: The easter egg contest is now closed.

About

A basic demo example for integrating between Appwrite & Next.js πŸ’™

Topics

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published