Ponder

Appwrite Integration

How the Flutter client communicates with Appwrite TablesDB, Auth, Functions, and Storage.

Configuration

AppwriteConfig reads:

It declares:

Missing endpoint or project ID values throw a StateError.

Appwrite SDK Providers

appwrite_service.dart builds one Client and exposes SDK clients through providers:

In debug builds, the Appwrite client calls setSelfSigned(status: true).

TablesDB Access

TablesService uses low-level Client.call against TablesDB REST paths. It converts list responses into AppwriteRowList with total and rows.

Supported operations:

Services And Repositories

| Class | Backend access | | — | — | | AuthService | Appwrite Account email/password sessions and current user. | | ProfileService | Legacy Databases document access for profile rows, TablesService for feed tuning, Storage for profile images. | | SavedContentRepository | saved_items and content through TablesService. | | FeedRepository | content through TablesService. | | SearchRepository | content, fact_checks, saved_items, and hydrated content rows. | | FactCheckRepository | fact_checks, user_fact_check_history, content, and Function fact_check. | | FriendsService | friendships, users, shares, threads, thread_messages, and Function chat_write. | | LikeService | content_likes, content, and Function like_sync. | | PonderDataService | Shared older data access for content, saves, profiles, search, and fact checks. |

Function Execution

Flutter executes functions synchronously with xasync: false and ExecutionMethod.pOST.

FactCheckRepository sends:

{ "claim": "...", "userId": "..." }

FriendsService sends chat action payloads:

LikeService sends:

{ "contentId": "...", "action": "increment" }

or:

{ "contentId": "...", "action": "decrement" }

Row Permissions

The client and functions assign row permissions where row security matters:

Compatibility Handling

ProfileService has feed-tuning fallbacks for missing feedPreferences, boostedTags, or suppressedTags fields. FriendsService and chat_write support both current typed chat rows and older legacy article-share encoding.