Skip to content

Latest commit

 

History

History
128 lines (93 loc) · 2.45 KB

File metadata and controls

128 lines (93 loc) · 2.45 KB

Appwrite Setup Guide

This guide will walk you through setting up Appwrite for TSBin manually using the Appwrite Console UI.

Prerequisites

  • Appwrite Cloud account or self-hosted instance
  • Project created in Appwrite

Step 1: Create Database

  1. Open your project in Appwrite Console
  2. Navigate to Databases from the left sidebar
  3. Click Create database
  4. Enter database ID: tsbin
  5. Enter name: TSBin Database
  6. Click Create

Step 2: Create Collection

  1. Inside the tsbin database, click Create collection
  2. Enter collection ID: trash
  3. Enter name: Trash Collection
  4. Click Create

Step 3: Add Attributes

Inside the trash collection, go to Attributes tab and add the following:

String Attributes

  1. slug

    • Type: String
    • Size: 255
    • Required: Yes
    • Click Create
  2. type

    • Type: String
    • Size: 10
    • Required: Yes
  3. passcode_hash

    • Type: String
    • Size: 255
    • Required: Yes
  4. encrypted_content

    • Type: String
    • Size: 1000000
    • Required: No
  5. encryption_meta

    • Type: String
    • Size: 10000
    • Required: No
  6. file_ids

    • Type: String
    • Size: 10000
    • Required: No

Other Attributes

  1. expires_at

    • Type: DateTime
    • Required: Yes
  2. size

    • Type: Integer
    • Min: 0
    • Max: 1073741824
    • Required: Yes

Step 4: Create Indexes

Go to Indexes tab and create:

  1. slug_index

    • Type: Key
    • Attributes: slug
    • Order: ASC
  2. expires_index

    • Type: Key
    • Attributes: expires_at
    • Order: ASC

Step 5: Set Permissions

Go to Settings tab:

  1. Under Permissions, add:
    • Role: Any
    • Permissions: Read, Create, Update, Delete

Step 6: Create Storage Bucket

  1. Navigate to Storage from the left sidebar
  2. Click Create bucket
  3. Enter bucket ID: trash-files
  4. Enter name: Trash Files
  5. Set permissions:
    • Role: Any
    • Permissions: Read, Create, Update, Delete
  6. Click Create

Step 7: Configure Environment Variables

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-files

Replace your-project-id-here with your actual Appwrite project ID (found in Project Settings).

Done

Your Appwrite setup is complete. You can now run the application:

pnpm dev