### Install Appwrite on macOS and Linux Source: https://appwrite.io/docs/advanced/self-hosting/installation Use this command to start the Appwrite installation wizard on macOS and Linux systems. Ensure Docker CLI is installed. ```Bash docker run -it --rm \ --publish 20080:20080 \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \ --entrypoint="install" \ appwrite/appwrite:1.9.0 ``` -------------------------------- ### Navigate and Install Dependencies Source: https://appwrite.io/docs/tutorials/nextjs-ssr-auth/step-2 Change into your new project directory and install the necessary npm packages. ```Shell cd my-app npm install ``` -------------------------------- ### Appwrite Project Configuration Example Source: https://appwrite.io/docs/command-line Example of the 'appwrite.config.json' file created after initializing a project. ```json { "projectId": "", "endpoint": "https://.cloud.appwrite.io/v1" } ``` -------------------------------- ### Install Appwrite on Windows (CMD) Source: https://appwrite.io/docs/advanced/self-hosting/installation Execute this command in the Windows Command Prompt (CMD) to initiate the Appwrite installation. Docker CLI must be installed. ```CMD docker run -it --rm ^ --publish 20080:20080 ^ --volume //var/run/docker.sock:/var/run/docker.sock ^ --volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^ --entrypoint="install" ^ appwrite/appwrite:1.9.0 ``` -------------------------------- ### Install Appwrite on Windows (PowerShell) Source: https://appwrite.io/docs/advanced/self-hosting/installation Run this command in Windows PowerShell to start the Appwrite installation process. Docker CLI is required. ```PowerShell docker run -it --rm ` --publish 20080:20080 ` --volume /var/run/docker.sock:/var/run/docker.sock ` --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ` --entrypoint="install" ` appwrite/appwrite:1.9.0 ``` -------------------------------- ### Install Go Appwrite SDK Source: https://appwrite.io/docs/quick-starts/go Install the Appwrite SDK for Go to integrate Appwrite services into your application. ```sh go get github.com/appwrite/sdk-for-go ``` -------------------------------- ### Install Node.js Appwrite SDK Source: https://appwrite.io/docs/quick-starts/node Install the Node.js Appwrite SDK using npm. ```sh npm install node-appwrite ``` -------------------------------- ### Create TanStack Start App Source: https://appwrite.io/docs/products/sites/quick-start/tanstack-start Use this command to create a new TanStack Start application or set up the starter template. ```bash npm create @tanstack/start@latest ``` -------------------------------- ### Install Appwrite SDK Source: https://appwrite.io/docs/quick-starts/angular Install the Appwrite JavaScript SDK using npm. This command is run in the shell. ```Shell npm install appwrite ``` -------------------------------- ### Install React Navigation Source: https://appwrite.io/docs/tutorials/react-native/step-2 Install the core React Navigation library and the native stack navigator for implementing navigation. ```shell npm install @react-navigation/native @react-navigation/native-stack ``` -------------------------------- ### API Reference Prompt Example Source: https://appwrite.io/docs/tooling/ai/mcp-servers/docs Use this prompt to request a Python code example for listing all users. ```Text I want an example of how I can list all users in a Python app ``` -------------------------------- ### Install Appwrite SDK Source: https://appwrite.io/docs/quick-starts/python Install the Appwrite Python SDK using pip or uv. This makes the Appwrite functionalities available in your project. ```sh pip install appwrite ``` ```sh uv add appwrite ``` -------------------------------- ### Appwrite Go SDK Main Function Setup Source: https://appwrite.io/docs/quick-starts/go Initializes the Appwrite client with project and API keys, prepares the database, seeds it with data, and then calls functions to retrieve different sets of todos. Replace `` and `` with your actual credentials. ```go package main import ( "fmt" "github.com/appwrite/sdk-for-go/appwrite" "github.com/appwrite/sdk-for-go/client" "github.com/appwrite/sdk-for-go/tablesdb" "github.com/appwrite/sdk-for-go/id" "github.com/appwrite/sdk-for-go/models" "github.com/appwrite/sdk-for-go/query" ) var ( appwriteClient client.Client todoDatabase *models.Database todoTable *models.Table tablesDB *tablesdb.TablesDB ) func main() { appwriteClient = appwrite.NewClient( appwrite.WithProject(""), appwrite.WithKey(""), ) prepareDatabase() seedDatabase() getTodos() getCompletedTodos() getIncompleteTodos() } ``` -------------------------------- ### Install httparty for Ruby Source: https://appwrite.io/docs/products/functions/examples Installs the httparty library, which provides a get function for making HTTP requests. ```bash echo "gem 'httparty'" >> Gemfile bundle install ``` -------------------------------- ### Initialize a New Site with CLI Source: https://appwrite.io/docs/products/sites/deploy-from-cli Use this command to create a starter site project via the Appwrite CLI. Ensure you have installed and logged into the CLI, and initialized your Appwrite project. ```shell appwrite init sites ``` -------------------------------- ### Install http for Dart Source: https://appwrite.io/docs/products/functions/examples Installs the http library, which provides a get function for making HTTP requests. ```bash pub install http ``` -------------------------------- ### Create Go Project and Initialize Module Source: https://appwrite.io/docs/quick-starts/go Use these commands to create a new Go project directory and initialize a Go module. ```sh mkdir my-app cd my-app go mod init go-appwrite/main ``` -------------------------------- ### Install requests for Python Source: https://appwrite.io/docs/products/functions/examples Installs the requests library, which provides a get function for making HTTP requests. ```bash echo "requests" >> requirements.txt pip install -r requirements.txt ``` -------------------------------- ### Install guzzlehttp/guzzle for PHP Source: https://appwrite.io/docs/products/functions/examples Installs the guzzlehttp/guzzle library, which provides a get function for making HTTP requests. ```bash composer require guzzlehttp/guzzle ``` -------------------------------- ### Project Structure Example Source: https://appwrite.io/docs/products/sites/deploy-manually This illustrates a typical project directory structure for a web application, such as a SvelteKit app, before building. ```bash . ├ src/ ├ static/ ├ package.json ├ svelte.config.js ├ tsconfig.json └ vite.config.js ``` -------------------------------- ### Install iOS Pods Source: https://appwrite.io/docs/tutorials/react-native/step-2 For iOS projects, navigate to the ios directory and install CocoaPods to complete the React Navigation setup. ```shell cd ios pod install cd .. ``` -------------------------------- ### Create Deno Project Source: https://appwrite.io/docs/quick-starts/deno Create a new Deno project directory and a basic entry point file. ```shell mkdir my-app cd my-app echo "console.log('Hello, Deno!');" > mod.ts ``` -------------------------------- ### Get Tables Rows (Server Integration Example) Source: https://appwrite.io/docs/apis/rest Retrieves rows from a specific table within a database. This example demonstrates server-side authentication using an API key. ```APIDOC ## GET /v1/tablesdb/{databaseId}/tables/{tableId}/rows ### Description Retrieves rows from a specific table within a database. This example demonstrates server-side authentication using an API key. ### Method GET ### Endpoint /v1/tablesdb/{databaseId}/tables/{tableId}/rows ### Parameters #### Path Parameters - **databaseId** (string) - Required - The ID of the database. - **tableId** (string) - Required - The ID of the table. ### Headers - **X-Appwrite-Project**: [PROJECT-ID] - **X-Appwrite-Key**: [API_KEY] ### Request Example ```json GET /v1/tablesdb/{databaseId}/tables/{tableId}/rows HTTP/1.1 Content-Type: application/json X-Appwrite-Project: X-Appwrite-Key: [API_KEY] ``` ``` -------------------------------- ### Appwrite Configuration File Example Source: https://appwrite.io/docs/tooling/command-line/topics An example of the `appwrite.config.json` file after initializing a project and pulling topics. It shows the structure for projectId, endpoint, and the topics array with their configurations. ```json { "projectId": "", "endpoint": "https://.cloud.appwrite.io/v1", "topics": [ { "$id": "N1IzUIJiOicGbhJye", "$createdAt": "2024-07-01T14:40:43.381+00:00", "$updatedAt": "2024-07-01T14:40:43.381+00:00", "name": "Anime", "emailTotal": 3, "smsTotal": 0, "pushTotal": 0, "subscribe": [ "users" ] }, { "$id": "eyJhbGciOiJIUzI1N", "$createdAt": "2024-07-01T14:41:19.029+00:00", "$updatedAt": "2024-07-01T14:41:28.751+00:00", "name": "Music", "emailTotal": 2, "smsTotal": 0, "pushTotal": 0, "subscribe": [ "users", "any" ] } ] } ``` -------------------------------- ### Node.js Function Entrypoint Example Source: https://appwrite.io/docs/products/functions/develop This Node.js example demonstrates a basic Appwrite Function entrypoint. It shows how to use the context object for logging and sending responses. The function handles GET requests differently from other methods. ```javascript import { Client } from 'node-appwrite'; // This is your Appwrite function // It's executed each time we get a request export default async ({ req, res, log, error }) => { // Why not try the Appwrite SDK? // // Set project and set API key // const client = new Client() // .setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID) // .setKey(req.headers['x-appwrite-key']); // You can log messages to the console log('Hello, Logs!'); // If something goes wrong, log an error error('Hello, Errors!'); // The `req` object contains the request data if (req.method === 'GET') { // Send a response with the res object helpers // `res.text()` dispatches a string back to the client return res.text('Hello, World!'); } // `res.json()` is a handy helper for sending JSON return res.json({ motto: 'Build like a team of hundreds_', learn: 'https://appwrite.io/docs', connect: 'https://appwrite.io/discord', getInspired: 'https://builtwith.appwrite.io', }); }; ``` -------------------------------- ### Appwrite Rust SDK Main Function Setup Source: https://appwrite.io/docs/quick-starts/rust This snippet shows the main function setup for a Rust application using the Appwrite SDK. It initializes the client, prepares the database, seeds it with data, and then retrieves the todos. ```rust use appwrite::Client; use appwrite::services::tables_db::TablesDB; use appwrite::id::ID; use appwrite::query::Query; use serde_json::json; #[tokio::main] async fn main() -> Result<(), Box> { let client = Client::new() .set_endpoint("https://.cloud.appwrite.io/v1") .set_project("") .set_key(""); let tables_db = TablesDB::new(&client); let (database_id, table_id) = prepare_database(&tables_db).await?; seed_database(&tables_db, &database_id, &table_id).await?; get_todos(&tables_db, &database_id, &table_id).await?; Ok(()) } ``` -------------------------------- ### Create Execution Source: https://appwrite.io/docs/references/cloud/server-nodejs/functions Triggers a function execution. The function execution starts asynchronously. You can monitor the status using the 'Get Execution' endpoint. ```APIDOC ## POST /functions/{functionId}/executions ### Description Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously. ### Method POST ### Endpoint /functions/{functionId}/executions ### Parameters #### Path Parameters - **functionId** (string) - Required - Function ID. #### Request Body - **body** (string) - Optional - HTTP body of execution. Default value is empty string. - **async** (boolean) - Optional - Execute code in the background. Default value is false. - **path** (string) - Optional - HTTP path of execution. Path can include query params. Default value is "/". - **method** (string) - Optional - HTTP method of execution. Default value is POST. - **headers** (object) - Optional - HTTP headers of execution. Defaults to empty. - **scheduledAt** (string) - Optional - Scheduled execution time in ISO 8601 format. DateTime value must be in future with precision in minutes. ### Response #### Success Response (201) - **multipart/form-data** - Execution details. ``` -------------------------------- ### Initialize Appwrite Client and Services Source: https://appwrite.io/docs/tutorials/react-native/step-3 Set up the Appwrite client with your project endpoint, project ID, and platform. Export instances of Account and TablesDB for use throughout your application. Remember to replace placeholder values with your actual project details. ```javascript import { Client, TablesDB, Account } from "react-native-appwrite"; const client = new Client(); client .setEndpoint("https://.cloud.appwrite.io/v1") .setProject("") // Replace with your project ID .setPlatform('com.example.idea-tracker'); export const account = new Account(client); export const tablesDB = new TablesDB(client); ``` -------------------------------- ### Initialize Appwrite Functions with CLI Source: https://appwrite.io/docs/products/functions/deploy-manually Use this command to create a starter function template. Paste your code into the generated file and folder. ```shell appwrite init functions ``` -------------------------------- ### Get QR Code for MFA Source: https://appwrite.io/docs/products/auth/mfa Generates a QR code resource URL from a given text, typically used for MFA setup. ```javascript const result = await avatars.getQR({ text: uri, size: 800, // optional margin: 0, // optional download: false // optional }); console.log(result); // Resource URL ``` -------------------------------- ### Create PHP Project Source: https://appwrite.io/docs/quick-starts/php Use Composer to initialize a new PHP project and install the Appwrite SDK. ```sh mkdir my-app cd my-app composer init ``` ```sh composer require appwrite/appwrite:15.0.0 ``` -------------------------------- ### Create Function Execution (Web) Source: https://appwrite.io/docs/references/cloud/client-web/functions Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously. ```javascript import { Client, Functions, ExecutionMethod } from "appwrite"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID const functions = new Functions(client); const result = await functions.createExecution({ functionId: '', body: '', // optional async: false, // optional xpath: '', // optional method: ExecutionMethod.GET, // optional headers: {}, // optional scheduledAt: '' // optional }); console.log(result); ``` -------------------------------- ### Run Nuxt.js Development Server Source: https://appwrite.io/docs/tooling/ai/quickstart-prompts/nuxt Starts the Nuxt.js development server with automatic opening in the browser on the specified port. Ensure you have the necessary dependencies installed. ```bash npm run dev -- --open --port 3000 ``` -------------------------------- ### MainActivity Implementation Source: https://appwrite.io/docs/quick-starts/android-java Sets up the main activity, initializes Appwrite, and handles UI component interactions for login, registration, and logout. ```java package ; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import androidx.appcompat.app.AppCompatActivity; import java.util.Map; import io.appwrite.models.Session; import io.appwrite.models.User; public class MainActivity extends AppCompatActivity { private static final String TAG = "MainActivity"; private EditText editTextEmail; private EditText editTextPassword; private Button buttonLogin; private Button buttonRegister; private TextView textViewStatus; private Button buttonLogout; private AppwriteHelper appwrite; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Initialize Appwrite appwrite = AppwriteHelper.getInstance(getApplicationContext()); setContentView(R.layout.activity_main); // Initialize UI components editTextEmail = findViewById(R.id.editTextEmail); editTextPassword = findViewById(R.id.editTextPassword); buttonLogin = findViewById(R.id.buttonLogin); buttonRegister = findViewById(R.id.buttonRegister); textViewStatus = findViewById(R.id.textViewStatus); buttonLogout = findViewById(R.id.buttonLogout); buttonLogin.setOnClickListener(v -> { String email = editTextEmail.getText().toString(); String password = editTextPassword.getText().toString(); appwrite.login(email, password, new AuthCallback() { @Override public void onSuccess(Session result) { Log.d(TAG, "Login successful: " + result.getUserId()); textViewStatus.setText("Logged in as: " + result.getUserId()); textViewStatus.setVisibility(View.VISIBLE); buttonLogout.setVisibility(View.VISIBLE); editTextEmail.setVisibility(View.GONE); editTextPassword.setVisibility(View.GONE); buttonLogin.setVisibility(View.GONE); buttonRegister.setVisibility(View.GONE); } @Override public void onError(Exception error) { Log.e(TAG, "Login failed: " + error.getMessage()); Toast.makeText(MainActivity.this, "Login failed: " + error.getMessage(), Toast.LENGTH_SHORT).show(); } }); }); buttonRegister.setOnClickListener(v -> { String email = editTextEmail.getText().toString(); String password = editTextPassword.getText().toString(); appwrite.register(email, password, new AuthCallback>>() { @Override public void onSuccess(User> result) { Log.d(TAG, "Registration successful: " + result.getId()); Toast.makeText(MainActivity.this, "Registration successful! Please login.", Toast.LENGTH_SHORT).show(); } @Override public void onError(Exception error) { Log.e(TAG, "Registration failed: " + error.getMessage()); Toast.makeText(MainActivity.this, "Registration failed: " + error.getMessage(), Toast.LENGTH_SHORT).show(); } }); }); buttonLogout.setOnClickListener(v -> { appwrite.logout(new AuthCallback() { @Override public void onSuccess(Object result) { Log.d(TAG, "Logout successful"); textViewStatus.setVisibility(View.GONE); buttonLogout.setVisibility(View.GONE); editTextEmail.setVisibility(View.VISIBLE); editTextPassword.setVisibility(View.VISIBLE); buttonLogin.setVisibility(View.VISIBLE); buttonRegister.setVisibility(View.VISIBLE); } @Override public void onError(Exception error) { Log.e(TAG, "Logout failed: " + error.getMessage()); Toast.makeText(MainActivity.this, "Logout failed: " + error.getMessage(), Toast.LENGTH_SHORT).show(); } }); }); } } ``` -------------------------------- ### Initialize Appwrite Client and Run Functions in Rust Source: https://appwrite.io/docs/tooling/ai/quickstart-prompts/rust Sets up the Appwrite client with endpoint, project ID, and API key. It then calls functions to prepare the database, seed it with data, and retrieve todos. ```Rust #[tokio::main] async fn main() -> Result<(), Box> { let client = Client::new() .set_endpoint("https://.cloud.appwrite.io/v1") .set_project("") .set_key(""); let tables_db = TablesDB::new(&client); let (database_id, table_id) = prepare_database(&tables_db).await?; seed_database(&tables_db, &database_id, &table_id).await?; get_todos(&tables_db, &database_id, &table_id).await?; Ok(()) } ``` -------------------------------- ### Run Appwrite Data Migration Source: https://appwrite.io/docs/advanced/self-hosting/production/updates Navigate to your Appwrite directory and execute this command to start the data migration process after installing a new version. This ensures data compatibility. ```Shell cd appwrite/ docker compose exec appwrite migrate ``` -------------------------------- ### Initialize Appwrite Client and Run App Logic Source: https://appwrite.io/docs/quick-starts/dart Sets up the Appwrite client with endpoint, project ID, and API key, then executes database preparation, seeding, and data retrieval functions. ```dart Future main() async { client .setEndpoint("https://.cloud.appwrite.io/v1") .setProject("") .setKey(""); await prepareDatabase(); await Future.delayed(const Duration(seconds: 1)); await seedDatabase(); await getTodos(); } ``` -------------------------------- ### Get Account (JWT Authentication Example) Source: https://appwrite.io/docs/apis/rest Retrieves the current authenticated user's account details using JWT authentication. This is typically used for server-to-server interactions on behalf of a user. ```APIDOC ## GET /v1/account (JWT Authentication) ### Description Retrieves the current authenticated user's account details using JWT authentication. This is typically used for server-to-server interactions on behalf of a user. ### Method GET ### Endpoint /v1/account ### Headers - **X-Appwrite-Project**: [PROJECT-ID] - **X-Appwrite-JWT**: [TOKEN] ### Request Example ```json GET /v1/account HTTP/1.1 Content-Type: application/json X-Appwrite-Project: X-Appwrite-JWT: [TOKEN] ``` ``` -------------------------------- ### Get Favicon using Appwrite SDK Source: https://appwrite.io/docs/products/avatars/favicons Retrieve a favicon from a remote website URL using the Appwrite SDK. This snippet demonstrates the basic setup and usage for fetching a favicon with specified dimensions. ```javascript import { Client, Avatars } from "appwrite"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') .setProject(''); const avatars = new Avatars(client); const result = avatars.getFavicon({ url: 'https://example.com', width: 100, height: 100 }); console.log(result); // Resource URL ``` -------------------------------- ### Appwrite Query String Example with Multiple Queries Source: https://appwrite.io/docs/apis/rest This example demonstrates how to construct a URL with multiple query strings, including a limit. ```text ?queries[0]={"method":"equal","column":"name","values":["John"]}&queries[1]={"method":"limit","values":[6]} ``` -------------------------------- ### Install Appwrite SDK and Pink UI Source: https://appwrite.io/docs/tutorials/nextjs/step-2 After creating the Next.js project, navigate into the project directory and install the Appwrite JavaScript SDK and the Pink UI library. ```Shell cd ideas-tracker npm install appwrite npm install "@appwrite.io/pink" ``` -------------------------------- ### Get File Preview with Transformations Source: https://appwrite.io/docs/products/storage/images Use the `getFilePreview` method from the Storage SDK to retrieve a transformed image. This example demonstrates setting width, gravity, quality, border, border color, border radius, and background color. ```javascript import { Client, Storage } from "appwrite"; const client = new Client(); const storage = new Storage(client); client .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID ; const result = storage.getFilePreview({ bucketId: 'photos', fileId: 'sunset.png', width: 1800, gravity: 'center', quality: '90', borderWidth: 5, borderColor: 'CDCA30', borderRadius: 15, background: 'FFFFFF' }); console.log(result.href); ``` -------------------------------- ### Get Screenshot using Dart SDK Source: https://appwrite.io/docs/references/cloud/server-dart/avatars Use the `getScreenshot` method from the Avatars service to capture a website's screenshot. This example demonstrates how to configure various optional parameters like viewport dimensions, theme, user agent, and output format. ```dart import 'package:dart_appwrite/dart_appwrite.dart'; import 'package:dart_appwrite/enums.dart' as enums; Client client = Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with Avatars avatars = Avatars(client); Uint8List result = await avatars.getScreenshot( url: 'https://example.com', headers: { "Authorization": "Bearer token123", "X-Custom-Header": "value" }, // (optional) viewportWidth: 1920, // (optional) viewportHeight: 1080, // (optional) scale: 2, // (optional) theme: enums.Theme.dark, // (optional) userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // (optional) fullpage: true, // (optional) locale: 'en-US', // (optional) timezone: enums.Timezone.africaAbidjan, // (optional) latitude: 37.7749, // (optional) longitude: -122.4194, // (optional) accuracy: 100, // (optional) touch: true, // (optional) permissions: [enums.BrowserPermission.geolocation, enums.BrowserPermission.notifications], // (optional) sleep: 3, // (optional) width: 800, // (optional) height: 600, // (optional) quality: 85, // (optional) output: enums.ImageFormat.jpeg, // (optional) ); ``` -------------------------------- ### Example Included Resource File (Functions) Source: https://appwrite.io/docs/command-line An example of a JSON file that would be included in the main configuration, defining a specific resource like a function. Paths within this file are resolved relative to this file's location. ```json [ { "$id": "", "name": "api", "runtime": "node-22", "path": "functions/api", "entrypoint": "src/main.js", "commands": "npm install", "execute": [], "events": [], "schedule": "", "timeout": 15, "enabled": true, "logging": true, "ignore": [ "node_modules", ".git" ], "scopes": [], "vars": [] } ] ``` -------------------------------- ### Verify Appwrite CLI Installation Source: https://appwrite.io/docs/command-line Check the installed version of the Appwrite CLI to verify the installation or update. ```shell appwrite -v ``` -------------------------------- ### Install Appwrite CLI with Linux/macOS Script Source: https://appwrite.io/docs/command-line Install the Appwrite CLI on Linux or macOS using a curl script for a dependency-free installation. ```shell curl -sL https://appwrite.io/cli/install.sh | bash ``` -------------------------------- ### Create Ruby Project Structure Source: https://appwrite.io/docs/tooling/ai/quickstart-prompts/ruby Initialize a new Ruby project and its Gemfile. This is the first step in setting up your application. ```shell mkdir my-app cd my-app bundle init ``` -------------------------------- ### Create Node.js Project Source: https://appwrite.io/docs/quick-starts/node Create a new Node.js CLI application and initialize it using npm. ```sh mkdir my-app cd my-app npm init ``` -------------------------------- ### Install Appwrite PHP SDK Source: https://appwrite.io/docs/tooling/ai/quickstart-prompts/php Install the Appwrite PHP SDK using Composer. This command fetches and installs version 15.0.0 of the SDK. ```shell composer require appwrite/appwrite:15.0.0 ``` -------------------------------- ### Initialize MCP Servers Configuration Source: https://appwrite.io/docs/tooling/ai/vibe-coding/zenflow Start with an empty 'mcpServers' object before adding specific server configurations. ```json { "mcpServers": {} } ``` -------------------------------- ### Install Appwrite SDK and Dependencies Source: https://appwrite.io/docs/quick-starts/react-native Install the Appwrite SDK for React Native and the necessary URL polyfill dependency using Expo's install command. ```sh npx expo install react-native-appwrite react-native-url-polyfill ``` -------------------------------- ### Example appwrite.config.json with Buckets Source: https://appwrite.io/docs/tooling/command-line/buckets A sample structure for the appwrite.config.json file, illustrating how bucket configurations are represented after initialization or pulling. ```json { "projectId": "", "endpoint": "https://.cloud.appwrite.io/v1", "buckets": [ { "$id": "", "$createdAt": "2024-06-21T16:20:25.516+00:00", "$updatedAt": "2024-06-21T16:21:16.855+00:00", "$permissions": [ "create(\"any\")", "read(\"any\")", "update(\"any\")", "delete(\"any\")" ], "fileSecurity": false, "name": "test", "enabled": true, "maximumFileSize": 5368709120, "allowedFileExtensions": [], "compression": "none", "encryption": true, "antivirus": true } ] } ``` -------------------------------- ### GET /databases/transactions/{transactionId} Source: https://appwrite.io/docs/references/cloud/client-web/databases Get a transaction by its unique ID. ```APIDOC ## GET /databases/transactions/{transactionId} ### Description Get a transaction by its unique ID. ### Method GET ### Endpoint /databases/transactions/{transactionId} ### Parameters #### Path Parameters - **transactionId** (string) - Required - Transaction ID. ### Response #### Success Response (200) - **Transaction** (object) - The transaction object. ``` -------------------------------- ### Initialize Appwrite Client in Go Source: https://appwrite.io/docs/quick-starts/go Initialize the Appwrite client with your project key and API key. Ensure you import the necessary Appwrite dependencies. ```go package main import ( "github.com/appwrite/sdk-for-go/appwrite" "github.com/appwrite/sdk-for-go/client" "github.com/appwrite/sdk-for-go/tablesdb" "github.com/appwrite/sdk-for-go/models" "github.com/appwrite/sdk-for-go/query" ) var ( appwriteClient client.Client todoDatabase *models.Database todoTable *models.Table tablesDB *tablesdb.TablesDB ) func main() { appwriteClient = appwrite.NewClient( appwrite.WithProject(""), appwrite.WithKey(""), ) } ``` -------------------------------- ### JWT Example Source: https://appwrite.io/docs/references/cloud/models/jwt Example of a JWT encoded string in JSON format. ```JSON { "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" } ``` -------------------------------- ### Install New Appwrite Version (PowerShell) Source: https://appwrite.io/docs/advanced/self-hosting/production/updates Use this command to install the next version of Appwrite on Windows PowerShell. Replace `` with the desired tag. Ensure you are in the parent directory of your Appwrite installation. ```PowerShell docker run -it --rm ` --publish 20080:20080 ` --volume /var/run/docker.sock:/var/run/docker.sock ` --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ` --entrypoint="upgrade" ` appwrite/appwrite: ``` -------------------------------- ### Initialize Appwrite Client and Services Source: https://appwrite.io/docs/quick-starts/apple Set up a singleton class to manage the Appwrite client and services. Replace placeholders with your project's region and ID. ```swift import Foundation import Appwrite import JSONCodable class Appwrite { var client: Client var account: Account public init() { self.client = Client() .setEndpoint("https://.cloud.appwrite.io/v1") .setProject("") self.account = Account(client) } public func onRegister( _ email: String, _ password: String ) async throws -> User<[String: AnyCodable]> { try await account.create( userId: ID.unique(), email: email, password: password ) } public func onLogin( _ email: String, _ password: String ) async throws -> Session { try await account.createEmailPasswordSession( email: email, password: password ) } public func onLogout() async throws { _ = try await account.deleteSession( sessionId: "current" ) } } ``` -------------------------------- ### Initialize Nuxt Project Source: https://appwrite.io/docs/quick-starts/nuxt Use this command to create a new Nuxt project and navigate into its directory. ```shell npx nuxi@latest init my-app && cd my app ``` -------------------------------- ### Install New Appwrite Version (CMD) Source: https://appwrite.io/docs/advanced/self-hosting/production/updates Use this command to install the next version of Appwrite on Windows CMD. Replace `` with the desired tag. Ensure you are in the parent directory of your Appwrite installation. ```CMD docker run -it --rm ^ --publish 20080:20080 ^ --volume //var/run/docker.sock:/var/run/docker.sock ^ --volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^ --entrypoint="upgrade" ^ appwrite/appwrite: ``` -------------------------------- ### Install New Appwrite Version (Unix) Source: https://appwrite.io/docs/advanced/self-hosting/production/updates Use this command to install the next version of Appwrite on Unix-based systems. Replace `` with the desired tag. Ensure you are in the parent directory of your Appwrite installation. ```Shell docker run -it --rm \ --publish 20080:20080 \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \ --entrypoint="upgrade" \ appwrite/appwrite: ``` -------------------------------- ### Configure Next.js Project Source: https://appwrite.io/docs/tutorials/nextjs-ssr-auth/step-2 Example prompts for creating a Next.js project. Choose 'Yes' for App Router. ```Shell What is your project named? my-app Would you like to use TypeScript? No Would you like to use ESLint? No Would you like to use Tailwind CSS? No Would you like to use `src/` directory? Yes Would you like to use App Router? (recommended) Yes Would you like to customize the default import alias (@/*)? No What import alias would you like configured? [Enter] ```