Home

Awesome

Appwrite Next.js Authentication

Next.JS App that uses Appwrite as its backend. It features:

Setup

Installing dependencies

Clone this repository and install its dependencies:

  # npm
  npm install
  # or yarn
  yarn

Setting up Environment Variables

Create a .env.local file based on the .env.local.example file included in the project. It should have the following values:

ValueDescriptionExample
NEXT_PUBLIC_APPWRITE_HOSTNAMEThe URL where your Appwrite server is hosted. Include the protocol and no trailing slashhttps://appwrite.example.com
NEXT_PUBLIC_APPWRITE_PROJECT_IDYour Project ID generated by Appwrite. You can get it from Your Project > Settings > Project ID (Screenshot)abc123abc123
APPWRITE_SECRET_API_KEYAn API Key with permissions for users.read and users.write. (Screenshot)abcasdfpojo123432
ADMIN_TEAM_IDA team where all your users with Admin rights will be included. You can find the ID on Authentication > Teams > Select a team > Team ID. (Screenshot)863451289065430265436

Launching the project

Run the project by using

npm run dev
# Or
yarn dev

API Routes

RouteDescriptionRequirements
users/allGets an array with all the users that have registered in the app.User needs to be authenticated and part of the Admin team. Refer to Setting up Environment Variables for more information.
users/[id]Gets a single user based on their ID. If using me as the id, it will return the current user's profile.User needs to be authenticated to get their own profile, or to be part of the Admin team to get other users. Refer to Setting up Environment Variables for more information.

Support

If you need help with this app or found a bug, you can submit an issue on the Issues tab or by messaging me on Twitter @Axolodev

Screenshots

Simple login page with email and password fields User list on the home page. Every user has their name, email, and a link to their profile page. Very simple user profile. Just the user's name, email, and their first initial