Documentation

Appwrite Setup

We will be using Appwrite as our backend.

Environment Variables

In the environment variables, we will using couple of variables that are required to setup Appwrite.

.env.local
APPWRITE_PROJECTID=<your-project-id>
APPWRITE_ENDPOINT=https://whatever
APPWRITE_KEY=<your-secret-api-key>
APPWRITE_DATABASE_ID=<your-database-id> (follow the next section to setup the database)

You will find the api routes in the src/app/api folder.

Database setup

Appwrite has a no-sql database that we will be using to store the data. Create a database in Appwrite and add the database id to the environment variables.

APPWRITE_DATABASE_ID=<your-database-id>

In the database you have to create three collections:

  • teams
  • team_members
  • invitations

In the teams collection you have to create the following attributes:

  • name: <string>
  • created_by: <string>
  • avatar: <string or null>

In the team_members collection you have to create the following attributes:

  • member_user_id: <string>
  • team_id: <string>
  • role: <string or null>
  • invited_at: <datetime>

In the invitations collection you have to create the following attributes:

  • invitee_email: <email>
  • team_id: <string>
  • role: <string>
  • status: <string>
  • invitation_id: <string>

On this page