This guide will walk you through setting up Appwrite for TSBin manually using the Appwrite Console UI.
- Appwrite Cloud account or self-hosted instance
- Project created in Appwrite
- Open your project in Appwrite Console
- Navigate to Databases from the left sidebar
- Click Create database
- Enter database ID:
tsbin - Enter name:
TSBin Database - Click Create
- Inside the
tsbindatabase, click Create collection - Enter collection ID:
trash - Enter name:
Trash Collection - Click Create
Inside the trash collection, go to Attributes tab and add the following:
-
slug
- Type: String
- Size: 255
- Required: Yes
- Click Create
-
type
- Type: String
- Size: 10
- Required: Yes
-
passcode_hash
- Type: String
- Size: 255
- Required: Yes
-
encrypted_content
- Type: String
- Size: 1000000
- Required: No
-
encryption_meta
- Type: String
- Size: 10000
- Required: No
-
file_ids
- Type: String
- Size: 10000
- Required: No
-
expires_at
- Type: DateTime
- Required: Yes
-
size
- Type: Integer
- Min: 0
- Max: 1073741824
- Required: Yes
Go to Indexes tab and create:
-
slug_index
- Type: Key
- Attributes: slug
- Order: ASC
-
expires_index
- Type: Key
- Attributes: expires_at
- Order: ASC
Go to Settings tab:
- Under Permissions, add:
- Role: Any
- Permissions: Read, Create, Update, Delete
- Navigate to Storage from the left sidebar
- Click Create bucket
- Enter bucket ID:
trash-files - Enter name:
Trash Files - Set permissions:
- Role: Any
- Permissions: Read, Create, Update, Delete
- Click Create
Create a .env file in the app directory:
PUBLIC_APPWRITE_ENDPOINT=https://cloud.appwrite.io/v1
PUBLIC_APPWRITE_PROJECT_ID=your-project-id-here
PUBLIC_DATABASE_ID=tsbin
PUBLIC_COLLECTION_ID=trash
PUBLIC_STORAGE_BUCKET_ID=trash-filesReplace your-project-id-here with your actual Appwrite project ID (found in Project Settings).
Your Appwrite setup is complete. You can now run the application:
pnpm dev