diff --git a/.github/workflows/index.yml b/.github/workflows/index.yml new file mode 100644 index 0000000000..993d35596b --- /dev/null +++ b/.github/workflows/index.yml @@ -0,0 +1,23 @@ +name: Search Index + +on: + push: + branches: + - main + +jobs: + indexing: + runs-on: ubuntu-latest + name: Indexing + steps: + - uses: actions/checkout@v4 + with: + repository: 'meilisearch/scrapix' + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + - run: yarn + - run: yarn start -c "$SCRAPIX_CONFIG" + env: + SCRAPIX_CONFIG: ${{ secrets.SCRAPIX_CONFIG }} diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000000..637821ef1a --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000..8d077191cc --- /dev/null +++ b/LICENSE @@ -0,0 +1,28 @@ +BSD 3-Clause License + +Copyright (c) 2023, Appwrite + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md index 5c91169b0c..911e1106df 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,43 @@ -# create-svelte +# Website 🖥️ -Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte). +[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) +[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) +[![appwrite.io](https://img.shields.io/badge/appwrite-.io-f02e65?style=flat-square)](https://appwrite.io) -## Creating a project +![Cover banner](https://github.com/appwrite/website/assets/31401437/0852817d-b482-4e06-a002-ee84b2a7052c) -If you're seeing this, you've probably already done this step. Congrats! +The Appwrite Website repo features the main Appwrite website, including our [homepage](https://appwrite.io), [docs](https://appwrite.io/docs), and upcoming blog. -```bash -# create a new project in the current directory -npm create svelte@latest +The Appwrite Website has been built with the following frameworks: -# create a new project in my-app -npm create svelte@latest my-app -``` +- [Svelte](https://svelte.dev/) +- [SvelteKit](https://kit.svelte.dev/) -## Developing +## Development -Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: +*If this is your first time setting up the repository, please run `pnpm install` inside the repo's directory.* +To get the repo up and running in your local environment, use the following command: ```bash -npm run dev - -# or start the server and open the app in a new browser tab -npm run dev -- --open +pnpm run dev ``` -## Building +> If you don't have `pnpm` available on your system, you can install it from the [official pnpm Installation website](https://pnpm.io/installation) -To create a production version of your app: +## Contributing -```bash -npm run build -``` +All code contributions, including those of people with commit access, must go through a pull request and be approved by a core developer before being merged. This is to ensure a proper review of all the code. + +We truly ❤️ pull requests! If you wish to help, you can learn more about how you can contribute to this project in the [contribution guide](./CONTRIBUTING.md). + +## Security + +For security issues, kindly email us at [security@appwrite.io](mailto:security@appwrite.io) instead of posting a public issue on GitHub. + +## Follow Us + +Join our growing community around the world! See our official [Blog](https://medium.com/appwrite-io). Follow us on [Twitter](https://twitter.com/appwrite), [Facebook Page](https://www.facebook.com/appwrite.io), [Facebook Group](https://www.facebook.com/groups/appwrite.developers/), and [Dev Community](https://dev.to/appwrite) or join our live [Discord server](https://appwrite.io/discord) for more help, ideas, and discussions. -You can preview the production build with `npm run preview`. +## License -> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. +This repository is available under the [BSD 3-Clause License](./LICENSE). diff --git a/package.json b/package.json index 7eba23b80e..6977417343 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "@melt-ui/pp": "^0.1.2", "@melt-ui/svelte": "^0.47.6", "@playwright/test": "^1.37.1", + "@sveltejs/adapter-node": "^1.3.1", "@sveltejs/adapter-static": "^2.0.3", "@sveltejs/kit": "^1.24.1", "@types/markdown-it": "^13.0.1", @@ -48,6 +49,7 @@ "@appwrite.io/pink-icons": "0.1.0-next.9", "@appwrite.io/repo": "github:appwrite/appwrite", "@fontsource/inter": "^5.0.8", + "dotenv": "^16.3.1", "highlight.js": "^11.8.0", "markdown-it": "^13.0.1", "motion": "^10.16.2" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 201f927b60..e3a3f74559 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,6 +17,9 @@ dependencies: '@fontsource/inter': specifier: ^5.0.8 version: 5.0.8 + dotenv: + specifier: ^16.3.1 + version: 16.3.1 highlight.js: specifier: ^11.8.0 version: 11.8.0 @@ -37,6 +40,9 @@ devDependencies: '@playwright/test': specifier: ^1.37.1 version: 1.38.0 + '@sveltejs/adapter-node': + specifier: ^1.3.1 + version: 1.3.1(@sveltejs/kit@1.25.0) '@sveltejs/adapter-static': specifier: ^2.0.3 version: 2.0.3(@sveltejs/kit@1.25.0) @@ -603,10 +609,86 @@ packages: resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==} dev: true + /@rollup/plugin-commonjs@25.0.4(rollup@3.28.0): + resolution: {integrity: sha512-L92Vz9WUZXDnlQQl3EwbypJR4+DM2EbsO+/KOcEkP4Mc6Ct453EeDB2uH9lgRwj4w5yflgNpq9pHOiY8aoUXBQ==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^2.68.0||^3.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@rollup/pluginutils': 5.0.4(rollup@3.28.0) + commondir: 1.0.1 + estree-walker: 2.0.2 + glob: 8.1.0 + is-reference: 1.2.1 + magic-string: 0.27.0 + rollup: 3.28.0 + dev: true + + /@rollup/plugin-json@6.0.0(rollup@3.28.0): + resolution: {integrity: sha512-i/4C5Jrdr1XUarRhVu27EEwjt4GObltD7c+MkCIpO2QIbojw8MUs+CCTqOphQi3Qtg1FLmYt+l+6YeoIf51J7w==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@rollup/pluginutils': 5.0.4(rollup@3.28.0) + rollup: 3.28.0 + dev: true + + /@rollup/plugin-node-resolve@15.2.1(rollup@3.28.0): + resolution: {integrity: sha512-nsbUg588+GDSu8/NS8T4UAshO6xeaOfINNuXeVHcKV02LJtoRaM1SiOacClw4kws1SFiNhdLGxlbMY9ga/zs/w==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^2.78.0||^3.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@rollup/pluginutils': 5.0.4(rollup@3.28.0) + '@types/resolve': 1.20.2 + deepmerge: 4.3.1 + is-builtin-module: 3.2.1 + is-module: 1.0.0 + resolve: 1.22.6 + rollup: 3.28.0 + dev: true + + /@rollup/pluginutils@5.0.4(rollup@3.28.0): + resolution: {integrity: sha512-0KJnIoRI8A+a1dqOYLxH8vBf8bphDmty5QvIm2hqm7oFCFYKCAZWWd2hXgMibaPsNDhI0AtpYfQZJG47pt/k4g==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@types/estree': 1.0.1 + estree-walker: 2.0.2 + picomatch: 2.3.1 + rollup: 3.28.0 + dev: true + /@sinclair/typebox@0.27.8: resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} dev: true + /@sveltejs/adapter-node@1.3.1(@sveltejs/kit@1.25.0): + resolution: {integrity: sha512-A0VgRQDCDPzdLNoiAbcOxGw4zT1Mc+n1LwT1OmO350R7WxrEqdMUChPPOd1iMfIDWlP4ie6E2d/WQf5es2d4Zw==} + peerDependencies: + '@sveltejs/kit': ^1.0.0 + dependencies: + '@rollup/plugin-commonjs': 25.0.4(rollup@3.28.0) + '@rollup/plugin-json': 6.0.0(rollup@3.28.0) + '@rollup/plugin-node-resolve': 15.2.1(rollup@3.28.0) + '@sveltejs/kit': 1.25.0(svelte@4.2.0)(vite@4.4.9) + rollup: 3.28.0 + dev: true + /@sveltejs/adapter-static@2.0.3(@sveltejs/kit@1.25.0): resolution: {integrity: sha512-VUqTfXsxYGugCpMqQv1U0LIdbR3S5nBkMMDmpjGVJyM6Q2jHVMFtdWJCkeHMySc6mZxJ+0eZK3T7IgmUCDrcUQ==} peerDependencies: @@ -766,6 +848,10 @@ packages: resolution: {integrity: sha512-SnHmG9wN1UVmagJOnyo/qkk0Z7gejYxOYYmaAwr5u2yFYfsupN3sg10kyzN8Hep/2zbHxCnsumxOoRIRMBwKCg==} dev: true + /@types/resolve@1.20.2: + resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} + dev: true + /@types/semver@7.5.0: resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==} dev: true @@ -1231,6 +1317,11 @@ packages: readable-stream: 3.6.2 dev: true + /builtin-modules@3.3.0: + resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} + engines: {node: '>=6'} + dev: true + /busboy@1.6.0: resolution: {integrity: sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==} engines: {node: '>=10.16.0'} @@ -1428,6 +1519,10 @@ packages: engines: {node: ^12.20.0 || >=14} dev: true + /commondir@1.0.1: + resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} + dev: true + /component-emitter@1.3.0: resolution: {integrity: sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==} dev: true @@ -1671,6 +1766,11 @@ packages: domhandler: 5.0.3 dev: true + /dotenv@16.3.1: + resolution: {integrity: sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==} + engines: {node: '>=12'} + dev: false + /eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: true @@ -1913,6 +2013,10 @@ packages: engines: {node: '>=4.0'} dev: true + /estree-walker@2.0.2: + resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} + dev: true + /estree-walker@3.0.3: resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} dependencies: @@ -2118,6 +2222,10 @@ packages: dev: true optional: true + /function-bind@1.1.1: + resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} + dev: true + /gauge@4.0.4: resolution: {integrity: sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} @@ -2280,6 +2388,13 @@ packages: kind-of: 4.0.0 dev: true + /has@1.0.3: + resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} + engines: {node: '>= 0.4.0'} + dependencies: + function-bind: 1.1.1 + dev: true + /hey-listen@1.0.8: resolution: {integrity: sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q==} dev: false @@ -2418,6 +2533,19 @@ packages: resolution: {integrity: sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==} dev: true + /is-builtin-module@3.2.1: + resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} + engines: {node: '>=6'} + dependencies: + builtin-modules: 3.3.0 + dev: true + + /is-core-module@2.13.0: + resolution: {integrity: sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==} + dependencies: + has: 1.0.3 + dev: true + /is-data-descriptor@0.1.4: resolution: {integrity: sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==} engines: {node: '>=0.10.0'} @@ -2483,6 +2611,10 @@ packages: resolution: {integrity: sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==} dev: true + /is-module@1.0.0: + resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} + dev: true + /is-number@3.0.0: resolution: {integrity: sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==} engines: {node: '>=0.10.0'} @@ -2512,6 +2644,12 @@ packages: isobject: 3.0.1 dev: true + /is-reference@1.2.1: + resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} + dependencies: + '@types/estree': 1.0.1 + dev: true + /is-reference@3.0.1: resolution: {integrity: sha512-baJJdQLiYaJdvFbJqXrcGv3WU3QCzBlUcI5QhbesIm6/xPsvmO+2CDoi/GMOFBQEQm+PXkwOPrp9KK5ozZsp2w==} dependencies: @@ -3235,6 +3373,10 @@ packages: engines: {node: '>=8'} dev: true + /path-parse@1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + dev: true + /path-scurry@1.10.1: resolution: {integrity: sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==} engines: {node: '>=16 || 14 >=14.17'} @@ -3502,6 +3644,15 @@ packages: deprecated: https://github.com/lydell/resolve-url#deprecated dev: true + /resolve@1.22.6: + resolution: {integrity: sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw==} + hasBin: true + dependencies: + is-core-module: 2.13.0 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: true + /ret@0.1.15: resolution: {integrity: sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==} engines: {node: '>=0.12'} @@ -3876,6 +4027,11 @@ packages: has-flag: 4.0.0 dev: true + /supports-preserve-symlinks-flag@1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + dev: true + /svelte-check@3.5.1(postcss@8.4.27)(sass@1.66.1)(svelte@4.2.0): resolution: {integrity: sha512-+Zb4iHxAhdUtcUg/WJPRjlS1RJalIsWAe9Mz6G1zyznSs7dDkT7VUBdXc3q7Iwg49O/VrZgyJRvOJkjuBfKjFA==} hasBin: true diff --git a/src/app.html b/src/app.html index 07adef7519..cf36b4117a 100644 --- a/src/app.html +++ b/src/app.html @@ -5,7 +5,7 @@ - Appwrite Next + Appwrite - Build like a team of hundreds %sveltekit.head% diff --git a/src/icons/scripts.js b/src/icons/scripts.js index a5c9f71392..5df70df597 100644 --- a/src/icons/scripts.js +++ b/src/icons/scripts.js @@ -1,5 +1,3 @@ -// @ts-expect-error missing types -import SVGFixer from 'oslllo-svg-fixer'; import svgtofont from 'svgtofont'; import { resolve } from 'path'; diff --git a/src/icons/svg/x.svg b/src/icons/svg/x.svg index 9cffc53496..ac8a30a07e 100644 --- a/src/icons/svg/x.svg +++ b/src/icons/svg/x.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/src/lib/animations/OpenSource.svelte b/src/lib/animations/OpenSource.svelte index 629d149cc1..29396e5b72 100644 --- a/src/lib/animations/OpenSource.svelte +++ b/src/lib/animations/OpenSource.svelte @@ -1,6 +1,4 @@ @@ -123,7 +131,7 @@ remaning: Infinity }; - const animScale: Scale = [0.1, 1]; + const animScale: Scale = [0.075, 1]; const productsScales = products.map((_, idx) => { const diff = animScale[1] - animScale[0]; const step = diff / products.length; @@ -185,17 +193,15 @@ >
- - {#if scrollInfo.percentage < 0.1} + {#if scrollInfo.percentage < 0.075}
- {#if scrollInfo.percentage > 0} + {#if scrollInfo.percentage > -0.1} Products_

@@ -208,8 +214,7 @@ delay: 400 }} > - Build secure and scalable applications faster with Appwrite's core backend products and - spend more time building the best products. + Build secure and scalable applications with less code. Add authentication, databases, storage, and more using Appwrite's development platform.

{/if}

@@ -218,7 +223,7 @@ class="products" out:fly={{ duration: 250, y: 300 }} in:fly={{ duration: 500, delay: 250, y: 300 }} - data-active={scrollInfo.percentage > 0.1 ? '' : undefined} + data-active={scrollInfo.percentage > 0.075 ? '' : undefined} >
@@ -329,9 +334,8 @@ + + + + +
+ + + + +
+

{{subject}}

+
+ + + + + +
+

Hello

+ +

Follow this link to reset your {{project}} password.

+ + {{redirect}} + +


If you didn't ask to reset your password, you can ignore this message.

+
+ +

Thanks +
+ {{project}} team

+
+
+ + + + +``` + +## Localization {% #localization %} + +Each template can have multiple supported locales, displayed in different format and language. This can be configured under the **Template language** selector of each template. + +You can send messages in different languages by setting the locale with `client.setLocale()` in the SDKs or the `X-Appwrite-Locale` HTTP header. [View here the list of available locales](https://github.com/appwrite/appwrite/blob/master/app/config/locale/codes.php). + +For example, you can send an email verification in French. + +{% multicode %} +```js +import { Client, Account } from "appwrite"; + +const client = new Client(); + +const account = new Account(client); + +client + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setLocale('fr') // Your locale +; + +const promise = account.createVerification('https://example.com'); + +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); +``` + +```dart +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Account account = Account(client); + + client + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setLocale('fr') // Your locale + ; + Future result = account.createVerification('https://example.com'); + + result + .then((response) { + print(response); + }).catchError((error) { + print(error.response); + }); +} +``` + +```kotlin +import io.appwrite.Client +import io.appwrite.services.Account + +val client = Client(context) + .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setLocale('fr') // Your locale + +val account = Account(client) + +val response = account.createVerification('https://example.com') +``` + +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setLocale('fr') // Your locale + +let account = Account(client) + +let token = try await account.createVerification('https://example.com') +``` +{% /multicode %} diff --git a/src/routes/docs/advanced/platform/permissions/+page.markdoc b/src/routes/docs/advanced/platform/permissions/+page.markdoc index 37d3ba83a9..88c8c2979e 100644 --- a/src/routes/docs/advanced/platform/permissions/+page.markdoc +++ b/src/routes/docs/advanced/platform/permissions/+page.markdoc @@ -12,7 +12,7 @@ As the name suggests, read permission allows a user to read a resource, create a All permissions can be granted to individuals or groups of users, entire teams, or only to team members with a specific role. Permission can also be granted based on authentication status, such as to all users, only authenticated users, or only guest users. -A project user can only grant permissions to a resource that they own. For example, if a user is trying to share a document with a team that they are not a member of, they will encounter a 401 not authorized error. If your app needs users to grant access to teams they're not a member of, you can create Appwrite Functions with a [Server SDK](#) to achieve this functionality. +A project user can only grant permissions to a resource that they own. For example, if a user is trying to share a document with a team that they are not a member of, they will encounter a 401 not authorized error. If your app needs users to grant access to teams they're not a member of, you can create Appwrite Functions with a [Server SDK](/docs/sdks#server) to achieve this functionality. ## Appwrite Resource @@ -55,13 +55,13 @@ In Client and Server SDKs, you will find a **Role** class with helper methods fo | `Role.team([TEAM_ID])` | Grants access to any member of the specific team. To gain access to this permission, the user must be the team creator (owner), or receive and accept an invitation to join this team. | | `Role.team([TEAM_ID], [ROLE])` | Grants access to any member who possesses a specific role in a team. To gain access to this permission, the user must be a member of the specific team and have the given role assigned to them. Team roles can be assigned when inviting a user to become a team member. | | `Role.member([MEMBERSHIP_ID])` | Grants access to a specific member of a team. When the member is removed from the team, they will no longer have access. | -| `Role.label([LABEL_ID])` | Grants access to all accounts with a specific label ID. Once the label is removed from the user, they will no longer have access. [Learn more about labels](/docs/products/auth/user-management#labels). | +| `Role.label([LABEL_ID])` | Grants access to all accounts with a specific label ID. Once the label is removed from the user, they will no longer have access. [Learn more about labels](/docs/products/auth/labels). | ## Examples The examples below will show you how you can use the different Appwrite permissions to manage access control to your project resources. -The following examples are using the [Appwrite Web SDK](https://github.com/appwrite/sdk-for-js) but can be applied similarly to any of the other [Appwrite SDKs](/docs/sdks). +The following examples are using the [Appwrite Web SDK](https://github.com/appwrite/sdk-for-web) but can be applied similarly to any of the other [Appwrite SDKs](/docs/sdks). ### Example #1 - Basic usage diff --git a/src/routes/docs/advanced/platform/response-codes/+page.markdoc b/src/routes/docs/advanced/platform/response-codes/+page.markdoc index fc3b05fc1b..14847285c1 100644 --- a/src/routes/docs/advanced/platform/response-codes/+page.markdoc +++ b/src/routes/docs/advanced/platform/response-codes/+page.markdoc @@ -4,4 +4,188 @@ title: Response codes description: Placeholder SEO. --- -TODO \ No newline at end of file +Appwrite uses conventional HTTP response codes to indicate the success or failure of an API request. + +- Codes in the `2xx` range indicate success. +- Codes in the `4xx` range indicate an error caused by invalid request, usually caused by user error. +- Codes in the `5xx` range indicate an error with Appwrite, please check Docker container logs. + +## Response codes {% #response-codes %} +| Code | Text | Description | +|------|------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| 200 | OK | Success! | +| 201 | Created | The requested resource has been created successfully. | +| 202 | Accepted | The requested change has been accepted for processing but has not been completed. | +| 204 | No Content | The server has successfully fulfilled the request and that there is no additional content to send in the response payload body. This status will usually return on successful delete operations. | +| 301 | Moved Permanently | The URL of the requested resource has been changed permanently. The new URL is given in the response. | +| 304 | Not Modified | There was no new data to return. | +| 400 | Bad Request | The request was invalid or cannot be otherwise served. An accompanying error message will explain further. Requests with wrong or invalid input will yield this response. | +| 401 | Unauthorized | Missing or incorrect authentication credentials can happen when the API key or user permission is not sufficient. | +| 403 | Forbidden | The request is understood, but it has been refused, or access is not allowed. An accompanying error message will explain why. Make sure to register your app in your project's dashboard platform list. | +| 404 | Not Found | The URI requested is invalid or the resource requested, such as a user, does not exist. | +| 409 | Conflict | This response is sent when a request conflicts with the current state of the server. This status code will usually appear when you're trying to create an already existing resource. | +| 413 | Payload Too Large | This indicates that the request entity is larger than limits defined by server. This status code will usually appear happen when uploading a file or function that is too large | +| 416 | Invalid Range | Invalid value in the range or content-range headers. Usually returned while uploading or downloading files using the range header but the provided range value is not valid. | +| 429 | Too Many Requests | Returned in when a request cannot be served due to the application's rate limit having been exhausted for the resource. See [Rate Limits](/docs/advanced/platform/rate-limits). | +| 500 | Internal Server Error | Something is broken. Contact our [team](/support), or raise a [GitHub issue](https://github.com/appwrite/appwrite/issues/new). | +| 501 | Not Implemented | The feature is not implemented. Usually returned when the project owner has disabled an auth method or an entire service. | +| 503 | Service Unavailable | The Appwrite servers are up but overloaded with requests. Try again later. | +| 504 | Gateway timeout | The Appwrite servers are up, but the request couldn't be serviced due to some failure within the stack. Try again later. | + +## Error messages {% #error-messages %} + +When the Appwrite APIs return error messages, it does so in JSON format. For example, an error might look like this: + +```json +{ + "message": "Invalid id: Parameter must be a valid number", + "type": "argument_invalid", + "code": 400 +} +``` + +## Error types {% #error-types %} + +Appwrite also passes convenient error types in addition to the HTTP response codes to help you get more fine-grained control over what went wrong and allowing you to display relevant error messages in your applications. Error types are convenient to identify the type of error that occurred. + +For example, a `400` HTTP response code could indicate a Bad Request due to a variety of reasons, and error types can help you pinpoint the exact `400` error. Appwrite currently supports the following error types: + +| Code | Type | Description | +| ---- | ---- | ----------- | +| 400 | general_mock | General errors thrown by the mock controller used for testing. | +| 400 | general_argument_invalid | The request contains one or more invalid arguments. Please refer to the endpoint documentation. | +| 400 | general_query_limit_exceeded | Query limit exceeded for the current attribute. Usage of more than 100 query values on a single attribute is prohibited. | +| 400 | general_query_invalid | The query's syntax is invalid. Please check the query and try again. | +| 400 | general_cursor_not_found | The cursor is invalid. This can happen if the item represented by the cursor has been deleted. | +| 400 | user_password_mismatch | Passwords do not match. Please check the password and confirm password. | +| 400 | password_recently_used | The password you are trying to use is similar to your previous password. For your security, please choose a different password and try again. | +| 400 | password_personal_data | The password you are trying to use contains references to your name, email, phone or userID. For your security, please choose a different password and try again. | +| 400 | user_phone_not_found | The current user does not have a phone number associated with their account. | +| 400 | user_missing_id | Missing ID from OAuth2 provider. | +| 400 | user_oauth2_bad_request | OAuth2 provider rejected the bad request. | +| 400 | storage_device_not_found | The requested storage device could not be found. | +| 400 | storage_file_empty | Empty file passed to the endpoint. | +| 400 | storage_file_type_unsupported | The given file extension is not supported. | +| 400 | storage_invalid_file_size | The file size is either not valid or exceeds the maximum allowed size. Please check the file or the value of the `_APP_STORAGE_LIMIT` environment variable. | +| 400 | storage_invalid_content_range | The content range is invalid. Please check the value of the `Content-Range` header. | +| 400 | storage_invalid_appwrite_id | The value for `x-appwrite-id` header is invalid. Please check the value of the `x-appwrite-id` header is a valid id and not `unique()`. | +| 400 | general_provider_failure | VCS (Version Control System) provider failed to process the request. We believe this is an error with the VCS provider. Try again, or contact support for more information. | +| 400 | build_not_ready | Build with the requested ID is building and not ready for execution. | +| 400 | build_in_progress | Build with the requested ID is already in progress. Please wait before you can retry. | +| 400 | collection_limit_exceeded | The maximum number of collections has been reached. | +| 400 | document_invalid_structure | The document structure is invalid. Please ensure the attributes match the collection definition. | +| 400 | document_missing_data | The document data is missing. Try again with document data populated. | +| 400 | document_missing_payload | The document data and permissions are missing. You must provide either document data or permissions to be updated. | +| 400 | attribute_unknown | The attribute required for the index could not be found. Please confirm all your attributes are in the available state. | +| 400 | attribute_not_available | The requested attribute is not yet available. Please try again later. | +| 400 | attribute_format_unsupported | The requested attribute format is not supported. | +| 400 | attribute_default_unsupported | Default values cannot be set for array or required attributes. | +| 400 | attribute_limit_exceeded | The maximum number of attributes has been reached. | +| 400 | attribute_value_invalid | The attribute value is invalid. Please check the type, range and value of the attribute. | +| 400 | attribute_type_invalid | The attribute type is invalid. | +| 400 | index_limit_exceeded | The maximum number of indexes has been reached. | +| 400 | index_invalid | Index invalid. | +| 400 | project_unknown | The project ID is either missing or not valid. Please check the value of the `X-Appwrite-Project` header to ensure the correct project ID is being used. | +| 400 | project_invalid_success_url | Invalid redirect URL for OAuth success. | +| 400 | project_invalid_failure_url | Invalid redirect URL for OAuth failure. | +| 400 | project_reserved_project | The project ID is reserved. Please choose another project ID. | +| 400 | project_smtp_config_invalid | Provided SMTP config is invalid. Please check the configured values and try again. | +| 400 | graphql_no_query | Param "query" is not optional. | +| 400 | graphql_too_many_queries | Too many queries. | +| 401 | general_access_forbidden | Access to this API is forbidden. | +| 401 | general_unauthorized_scope | The current user or API key does not have the required scopes to access the requested resource. | +| 401 | user_jwt_invalid | The JWT token is invalid. Please check the value of the `X-Appwrite-JWT` header to ensure the correct token is being used. | +| 401 | user_blocked | The current user has been blocked. You can unblock the user by making a request to the User API's "Update User Status" endpoint or in the Appwrite Console's Auth section. | +| 401 | user_invalid_token | Invalid token passed in the request. | +| 401 | user_email_not_whitelisted | Console registration is restricted to specific emails. Contact your administrator for more information. | +| 401 | user_invalid_code | The specified code is not valid. Contact your administrator for more information. | +| 401 | user_ip_not_whitelisted | Console registration is restricted to specific IPs. Contact your administrator for more information. | +| 401 | user_invalid_credentials | Invalid credentials. Please check the email and password. | +| 401 | user_anonymous_console_prohibited | Anonymous users cannot be created for the console project. | +| 401 | user_session_already_exists | Creation of anonymous users is prohibited when a session is active. | +| 401 | user_unauthorized | The current user is not authorized to perform the requested action. | +| 401 | user_oauth2_unauthorized | OAuth2 provider rejected the unauthorized request. | +| 401 | team_invalid_secret | The team invitation secret is invalid. Please request a new invitation and try again. | +| 401 | team_invite_mismatch | The invite does not belong to the current user. | +| 401 | project_key_expired | The project key has expired. Please generate a new key using the Appwrite console. | +| 401 | rule_verification_failed | Domain verification failed. Please check if your DNS records are correct and try again. | +| 401 | project_template_default_deletion | You can't delete default template. If you are trying to reset your template changes, you can ignore this error as it's already been reset. | +| 403 | general_unknown_origin | The request originated from an unknown origin. If you trust this domain, please list it as a trusted platform in the Appwrite console. | +| 403 | storage_invalid_file | The uploaded file is invalid. Please check the file and try again. | +| 403 | document_delete_restricted | Document cannot be deleted because it is referenced by another document. | +| 404 | general_route_not_found | The requested route was not found. Please refer to the API docs and try again. | +| 404 | user_not_found | User with the requested ID could not be found. | +| 404 | user_session_not_found | The current user session could not be found. | +| 404 | user_identity_not_found | The identity could not be found. Please sign in with OAuth provider to create identity first. | +| 404 | team_not_found | Team with the requested ID could not be found. | +| 404 | team_invite_not_found | The requested team invitation could not be found. | +| 404 | team_membership_mismatch | The membership ID does not belong to the team ID. | +| 404 | membership_not_found | Membership with the requested ID could not be found. | +| 404 | avatar_set_not_found | The requested avatar set could not be found. | +| 404 | avatar_not_found | The request avatar could not be found. | +| 404 | avatar_image_not_found | The requested image was not found at the URL. | +| 404 | avatar_remote_url_failed | Failed to fetch favicon from the requested URL. | +| 404 | avatar_icon_not_found | The requested favicon could not be found. | +| 404 | storage_file_not_found | The requested file could not be found. | +| 404 | storage_bucket_not_found | Storage bucket with the requested ID could not be found. | +| 404 | installation_not_found | Installation with the requested ID could not be found. Check to see if the ID is correct, or create the installation. | +| 404 | provider_repository_not_found | VCS (Version Control System) repository with the requested ID could not be found. Check to see if the ID is correct, and if it belongs to installationId you provided. | +| 404 | repository_not_found | Repository with the requested ID could not be found. Check to see if the ID is correct, or create the repository. | +| 404 | function_not_found | Function with the requested ID could not be found. | +| 404 | function_runtime_unsupported | The requested runtime is either inactive or unsupported. Please check the value of the `_APP_FUNCTIONS_RUNTIMES` environment variable. | +| 404 | function_runtime_unsupported | Entrypoint for your Appwrite Function is missing. Please specify it when making deployment or update the entrypoint under your function's "Settings" > "Configuration" > "Entrypoint". | +| 404 | build_not_found | Build with the requested ID could not be found. | +| 404 | deployment_not_found | Deployment with the requested ID could not be found. | +| 404 | execution_not_found | Execution with the requested ID could not be found. | +| 404 | database_not_found | Database not found | +| 404 | collection_not_found | Collection with the requested ID could not be found. | +| 404 | document_not_found | Document with the requested ID could not be found. | +| 404 | attribute_not_found | Attribute with the requested ID could not be found. | +| 404 | index_not_found | Index with the requested ID could not be found. | +| 404 | project_not_found | Project with the requested ID could not be found. Please check the value of the `X-Appwrite-Project` header to ensure the correct project ID is being used. | +| 404 | router_host_not_found | Host is not trusted. This could occur because you have not configured a custom domain. Add a custom domain to your project first and try again. | +| 404 | rule_resource_not_found | Resource could not be found. Please check if the `resourceId` and `resourceType` are correct, or if the resource actually exists. | +| 404 | rule_not_found | Rule with the requested ID could not be found. Please check if the ID provided is correct or if the rule actually exists. | +| 404 | webhook_not_found | Webhook with the requested ID could not be found. | +| 404 | key_not_found | Key with the requested ID could not be found. | +| 404 | platform_not_found | Platform with the requested ID could not be found. | +| 404 | variable_not_found | Variable with the requested ID could not be found. | +| 404 | migration_not_found | Migration with the requested ID could not be found. Please verify that the provided ID is correct and try again. | +| 405 | general_not_implemented | This method was not fully implemented yet. If you believe this is a mistake, please upgrade your Appwrite server version. | +| 409 | user_already_exists | A user with the same id, email, or phone already exists in this project. | +| 409 | user_email_already_exists | A user with the same email already exists in the current project. | +| 409 | user_phone_already_exists | A user with the same phone number already exists in the current project. | +| 409 | team_invite_already_exists | User has already been invited or is already a member of this team | +| 409 | team_already_exists | Team with requested ID already exists. Please choose a different ID and try again. | +| 409 | membership_already_confirmed | Membership is already confirmed. | +| 409 | storage_file_already_exists | A storage file with the requested ID already exists. | +| 409 | storage_bucket_already_exists | A storage bucket with the requested ID already exists. Try again with a different ID or use `unique()` to generate a unique ID. | +| 409 | provider_contribution_conflict | External contribution is already authorized. | +| 409 | database_already_exists | Database already exists | +| 409 | collection_already_exists | A collection with the requested ID already exists. Try again with a different ID or use `unique()` to generate a unique ID. | +| 409 | document_already_exists | Document with the requested ID already exists. Try again with a different ID or use `unique()` to generate a unique ID. | +| 409 | document_update_conflict | Remote document is newer than local. | +| 409 | attribute_already_exists | Attribute with the requested ID already exists. Try again with a different ID or use `unique()` to generate a unique ID. | +| 409 | index_already_exists | Index with the requested ID already exists. Try again with a different ID or use `unique()` to generate a unique ID. | +| 409 | project_already_exists | Project with the requested ID already exists. Try again with a different ID or use `unique()` to generate a unique ID. | +| 409 | rule_already_exists | Domain is already used. Please try again with a different domain. | +| 409 | variable_already_exists | Variable with the same ID already exists in this project. Try again with a different ID. | +| 409 | migration_already_exists | Migration with the requested ID already exists. Try again with a different ID. | +| 409 | migration_in_progress | Migration is already in progress. You can check the status of the migration in your Appwrite Console's "Settings" > "Migrations". | +| 412 | user_password_reset_required | The current user requires a password reset. | +| 412 | project_provider_disabled | The chosen OAuth provider is disabled. You can enable the OAuth provider using the Appwrite console. | +| 416 | storage_invalid_range | The requested range is not satisfiable. Please check the value of the `Range` header. | +| 424 | user_oauth2_provider_error | OAuth2 provider returned some error. | +| 429 | general_rate_limit_exceeded | Rate limit for the current endpoint has been exceeded. Please try again after some time. | +| 500 | general_unknown | An unknown error has occurred. Please check the logs for more information. | +| 500 | general_server_error | An internal server error occurred. | +| 500 | general_protocol_unsupported | The request cannot be fulfilled with the current protocol. Please check the value of the `_APP_OPTIONS_FORCE_HTTPS` environment variable. | +| 500 | general_codes_disabled | Invitation codes are disabled on this server. Please contact the server administrator. | +| 500 | router_domain_not_configured | `_APP_DOMAIN`, `_APP_DOMAIN_TARGET`, and `_APP_DOMAIN_FUNCTIONS` environment variables have not been configured. Please configure the domain environment variables before accessing the Appwrite Console via any IP address or hostname other than localhost. This value could be an IP like 203.0.113.0 or a hostname like example.com. | +| 501 | general_usage_disabled | Usage stats is not configured. Please check the value of the `_APP_USAGE_STATS` environment variable of your Appwrite server. | +| 501 | user_count_exceeded | The current project has exceeded the maximum number of users. Please check your user limit in the Appwrite console. | +| 501 | user_auth_method_unsupported | The requested authentication method is either disabled or unsupported. Please check the supported authentication methods in the Appwrite console. | +| 501 | project_provider_unsupported | The chosen OAuth provider is unsupported. Please check the Create OAuth2 Session docs for the complete list of supported OAuth providers. | +| 503 | general_service_disabled | The requested service is disabled. You can enable the service from the Appwrite console. | +| 503 | general_smtp_disabled | SMTP is disabled on your Appwrite instance. You can learn more about setting up SMTP in our docs. | +| 503 | general_phone_disabled | Phone provider is not configured. Please check the `_APP_SMS_PROVIDER` environment variable of your Appwrite server. | \ No newline at end of file diff --git a/src/routes/docs/advanced/platform/webhooks/+page.markdoc b/src/routes/docs/advanced/platform/webhooks/+page.markdoc index 56bed361da..968d6bcc50 100644 --- a/src/routes/docs/advanced/platform/webhooks/+page.markdoc +++ b/src/routes/docs/advanced/platform/webhooks/+page.markdoc @@ -12,7 +12,7 @@ You can set your webhook by adding it from your Appwrite project dashboard. You ## Payload {% #payload %} -Each event type has a specific payload format with the relevant event information. All event payloads mirror the payloads for the API payload which parallel to the [event types](/docs/events). +Each event type has a specific payload format with the relevant event information. All event payloads mirror the payloads for the API payload which parallel to the [event types](/docs/advanced/platform/events). ## Headers {% #headers %} @@ -22,7 +22,7 @@ HTTP requests made to your webhook's configured URL endpoint will contain severa |--------|-------------| | X-Appwrite-Webhook-Id | The ID of the Webhook who triggered the event. | | X-Appwrite-Webhook-Events | Names of the events that triggered this delivery. | -| X-Appwrite-Webhook-Name | Name of the webhook as specified in your app settings and [events list](/docs/events). | +| X-Appwrite-Webhook-Name | Name of the webhook as specified in your app settings and [events list](/docs/advanced/platform/events). | | X-Appwrite-Webhook-User-Id | The user ID of the user who triggered the event. Returns an empty string if an API key triggered the event. Note that events like `account.create` or `account.sessions.create` are performed by guest users and will not return any user ID. If you still need the user ID for these events, you can find it in the event payload. | | X-Appwrite-Webhook-Project-Id | The ID of the project who owns the Webhook and API call. | | X-Appwrite-Webhook-Signature | The HMAC-SHA1 signature of the payload. This is used to verify the authenticity of the payload. | @@ -30,7 +30,7 @@ HTTP requests made to your webhook's configured URL endpoint will contain severa ## Verification {% #verification %} -Webhooks can be verified by using the [X-Appwrite-Webhook-Signature](/docs/webhooks#headers) header. +Webhooks can be verified by using the [X-Appwrite-Webhook-Signature](/docs/advanced/platform/webhooks#headers) header. This is the HMAC-SHA1 signature of the payload. You can find the signature key in your webhooks properties in the dashboard. To generate this hash you append the payload to the end of webhook URL (make sure there are no spaces in between) and then use the HMAC-SHA1 algorithm to generate the signature. After you've generated the signature, compare it to the `X-Appwrite-Webhook-Signature` header value. @@ -51,4 +51,4 @@ You can specify one or many events to subscribe to with webhooks. {% partial file="functions-events.md" /%} -[Learn more about events](/docs/platform/api-keys) +[Learn more about events](/docs/advanced/platform/api-keys) diff --git a/src/routes/docs/advanced/self-hosting/+layout.svelte b/src/routes/docs/advanced/self-hosting/+layout.svelte index 63a2f8f490..c80ae18682 100644 --- a/src/routes/docs/advanced/self-hosting/+layout.svelte +++ b/src/routes/docs/advanced/self-hosting/+layout.svelte @@ -11,38 +11,22 @@ { label: 'Getting started', items: [ - { - label: 'Overview', - href: '/docs/advanced/self-hosting' - }, { label: 'Installation', - href: '/docs/advanced/self-hosting/installation' + href: '/docs/advanced/self-hosting/' } ] }, { label: 'Guides', items: [ - { - label: 'Update', - href: '/docs/advanced/self-hosting/update' - }, - { - label: 'Debugging', - href: '/docs/advanced/self-hosting/debug' - }, - { - label: 'Email delivery', - href: '/docs/advanced/self-hosting/email' - }, { label: 'Functions', href: '/docs/advanced/self-hosting/functions' }, { - label: 'Production', - href: '/docs/advanced/self-hosting/production' + label: 'Email delivery', + href: '/docs/advanced/self-hosting/email' }, { label: 'SMS delivery', @@ -52,10 +36,26 @@ label: 'Storage', href: '/docs/advanced/self-hosting/storage' }, + { + label: 'Environment variables', + href: '/docs/advanced/self-hosting/environment-variables' + }, { label: 'TLS Certificates', href: '/docs/advanced/self-hosting/tls-certificates' - } + }, + { + label: 'Debugging', + href: '/docs/advanced/self-hosting/debug' + }, + { + label: 'Production', + href: '/docs/advanced/self-hosting/production' + }, + { + label: 'Update', + href: '/docs/advanced/self-hosting/update' + }, ] } ]; diff --git a/src/routes/docs/advanced/self-hosting/+page.markdoc b/src/routes/docs/advanced/self-hosting/+page.markdoc index bb97a21355..303c008d28 100644 --- a/src/routes/docs/advanced/self-hosting/+page.markdoc +++ b/src/routes/docs/advanced/self-hosting/+page.markdoc @@ -1,25 +1,31 @@ --- layout: article -title: Self-hosting -description: Learn how to self host Appwrite on your own server using your favorite cloud provider. +title: Installation +description: Learn how to integrate Appwrite in your application with one of the supported SDKs. --- -Appwrite was designed from the ground up with self-hosting in mind. -You can install and run Appwrite on any operating system that can run a [Docker CLI](https://www.docker.com/products/docker-desktop). -Self-hosted Appwrite instances can be configured flexibly with access to the same features found on Appwrite Cloud. +Appwrite was designed from the ground up with self-hosting in mind. You can install and run Appwrite on any operating system that can run a [Docker CLI](https://www.docker.com/products/docker-desktop). Self-hosted Appwrite instances can be configured flexibly with access to the same features found on Appwrite Cloud. -{% info title="Want to start building faster?" %} -Spend less time worrying about infrastructure and scaling, and spend more time building with [Appwrite Cloud](https://cloud.appwrite.io/). -{% /info %} - -## System Requirements {% #system-requirements %} +## System requirements {% #system-requirements %} Appwrite is designed to run well on both small and large deployments. The minimum requirements to run Appwrite are as little as **1 CPU core** and **2GB of RAM**, and an operating system that supports Docker. Appwrite requires [Docker Compose Version 2](https://docs.docker.com/compose/install/). To install Appwrite, make sure your Docker installation is updated to support Composer V2. -## Get started {% #get-started %} -Set up your first Appwrite instance with a single Docker command. +{% info title="Upgrading From Older Versions" %} +If you are migrating from an older version of Appwrite, you need to follow the [migration instructions](/docs/advanced/self-hosting/update) +{% /info %} + +## Install with Docker {% #install-with-docker %} + +The easiest way to start running your Appwrite server is by running our Docker installer tool from your terminal. Before running the installation command, make sure you have [Docker CLI](https://www.docker.com/products/docker-desktop) installed on your host machine. + +You will be prompted to configure the following during the setup command: + +1. Your Appwrite instance's HTTP and HTTPS ports. +2. Your Appwrite instance's secret key used to encrypt sensitive data. +3. Your Appwrite instance's main hostname. Appwrite will generate a certificate using this hostname. +4. Your Appwrite instance's DNS A record hostname. Typically set to the same value as your Appwrite instance's hostname. {% tabs %} {% tabsitem #unix title="macOS and Linux" %} @@ -31,10 +37,6 @@ docker run -it --rm \ --entrypoint="install" \ appwrite/appwrite:1.4.3 ``` -After running the command, you can access the Appwrite Console and start building on `localhost`. -Read more about other ways to install and uninstall. - -[Learn about install and uninstall {% icon icon="cheveron-right" /%}](#) {% /tabsitem %} {% tabsitem #windows title="Windows" %} @@ -54,59 +56,58 @@ docker run -it --rm ` --entrypoint="install" ` appwrite/appwrite:1.4.3 ``` -After running the command, you can access the Appwrite Console and start building on `localhost`. -Read more about other ways to install and uninstall. - -[Learn about install and uninstall {% icon icon="cheveron-right" /%}](#) {% /tabsitem %} {% /tabs %} -To unlock the full capabilities of Appwrite, read about the following configurations. +## One-click setups {% #one-click-setups %} -## Email delivery -Appwrite requires an SMTP service to deliver emails. -Email delivery is required for features like password recovery, account verification, MagicURL authentication, and team invites. -You can use a third-party SMTP service or host your own SMTP server. +In addition to running Appwrite locally, you can also launch Appwrite using a pre-configured setup. This allows you to get up and running with Appwrite quickly without installing Docker on your local machine. -[Configure email delivery {% icon icon="cheveron-right" /%}](#) +Choose from one of the providers below: + +  |Provider | Installation Link +--- | --- | --- + {% icon icon="do" /%}| DigitalOcean | [Click to install](https://marketplace.digitalocean.com/apps/appwrite) + {% icon icon="gitpod" /%}| Gitpod | [Click to install](https://gitpod.io/#https://github.com/appwrite/integration-for-gitpod) + {% icon icon="akamai" /%}| Akamai Compute | [Click to install](https://www.linode.com/marketplace/apps/appwrite/appwrite/) -## SMS delivery -Appwrite supports multiple third-party SMS delivery providers. -SMS delivery is required for phone authentication. +## Next steps {% #next-steps %} -[Configure SMS delivery {% icon icon="cheveron-right" /%}](#) +Self-hosting Appwrite gives you more configurable options. +Make these configurations to unlock the full power of Appwrite. -## Functions -Appwrite supports 10+ function runtimes and automatic deployments through Git integration. -Before using Appwrite Functions, configure Git integration and enable runtimes. +[Configure Appwrite Functions](/docs/advanced/self-hosting/functions) -[Configure Appwrite Functions {% icon icon="cheveron-right" /%}](#) +[Configure email delivery](/docs/advanced/self-hosting/email) -## Storage -Appwrite's Storage Service can be configured to store files locally, or with self-hosted and cloud storage services. -By default, Appwrite's Storage Service stores files on your server's local storage. -If you expect large volumes of data or the need to have scalable data storage, you may choose to use a separate storage service. +[Configure SMS delivery](/docs/advanced/self-hosting/sms) -[Configure Appwrite Storage {% icon icon="cheveron-right" /%}](#) +[Configure Appwrite Storage](/docs/advanced/self-hosting/storage) -## TLS Certificates -Appwrite uses Let's Encrypt to auto-generate TLS certificates for your Appwrite instance to ensure your API traffic is appropriately encrypted. -Configuration is required for Appwrite to properly generate certificates. +[Configure TLS Certificates](/docs/advanced/self-hosting/tls-certificates) -[Configure TLS certificates {% icon icon="cheveron-right" /%}](#) +## Manual (Docker Compose) {% #manual %} -## Debug -Appwrite provides tools to monitor server health, handle error logging. +For advanced Docker users, the manual installation might seem more familiar. To set up Appwrite manually, download the Appwrite base `docker-compose.yml` and `.env` files, then move them inside a directory named `appwrite`. After the download completes, update the different environment variables as you wish in the `.env` file and start the Appwrite stack using the following Docker command: + +```bash +docker compose up -d --remove-orphans +``` -[Learn about upgrade {% icon icon="cheveron-right" /%}](#) +Once the Docker installation completes, go to your machine's hostname or IP address on your browser to access the Appwrite Console. Please note that on hosts that are not Linux-native, the server might take a few minutes to start after installation completes. -## Update -Each Appwrite version contains a migration script to help you migrate your apps during updates. +## Stop {% #stop %} + +You can stop your Appwrite containers by using the following command executed from the same directory as your `docker-compose.yml` file. + +```bash +docker compose stop +``` -[Learn about updates {% icon icon="cheveron-right" /%}](#) +## Uninstall {% #uninstall %} -## Production -Self-hosting Appwrite can be used in production settings. -To succeed with Appwrite in a production environment, you should follow a few basic concepts and best practices. +To stop and remove your Appwrite containers, you can use the following command executed from the same directory as your `docker-compose.yml` file. -[Learn about production {% icon icon="cheveron-right" /%}](#) \ No newline at end of file +```bash +docker compose down -v +``` \ No newline at end of file diff --git a/src/routes/docs/advanced/self-hosting/environment-variables/+page.markdoc b/src/routes/docs/advanced/self-hosting/environment-variables/+page.markdoc new file mode 100644 index 0000000000..22ba569dfc --- /dev/null +++ b/src/routes/docs/advanced/self-hosting/environment-variables/+page.markdoc @@ -0,0 +1,203 @@ +--- +layout: article +title: Environment variables +description: Learn how to integrate Appwrite in your application with one of the supported SDKs. +--- + + +Appwrite environment variables allow you to edit your server setup configuration and customize it. You can easily change the environment variables by changing them when running Appwrite using Docker CLI or Docker Compose. + +Updating your Appwrite environment variables requires you to edit your Appwrite `.env` file. Your Docker files should be located inside the "appwrite" folder at the location where you first run the Appwrite installation script. It's recommended to use the `.env` file as a central point for updating your Appwrite configuration rather than changing them directly in your `docker-compose.yml` file. + +After editing your `docker-compose.yml` or `.env` files, you will need to recreate your Appwrite stack by running the following compose command in your terminal: +```bash +docker compose up -d +``` + +You can verify if the changes have been successfully applied by running this command: +```bash +docker compose exec appwrite vars +``` + +## General {% #general %} +| Name | Description | +|------|-------------| +| `_APP_ENV` | Set your server running environment. By default, the var is set to 'development'. When deploying to production, change it to: 'production'. | +| `_APP_LOCALE` | Set your Appwrite's locale. By default, the locale is set to 'en'. | +| `_APP_OPTIONS_ABUSE` | Allows you to disable abuse checks and API rate limiting. By default, set to 'enabled'. To cancel the abuse checking, set to 'disabled'. It is not recommended to disable this check-in a production environment. | +| `_APP_OPTIONS_FORCE_HTTPS` | Allows you to force HTTPS connection to your API. This feature redirects any HTTP call to HTTPS and adds the 'Strict-Transport-Security' header to all HTTP responses. By default, set to 'enabled'. To disable, set to 'disabled'. This feature will work only when your ports are set to default 80 and 443. | +| `_APP_OPENSSL_KEY_V1` | This is your server private secret key that is used to encrypt all sensitive data on your server. Appwrite server encrypts all secret data on your server like webhooks, HTTP passwords, user sessions, and storage files. The var is not set by default, if you wish to take advantage of Appwrite encryption capabilities you should change it and make sure to **keep it a secret and have a backup for it**. | +| `_APP_DOMAIN` | Your Appwrite domain address. When setting a public suffix domain, Appwrite will attempt to issue a valid SSL certificate automatically. When used with a dev domain, Appwrite will assign a self-signed SSL certificate. The default value is 'localhost'. | +| `_APP_DOMAIN_FUNCTIONS` | A domain to use for function preview URLs. Setting to empty turns off function preview URLs. | +| `_APP_DOMAIN_TARGET` | A DNS A record hostname to serve as a CNAME target for your Appwrite custom domains. You can use the same value as used for the Appwrite '_APP_DOMAIN' variable. The default value is 'localhost'. | +| `_APP_CONSOLE_WHITELIST_ROOT`| This option allows you to disable the creation of new users on the Appwrite console. When enabled only 1 user will be able to use the registration form. New users can be added by inviting them to your project. By default this option is enabled. | +| `_APP_CONSOLE_WHITELIST_EMAILS` | This option allows you to limit creation of new users on the Appwrite console. This option is very useful for small teams or sole developers. To enable it, pass a list of allowed email addresses separated by a comma. | +| `_APP_CONSOLE_WHITELIST_IPS` | This last option allows you to limit creation of users in Appwrite console for users sharing the same set of IP addresses. This option is very useful for team working with a VPN service or a company IP. To enable/activate this option, pass a list of allowed IP addresses separated by a comma. | +| `_APP_SYSTEM_EMAIL_NAME`| This is the sender name value that will appear on email messages sent to developers from the Appwrite console. The default value is: 'Appwrite'. You can use url encoded strings for spaces and special chars. | +| `_APP_SYSTEM_EMAIL_ADDRESS` | This is the sender email address that will appear on email messages sent to developers from the Appwrite console. The default value is 'team@appwrite.io'. You should choose an email address that is allowed to be used from your SMTP server to avoid the server email ending in the users' SPAM folders. | +| `_APP_SYSTEM_RESPONSE_FORMAT` | Use this environment variable to set the default Appwrite HTTP response format to support an older version of Appwrite. This option is useful to overcome breaking changes between versions. You can also use the `X-Appwrite-Response-Format` HTTP request header to overwrite the response for a specific request. This variable accepts any valid Appwrite version. To use the current version format, leave the value of the variable empty. | +| `_APP_SYSTEM_SECURITY_EMAIL_ADDRESS` | This is the email address used to issue SSL certificates for custom domains or the user agent in your webhooks payload. | +| `_APP_USAGE_STATS` | This variable allows you to disable the collection and displaying of usage stats. This value is set to 'enabled' by default, to disable the usage stats set the value to 'disabled'. When disabled, it's recommended to turn off the Worker Usage container to reduce resource usage. | +| `_APP_LOGGING_PROVIDER` | **(version >= 0.12.0)** This variable allows you to enable logging errors to 3rd party providers. This value is empty by default, set the value to one of 'sentry', 'raygun', 'appSignal', 'logOwl' to enable the logger. | +| `_APP_LOGGING_CONFIG` | **(version >= 0.12.0)** This variable configures authentication to 3rd party error logging providers. If using Sentry, this should be 'SENTRY_API_KEY;SENTRY_APP_ID'. If using Raygun, this should be Raygun API key. If using AppSignal, this should be AppSignal API key. If using LogOwl, this should be LogOwl Service Ticket. | +| `_APP_USAGE_AGGREGATION_INTERVAL` | **(version >= 1.1.0)** Interval value containing the number of seconds that the Appwrite usage process should wait before aggregating stats and syncing it to Database from TimeSeries data. The default value is 30 seconds. Reintroduced in 1.1.0. | +| `_APP_USAGE_TIMESERIES_INTERVAL` | **(version >= 1.0.0)** Deprecated since 1.1.0 use _APP_USAGE_AGGREGATION_INTERVAL instead. | +| `_APP_USAGE_DATABASE_INTERVAL` | **(version >= 1.0.0)** Deprecated since 1.1.0 use _APP_USAGE_AGGREGATION_INTERVAL instead. | +| `_APP_WORKER_PER_CORE` | **(version >= 0.13.0)** Internal Worker per core for the API, Realtime and Executor containers. Can be configured to optimize performance. | + + +## Redis {% #redis %} +Appwrite uses a Redis server for managing cache, queues and scheduled tasks. The Redis env vars are used to allow Appwrite server to connect to the Redis container. + +| Name | Description | +|--------------------------|-------------------------------------------------------------------------------------------------------| +| `_APP_REDIS_HOST` | Redis server hostname address. Default value is: `redis`. | +| `_APP_REDIS_PORT` | Redis server TCP port. Default value is: `6379`. | +| `_APP_REDIS_USER` | Redis server user. This is an optional variable. Default value is an empty string. | +| `_APP_REDIS_PASS` | Redis server password. This is an optional variable. Default value is an empty string.| + + + +Appwrite is using a MariaDB server for managing persistent database data. The MariaDB env vars are used to allow Appwrite server to connect to the MariaDB container. + +| Name | Description | +|------------------------|--------------------------------------------------------------------------------------------------| +| `_APP_DB_HOST` | MariaDB server host name address. Default value is: `mariadb`. | +| `_APP_DB_PORT` | MariaDB server TCP port. Default value is: `3306`. | +| `_APP_DB_SCHEMA` | MariaDB server database schema. Default value is: `appwrite`. | +| `_APP_DB_USER` | MariaDB server user name. Default value is: `user`. | +| `_APP_DB_PASS` | MariaDB server user password. Default value is: `password`. | +| `_APP_DB_ROOT_PASS` | MariaDB server root password. Default value is: `rootsecretpassword`. | + +## InfluxDB {% #influxdb %} +Appwrite uses an InfluxDB server for managing time-series data and server stats. The InfluxDB env vars are used to allow Appwrite server to connect to the InfluxDB container. + +| Name | Description | +|-----------------------|-------------------------------------------------------------------------------------------------| +| `_APP_INFLUXDB_HOST` | InfluxDB server host name address. Default value is: `influxdb`. | +| `_APP_INFLUXDB_PORT` | InfluxDB server TCP port. Default value is: `8086`. | + + +## StatsD {% #statsd %} + +Appwrite uses a StatsD server for aggregating and sending stats data over a fast UDP connection. The StatsD env vars are used to allow Appwrite server to connect to the StatsD container. + +| Name | Description | +|---------------------|-------------------------------------------------------------------------------------| +| `_APP_STATSD_HOST` | StatsD server host name address. Default value is: `telegraf`. | +| `_APP_STATSD_PORT` | StatsD server TCP port. Default value is: `8125`. | + + +## SMTP {% #smtp %} + +Appwrite is using an SMTP server for emailing your projects users and server admins. The SMTP env vars are used to allow Appwrite server to connect to the SMTP container. + +If running in production, it might be easier to use a 3rd party SMTP server as it might be a little more difficult to set up a production SMTP server that will not send all your emails into your user's **spam folder**. + +| Name | Description | +|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `_APP_SMTP_HOST` | SMTP server host name address. Use an empty string to disable all mail sending from the server. The default value for this variable is an empty string. | +| `_APP_SMTP_PORT` | SMTP server TCP port. Empty by default. | +| `_APP_SMTP_SECURE` | SMTP secure connection protocol. Empty by default, change to 'tls' if running on a secure connection. | +| `_APP_SMTP_USERNAME` | SMTP server user name. Empty by default. | +| `_APP_SMTP_PASSWORD` | SMTP server user password. Empty by default. | + + +## Phone {% #phone %} + +| Name | Description | +|---------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `_APP_SMS_PROVIDER` | **version >= 0.15.0** Provider used for delivering SMS for Phone authentication. Use the following format: 'sms://[USER]:[SECRET]@[PROVIDER]'.
Ensure `[USER]` and `[SECRET]` are URL encoded if they contain any non-alphanumeric characters.
Available providers are twilio, text-magic, telesign, msg91, and vonage. | +| `_APP_SMS_FROM` | **version >= 0.15.0** Phone number used for sending out messages. Must start with a leading '+' and maximum of 15 digits without spaces (+123456789). | + +## Storage {% #storage %} + +| Name | Description | +|---------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `_APP_STORAGE_LIMIT` | **version >= 0.7.0** Maximum file size allowed for file upload. The default value is 30MB. You should pass your size limit value in bytes. | +| `_APP_STORAGE_PREVIEW_LIMIT` | **version >= 0.13.4** Maximum file size allowed for file image preview. The default value is 20MB. You should pass your size limit value in bytes. | +| `_APP_STORAGE_ANTIVIRUS` | This variable allows you to disable the internal anti-virus scans. This value is set to 'disabled' by default, to enable the scans set the value to 'enabled'. Before enabling, you must add the ClamAV service and depend on it on main Appwrite service. | +| `_APP_STORAGE_ANTIVIRUS_HOST` | **version >= 0.7.0** ClamAV server host name address. Default value is: 'clamav'. | +| `_APP_STORAGE_ANTIVIRUS_PORT` | **version >= 0.7.0** ClamAV server TCP port. Default value is: '3310'. | +| `_APP_STORAGE_DEVICE` | **version >= 0.13.0** Select default storage device. The default value is 'local'. List of supported adapters are 'local', 's3', 'dospaces', 'backblaze', 'linode' and 'wasabi'. | +| `_APP_STORAGE_S3_ACCESS_KEY` | **version >= 0.13.0** AWS S3 storage access key. Required when the storage adapter is set to S3. You can get your access key from your AWS console. | +| `_APP_STORAGE_S3_SECRET` | **version >= 0.13.0** AWS S3 storage secret key. Required when the storage adapter is set to S3. You can get your secret key from your AWS console. | +| `_APP_STORAGE_S3_REGION` | **version >= 0.13.0** AWS S3 storage region. Required when storage adapter is set to S3. You can find your region info for your bucket from AWS console. | +| `_APP_STORAGE_S3_BUCKET` | **version >= 0.13.0** AWS S3 storage bucket. Required when storage adapter is set to S3. You can create buckets in your AWS console. | +| `_APP_STORAGE_DO_SPACES_ACCESS_KEY` | **version >= 0.13.0** DigitalOcean spaces access key. Required when the storage adapter is set to DOSpaces. You can get your access key from your DigitalOcean console. | +| `_APP_STORAGE_DO_SPACES_SECRET` | **version >= 0.13.0** DigitalOcean spaces secret key. Required when the storage adapter is set to DOSpaces. You can get your secret key from your DigitalOcean console. | +| `_APP_STORAGE_DO_SPACES_REGION` | **version >= 0.13.0** DigitalOcean spaces region. Required when storage adapter is set to DOSpaces. You can find your region info for your space from DigitalOcean console. | +| `_APP_STORAGE_DO_SPACES_BUCKET` | **version >= 0.13.0** DigitalOcean spaces bucket. Required when storage adapter is set to DOSpaces. You can create spaces in your DigitalOcean console. | +| `_APP_STORAGE_BACKBLAZE_ACCESS_KEY` | **version >= 0.14.2** Backblaze access key. Required when the storage adapter is set to Backblaze. Your Backblaze keyID will be your access key. You can get your keyID from your Backblaze console. | +| `_APP_STORAGE_BACKBLAZE_SECRET` | **version >= 0.14.2** Backblaze secret key. Required when the storage adapter is set to Backblaze. Your Backblaze applicationKey will be your secret key. You can get your applicationKey from your Backblaze console. | +| `_APP_STORAGE_BACKBLAZE_REGION` | **version >= 0.14.2** Backblaze region. Required when storage adapter is set to Backblaze. You can find your region info from your Backblaze console. | +| `_APP_STORAGE_BACKBLAZE_BUCKET` | **version >= 0.14.2** Backblaze bucket. Required when storage adapter is set to Backblaze. You can create your bucket from your Backblaze console. | +| `_APP_STORAGE_LINODE_ACCESS_KEY` | **version >= 0.14.2** Linode object storage access key. Required when the storage adapter is set to Linode. You can get your access key from your Linode console. | +| `_APP_STORAGE_LINODE_SECRET` | **version >= 0.14.2** Linode object storage secret key. Required when the storage adapter is set to Linode + +## Functions {% #functions %} +| **Name** | **Description** | +|-------------------------------|-----------------| +| `_APP_FUNCTIONS_SIZE_LIMIT` | **version >= 0.13.0** The maximum size deployment in bytes. The default value is 30MB. | +| `_APP_FUNCTIONS_TIMEOUT` | **version >= 0.7.0** The maximum number of seconds allowed as a timeout value when creating a new function. The default value is 900 seconds. This is the global limit, timeout for individual functions are configured in the function's settings or in appwrite.json. | +| `_APP_FUNCTIONS_BUILD_TIMEOUT`| **version >= 0.13.0** The maximum number of seconds allowed as a timeout value when building a new function. The default value is 900 seconds. | +| `_APP_FUNCTIONS_CONTAINERS` | **version >= 0.7.0** Deprecated since 1.2.0. Runtimes now timeout by inactivity using `_APP_FUNCTIONS_INACTIVE_THRESHOLD`. | +| `_APP_FUNCTIONS_CPUS` | **version >= 0.7.0** The maximum number of CPU core a single cloud function is allowed to use. Please note that setting a value higher than available cores will result in a function error, which might result in an error. The default value is empty. When it's empty, CPU limit will be disabled. | +| `_APP_FUNCTIONS_MEMORY` | **version >= 0.7.0** The maximum amount of memory a single cloud function is allowed to use in megabytes. The default value is empty. When it's empty, memory limit will be disabled. | +| `_APP_FUNCTIONS_MEMORY_SWAP` | **version >= 0.7.0** Deprecated since 1.2.0. High use of swap memory is not recommended to preserve harddrive health. | +| `_APP_FUNCTIONS_RUNTIMES` | **version >= 0.8.0** This option allows you to enable or disable runtime environments for cloud functions. Disable unused runtimes to save disk space. To enable cloud function runtimes, pass a list of enabled environments separated by a comma. [Learn more about runtimes](/docs/products/functions/runtimes).| +| `_APP_EXECUTOR_SECRET` | **version >= 0.13.0** The secret key used by Appwrite to communicate with the function executor. Make sure to change this! | +| `_APP_EXECUTOR_HOST` | **version >= 0.13.0** The host used by Appwrite to communicate with the function executor! | +| `_APP_EXECUTOR_RUNTIME_NETWORK`| **version >= 0.13.0** Deprecated with 0.14.0, use `OPEN_RUNTIMES_NETWORK` instead! | +| `_APP_FUNCTIONS_ENVS` | **version >= 0.7.0** Deprecated with 0.8.0, use `_APP_FUNCTIONS_RUNTIMES` instead! | +| `_APP_FUNCTIONS_INACTIVE_THRESHOLD`| **version >= 0.13.0** The minimum time a function must be inactive before it can be shut down and cleaned up. This feature is intended to clean up unused containers. Containers may remain active for longer than the interval before being shut down, as Appwrite only cleans up unused containers every hour. If no value is provided, the default is 60 seconds. | +| `DOCKERHUB_PULL_USERNAME` | **version >= 0.10.0** Deprecated with 1.2.0, use `_APP_DOCKER_HUB_USERNAME` instead! | +| `DOCKERHUB_PULL_PASSWORD` | **version >= 0.10.0** Deprecated with 1.2.0, use `_APP_DOCKER_HUB_PASSWORD` instead! | +| `DOCKERHUB_PULL_EMAIL` | **version >= 0.10.0** Deprecated since 1.2.0. Email is no longer needed. | +| `OPEN_RUNTIMES_NETWORK` | **version >= 0.13.0** Deprecated with 1.2.0, use `_APP_FUNCTIONS_RUNTIMES_NETWORK` instead! | +| `_APP_FUNCTIONS_RUNTIMES_NETWORK`| **version >= 1.2.0** The docker network used for communication between the executor and runtimes. | +| `_APP_DOCKER_HUB_USERNAME` | **version >= 1.2.0** The username for hub.docker.com. This variable is used to pull images from hub.docker.com. | +| `_APP_DOCKER_HUB_PASSWORD` | **version >= 1.2.0** The password for hub.docker.com. This variable is used to pull images from hub.docker.com. | +| `_APP_FUNCTIONS_MAINTENANCE_INTERVAL`| **version >= 1.4.0** Interval value containing the number of seconds that the executor should wait before checking for inactive runtimes. The default value is 3600 seconds (1 hour). | + +## VCS (Version Control System) {% #vcs %} + +| **Name** | **Description** | +|---------------------------------|-----------------------------------------------------------------------------------------------------------------| +| `_APP_VCS_GITHUB_APP_NAME` | **version >= 1.4.0** - Name of your GitHub app. This value should be set to your GitHub application's URL. | +| `_APP_VCS_GITHUB_PRIVATE_KEY` | **version >= 1.4.0** - GitHub app RSA private key. You can generate private keys from GitHub application settings. | +| `_APP_VCS_GITHUB_APP_ID` | **version >= 1.4.0** - GitHub application ID. You can find it in your GitHub application details. | +| `_APP_VCS_GITHUB_CLIENT_ID` | **version >= 1.4.0** - GitHub client ID. You can find it in your GitHub application details. | +| `_APP_VCS_GITHUB_CLIENT_SECRET` | **version >= 1.4.0** - GitHub client secret. You can generate secrets in your GitHub application settings. | +| `_APP_VCS_GITHUB_WEBHOOK_SECRET`| **version >= 1.4.0** - GitHub webhook secret. You can configure it in your GitHub application settings under webhook section. | + + +## Maintenance {% #maintenance %} +| **Name** | **Description** | +|-------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `_APP_MAINTENANCE_INTERVAL` | **version >= 0.7.0** - Interval value containing the number of seconds that the Appwrite maintenance process should wait before executing system cleanups and optimizations. The default value is `86400` seconds (1 day). | +| `_APP_MAINTENANCE_RETENTION_CACHE` | **version >= 1.0.0** - The maximum duration (in seconds) upto which to retain cached files. The default value is `2592000` seconds (30 days). | +| `_APP_MAINTENANCE_RETENTION_EXECUTION` | **version >= 0.7.0** - The maximum duration (in seconds) upto which to retain execution logs. The default value is `1209600` seconds (14 days). | +| `_APP_MAINTENANCE_RETENTION_AUDIT` | **version >= 0.7.0** - The maximum duration (in seconds) upto which to retain audit logs. The default value is `1209600` seconds (14 days). | +| `_APP_MAINTENANCE_RETENTION_ABUSE` | **version >= 0.7.0** - The maximum duration (in seconds) upto which to retain abuse logs. The default value is `86400` seconds (1 day). | +| `_APP_MAINTENANCE_RETENTION_USAGE_HOURLY` | The maximum duration (in seconds) upto which to retain hourly usage metrics. The default value is `8640000` seconds (100 days). | +| `_APP_MAINTENANCE_RETENTION_SCHEDULES` | Schedules deletion interval (in seconds). | + +## GraphQL {% #graphql %} + +| **Name** | **Description** | +|------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `_APP_GRAPHQL_MAX_BATCH_SIZE` | **version >= 1.2.0** - Maximum number of batched queries per request. The default value is 10. | +| `_APP_GRAPHQL_MAX_COMPLEXITY` | **version >= 1.2.0** - Maximum complexity of a GraphQL query. One field adds one to query complexity. Lists multiply the complexity by the number of items requested. The default value is 250. | +| `_APP_GRAPHQL_MAX_DEPTH` | **version >= 1.2.0** - Maximum depth of a GraphQL query. One nested field level adds one to query depth. The default value is 3. | + +## Migrations {% #migrations %} +| **Name** | **Description** | +|-------------------------------------------------|---------------------------------------------------------------------------------------------------------| +| `_APP_MIGRATIONS_FIREBASE_CLIENT_ID` | **version >= 1.4.0** - Google OAuth client ID. You can find it in your GCP application settings. | +| `_APP_MIGRATIONS_FIREBASE_CLIENT_SECRET` | **version >= 1.4.0** - Google OAuth client secret. You can generate secrets in your GCP application settings. | + +## Assistant {% #assistant %} +| **Name** | **Description** | +|----------------------------------------|-------------------------------------------------------------------------| +| `_APP_ASSISTANT_OPENAI_API_KEY` | **version >= 1.4.0** - OpenAI API key. You can find it in your OpenAI application settings. | \ No newline at end of file diff --git a/src/routes/docs/advanced/self-hosting/functions/+page.markdoc b/src/routes/docs/advanced/self-hosting/functions/+page.markdoc index 4dd9324697..78b5b1d471 100644 --- a/src/routes/docs/advanced/self-hosting/functions/+page.markdoc +++ b/src/routes/docs/advanced/self-hosting/functions/+page.markdoc @@ -105,7 +105,7 @@ _APP_VCS_GITHUB_CLIENT_SECRET=35rsdse532q13 _APP_VCS_GITHUB_WEBHOOK_SECRET=super-secret ``` -[Learn more about environment variables](#) +[Learn more about environment variables](/docs/advanced/self-hosting/environment-variables) ### Update exiting GitHub apps {% #existing-apps %} @@ -125,7 +125,7 @@ The example below would enable Dart 2.15, .NET 6.0, and Java 18 runtimes. _APP_FUNCTIONS_RUNTIMES=dart-2.15, dotnet-6.0, java-18.0 ``` -You can find a full list of supported runtimes on the [environment variables page](#). +You can find a full list of supported runtimes on the [environment variables page](/docs/advanced/self-hosting/environment-variables). You can also configure the maximum timeout that can be set on individual Appwrite functions. The maximum configurable timeout can be increased by changing the `_APP_FUNCTIONS_TIMEOUT` environment variable. This environment variable changes the configurable maximum but does not alter existing configurations of individual functions. diff --git a/src/routes/docs/advanced/self-hosting/installation/+page.markdoc b/src/routes/docs/advanced/self-hosting/installation/+page.markdoc index 25cd10105f..e831c4eda7 100644 --- a/src/routes/docs/advanced/self-hosting/installation/+page.markdoc +++ b/src/routes/docs/advanced/self-hosting/installation/+page.markdoc @@ -65,22 +65,42 @@ In addition to running Appwrite locally, you can also launch Appwrite using a pr Choose from one of the providers below: -  |Provider | Installation Link ---- | --- | --- - {% icon icon="digitalocean" /%}| DigitalOcean | [Click to install](https://marketplace.digitalocean.com/apps/appwrite) - {% icon icon="gitpod" /%}| Gitpod | [Click to install](https://gitpod.io/#https://github.com/appwrite/integration-for-gitpod) - {% icon icon="akamai" /%}| Akamai Compute | [Click to install](https://www.linode.com/marketplace/apps/appwrite/appwrite/) +{% table %} +*   +* Provider +* Installation Link +--- +* {% only_dark %}{% icon_image src="/images/one-click/dark/digitalocean.svg" alt="DigitalOcean logo" size="m" /%}{% /only_dark %} +{% only_light %}{% icon_image src="/images/one-click/digitalocean.svg" alt="DigitalOcean logo" size="m" /%}{% /only_light %} +* DigitalOcean +* [Click to install](https://marketplace.digitalocean.com/apps/appwrite) +--- +* {% only_dark %}{% icon_image src="/images/one-click/dark/gitpod.svg" alt="Gitpod logo" size="m" /%}{% /only_dark %} +{% only_light %}{% icon_image src="/images/one-click/gitpod.svg" alt="Gitpod logo" size="m" /%}{% /only_light %} +* Gitpod +* [Click to install](https://gitpod.io/#https://github.com/appwrite/integration-for-gitpod) +--- +* {% only_dark %}{% icon_image src="/images/one-click/dark/akamai.svg" alt="Akamai logo" size="m" /%}{% /only_dark %} +{% only_light %}{% icon_image src="/images/one-click/akamai.svg" alt="Akamai logo" size="m" /%}{% /only_light %} +* Akamai Compute +* [Click to install](https://www.linode.com/marketplace/apps/appwrite/appwrite/) +{% /table %} + ## Next steps {% #next-steps %} Self-hosting Appwrite gives you more configurable options. Make these configurations to unlock the full power of Appwrite. -- [Configure email delivery](#) -- [Configure SMS delivery](#) -- [Configure Appwrite Functions](#) -- [Configure Appwrite Storage](#) -- [Configure TLS Certificates](#) +[Configure Appwrite Functions](/docs/advanced/self-hosting/functions) + +[Configure email delivery](/docs/advanced/self-hosting/email) + +[Configure SMS delivery](/docs/advanced/self-hosting/sms) + +[Configure Appwrite Storage](/docs/advanced/self-hosting/storage) + +[Configure TLS Certificates](/docs/advanced/self-hosting/tls-certificates) ## Manual (Docker Compose) {% #manual %} diff --git a/src/routes/docs/advanced/self-hosting/production/+page.markdoc b/src/routes/docs/advanced/self-hosting/production/+page.markdoc index 529f89262c..e582cea80c 100644 --- a/src/routes/docs/advanced/self-hosting/production/+page.markdoc +++ b/src/routes/docs/advanced/self-hosting/production/+page.markdoc @@ -16,7 +16,7 @@ Make sure to keep this key in a safe place and never make it publicly accessible {% info title="Best practice" %} You should always prefer **HTTPS** over HTTP in production environments. This keeps your APIs secure and prevents any redirects from interfering with your requests. -You can force the use of HTTPS with the [_APP_OPTIONS_FORCE_HTTPS](#) environment variable. +You can force the use of HTTPS with the [_APP_OPTIONS_FORCE_HTTPS](/docs/advanced/self-hosting/environment-variables) environment variable. {% /info %} ## Console access {% #console-access %} @@ -29,7 +29,7 @@ Appwrite provides three different methods to limit access to your Appwrite Conso By default, only the first user can sign up on the Appwrite instance's dashboard. All other users must be added to the dashboard through invitation. -[Learn more about environment variables {% icon icon="cheveron-right" /%}](#) +[Learn more about environment variables {% icon icon="cheveron-right" /%}](/docs/advanced/self-hosting/environment-variables) ## Scaling {% #scaling %} @@ -47,7 +47,7 @@ If you disabled rate limits during development, make sure you re-enable them whe Rate limits are an important mechanism to protect your app. Without rate limits, malicious actors can spam your APIs to perform [denial-of-service type attacks](https://en.wikipedia.org/wiki/Denial-of-service_attack) or brute-force user passwords. -[Learn more about environment variables {% icon icon="cheveron-right" /%}](#) +[Learn more about environment variables {% icon icon="cheveron-right" /%}](/docs/advanced/self-hosting/environment-variables) ## Emails {% #emails %} @@ -70,7 +70,7 @@ Do not back up any stateful container using a docker volume backup, such as data ## Errors {% #errors %} -By default, your Appwrite installation comes with error reporting turned off. You can [enable dev mode](#) to get access to more verbose error logs and stack traces. +By default, your Appwrite installation comes with error reporting turned off. You can [enable dev mode](/docs/advanced/self-hosting/debug#development-mode) to get access to more verbose error logs and stack traces. In production, it is highly recommended to turn error reporting off. To do so, make sure the Appwrite container environment variable `_APP_ENV` value from is set to `production` and not `development`. @@ -78,7 +78,7 @@ To monitor errors in production, add a third party monitoring service by setting In production, it is highly recommended to turn error reporting off. To do so, make sure the Appwrite container environment variable `_APP_ENV` is set to `production` and not `development`. -[Learn more about environment variables {% icon icon="cheveron-right" /%}](#) +[Learn more about environment variables {% icon icon="cheveron-right" /%}](/docs/advanced/self-hosting/environment-variables) ## Security {% #security %} diff --git a/src/routes/docs/advanced/self-hosting/sms/+page.markdoc b/src/routes/docs/advanced/self-hosting/sms/+page.markdoc index 211f0ed0b0..456ddb98fa 100644 --- a/src/routes/docs/advanced/self-hosting/sms/+page.markdoc +++ b/src/routes/docs/advanced/self-hosting/sms/+page.markdoc @@ -6,18 +6,46 @@ description: Learn how to integrate Appwrite in your application with one of the Appwrite supports phone authentication, which allows users to create accounts and log in using SMS messages. Appwrite requires an SMS provider to be set up before using Phone authentication. -## SMS Providers {% #sms-providers %} +## SMS providers {% #sms-providers %} Appwrite supports a growing list of SMS providers that you can choose from. Choose one from the list below and set up an account. -|   | SMS Provider | Create Account | Get Credentials | -| ----------------- | -------------- | ------------------------------------------------------- | ----------------------------------------------------- | -| | | | | -| [TODO] | Twilio | [Website](https://www.twilio.com) | [Documentation](https://www.twilio.com/docs/iam/access-tokens#step-2-api-key) | -| [TODO] | TextMagic | [Website](https://www.textmagic.com) | [Documentation](https://www.textmagic.com/docs/api/start/#How-to-obtain-the-API-credentials) | -| [TODO] | Telesign | [Website](https://www.telesign.com) | [Documentation](https://support.telesign.com/s/article/Find-Customer-ID-and-API-Key) | -| [TODO] | MSG91 | [Website](https://msg91.com) | [Documentation](https://msg91.com/help/where-can-i-find-my-authentication-key) | -| [TODO] | Vonage | [Website](https://www.vonage.ca/) | [Documentation](https://developer.vonage.com/en/account/secret-management) | +{% table %} +*   {% width=80 %} +* SMS provider +* Create account +* Get credentials +--- +* {% only_dark %}{% icon_image src="/images/sms-providers/dark/twilio.svg" alt="Twilio logo" size="l" /%}{% /only_dark %} +{% only_light %}{% icon_image src="/images/sms-providers/twilio.svg" alt="Twilio logo" size="l" /%}{% /only_light %} +* Twilio +* [Website](https://www.twilio.com) +* [Documentation](https://www.twilio.com/docs/iam/access-tokens#step-2-api-key) +--- +* {% only_dark %}{% icon_image src="/images/sms-providers/dark/textmagic.svg" alt="TextMagic logo" size="l" /%}{% /only_dark %} +{% only_light %}{% icon_image src="/images/sms-providers/textmagic.svg" alt="TextMagic logo" size="l" /%}{% /only_light %} +* TextMagic +* [Website](https://www.textmagic.com) +* [Documentation](https://www.textmagic.com/docs/api/start/#How-to-obtain-the-API-credentials) +--- +* {% only_dark %}{% icon_image src="/images/sms-providers/dark/telesign.svg" alt="Telesign logo" size="l" /%}{% /only_dark %} +{% only_light %}{% icon_image src="/images/sms-providers/telesign.svg" alt="Telesign logo" size="l" /%}{% /only_light %} +* Telesign +* [Website](https://www.telesign.com) +* [Documentation](https://support.telesign.com/s/article/Find-Customer-ID-and-API-Key) +--- +* {% only_dark %}{% icon_image src="/images/sms-providers/dark/msg91.svg" alt="MSG91 logo" size="l" /%}{% /only_dark %} +{% only_light %}{% icon_image src="/images/sms-providers/msg91.svg" alt="MSG91 logo" size="l" /%}{% /only_light %} +* MSG91 +* [Website](https://msg91.com) +* [Documentation](https://msg91.com/help/where-can-i-find-my-authentication-key) +--- +* {% only_dark %}{% icon_image src="/images/sms-providers/dark/vonage.svg" alt="Vonage logo" size="l" /%}{% /only_dark %} +{% only_light %}{% icon_image src="/images/sms-providers/vonage.svg" alt="Vonage logo" size="l" /%}{% /only_light %} +* Vonage +* [Website](https://www.vonage.ca/) +* [Documentation](https://developer.vonage.com/en/account/secret-management) +{% /table %} ## Environment variables {% #environment-variables %} diff --git a/src/routes/docs/advanced/self-hosting/storage/+page.markdoc b/src/routes/docs/advanced/self-hosting/storage/+page.markdoc index 79537de267..ba8eee1ca7 100644 --- a/src/routes/docs/advanced/self-hosting/storage/+page.markdoc +++ b/src/routes/docs/advanced/self-hosting/storage/+page.markdoc @@ -14,11 +14,11 @@ Some of these services can be self-hosted, just like Appwrite. You can select which storage adapter to use by setting the `_APP_STORAGE_DEVICE` environment variable. Valid values are `local`, `s3`, `dospaces`, `backblaze`, `linode`, and `wasabi`. Each storage adapter requires its own set of additional environment variables to configure. -[Learn more about storage environment variables {% icon icon="cheveron-right" /%}](#) +[Learn more about storage environment variables {% icon icon="cheveron-right" /%}](/docs/advanced/self-hosting/environment-variables) ## Maximum file size {% #adapters %} The maximum size for a single file upload is controlled by the `_APP_STORAGE_LIMIT` environment variable, which defaults to 30 MB. -See [Environment Variables](#) for more information. +[Learn more about environment variables](/docs/advanced/self-hosting/environment-variables). {% partial file="update-variables.md" /%} diff --git a/src/routes/docs/advanced/self-hosting/update/+page.markdoc b/src/routes/docs/advanced/self-hosting/update/+page.markdoc index df1dde0f9c..8a6ff39470 100644 --- a/src/routes/docs/advanced/self-hosting/update/+page.markdoc +++ b/src/routes/docs/advanced/self-hosting/update/+page.markdoc @@ -26,7 +26,7 @@ parent_directory <= you run the command in this directory This is the parent directory where you will find the `appwrite directory, inside which there are `docker-compose.yml` and `.env` files. -## [Installing the Next Version](#) +## Installing the next version {% #install-next-version %} ### Unix diff --git a/src/routes/docs/apis/graphql/+page.markdoc b/src/routes/docs/apis/graphql/+page.markdoc index 555deff73c..8ac1071d31 100644 --- a/src/routes/docs/apis/graphql/+page.markdoc +++ b/src/routes/docs/apis/graphql/+page.markdoc @@ -4,7 +4,7 @@ title: GraphQL description: Description used for SEO --- -Appwrite supports multiple protocols for accessing the server, including [REST](/docs/rest), [GraphQL](/docs/graphql), and [Realtime](/docs/realtime). +Appwrite supports multiple protocols for accessing the server, including [REST](/docs/apis/rest), [GraphQL](/docs/apis/graphql), and [Realtime](/docs/apis/realtime). The GraphQL API allows you to query and mutate any resource type on your Appwrite server through the endpoint `/v1/graphql`. Every endpoint available through REST is available through GraphQL, except for OAuth. @@ -109,7 +109,7 @@ GraphQL authenticates using Appwrite accounts and sessions. Both accounts and sessions can be created with GraphQL using the `accountCreate`, `accountCreateEmailSession`, `accountCreateAnonymousSession`, or `accountCreatePhoneSession` mutations. -More information and examples of authenticating users can be found in the dedicated [authentication guide](/docs/authentication). +More information and examples of authenticating users can be found in the dedicated [authentication guide](/docs/products/auth). ## GraphQL vs REST {% #graphql-vs-rest %} diff --git a/src/routes/docs/apis/realtime/+page.markdoc b/src/routes/docs/apis/realtime/+page.markdoc index 7fe8dc8c03..6796107e4b 100644 --- a/src/routes/docs/apis/realtime/+page.markdoc +++ b/src/routes/docs/apis/realtime/+page.markdoc @@ -93,7 +93,7 @@ To subscribe to updates from different Appwrite resources, you need to specify o If you subscribe to a channel, you will receive callbacks for a variety of events related to the channel. The events attribute in the callback can be used to filter and respond to specific events in a channel. -[View a list of all available events](#). +[View a list of all available events](/docs/advanced/platform/events). {% info title="Permissions" %} @@ -337,7 +337,7 @@ The payload from the subscription will contain following properties: --- * events * string[] -* The [system events](#) that triggered this update. +* The [Appwrite events](/docs/advanced/platform/events) that triggered this update. --- * channels * string[] diff --git a/src/routes/docs/apis/rest/+page.markdoc b/src/routes/docs/apis/rest/+page.markdoc index a466d4c94d..27e82f5046 100644 --- a/src/routes/docs/apis/rest/+page.markdoc +++ b/src/routes/docs/apis/rest/+page.markdoc @@ -31,7 +31,7 @@ Appwrite's REST APIs expect certain headers to be included with each request: --- * X-Appwrite-JWT: [TOKEN] * optional -* Token used for JWT authentication, tokens can be generated using the [Create JWT](/docs/products/auth/server-integrations) method. +* Token used for JWT authentication, tokens can be generated using the [Create JWT](/docs/products/auth/jwt) method. --- * X-Appwrite-Response-Format: [VERSION-NUMBER] * optional @@ -95,7 +95,7 @@ X-Appwrite-Key: [API_KEY] ### JWT -JWT authentication is frequently used by server applications to act on behalf of a user. Users generate tokens using the [Create JWT] (TODO) endpoint. When issuing requests authenticated with a JWT, Appwrite will treat the request like it is from the authenticated user. +JWT authentication is frequently used by server applications to act on behalf of a user. Users generate tokens using the [Create JWT](/docs/references/cloud/client-web/account#createJWT) endpoint. When issuing requests authenticated with a JWT, Appwrite will treat the request like it is from the authenticated user. ```json GET /v1/account HTTP/1.1 @@ -108,7 +108,7 @@ X-Appwrite-JWT: [TOKEN] Appwrite implements resumable, chunked uploads for files larger than 5MB. Chunked uploads send files in chunks of 5MB to reduce memory footprint and increase resilience when handling large files. Appwrite SDKs will automatically handle chunked uploads, but it is possible to implement this with the REST API directly. -Upload endpoints in Appwrite, such as [Create File] (todo) and [Create Deployment] (todo), are different from other endpoints. These endpoints take multipart form data instead of JSON data. To implement chunked uploads, you will need to implement the following headers. If you wish, this logic is already available in any of the [Appwrite SDKs](/docs/sdks). +Upload endpoints in Appwrite, such as [Create File] (/docs/references/cloud/client-web/storage#createFile) and [Create Deployment] (/docs/references/cloud/server-nodejs/functions#createDeployment), are different from other endpoints. These endpoints take multipart form data instead of JSON data. To implement chunked uploads, you will need to implement the following headers. If you wish, this logic is already available in any of the [Appwrite SDKs](/docs/sdks). {% table %} * Header diff --git a/src/routes/docs/products/auth/+layout.svelte b/src/routes/docs/products/auth/+layout.svelte index 9cd071a117..74de2203b6 100644 --- a/src/routes/docs/products/auth/+layout.svelte +++ b/src/routes/docs/products/auth/+layout.svelte @@ -21,6 +21,31 @@ } ] }, + { + label: 'Concepts', + items: [ + { + label: 'Accounts', + href: '/docs/products/auth/accounts' + }, + { + label: 'Users', + href: '/docs/products/auth/users' + }, + { + label: 'Teams', + href: '/docs/products/auth/teams' + }, + { + label: 'Labels', + href: '/docs/products/auth/labels' + }, + { + label: 'Security', + href: '/docs/products/auth/security' + } + ] + }, { label: 'Journeys', items: [ @@ -46,31 +71,10 @@ }, { label: 'JWT login', - href: '/docs/products/auth/server-integrations' + href: '/docs/products/auth/jwt' }, ] }, - { - label: 'Concepts', - items: [ - { - label: 'Accounts', - href: '/docs/products/auth/accounts' - }, - { - label: 'Teams', - href: '/docs/products/auth/teams' - }, - { - label: 'Labels', - href: '/docs/products/auth/labels' - }, - { - label: 'Security', - href: '/docs/products/auth/security' - } - ] - }, { label: 'References', items: [ @@ -83,7 +87,7 @@ href: '/docs/references/cloud/server-nodejs/users' }, { - label: 'Users API', + label: 'Teams API', href: '/docs/references/cloud/client-web/teams' } ] diff --git a/src/routes/docs/products/auth/+page.markdoc b/src/routes/docs/products/auth/+page.markdoc index d35cb98dcc..53acdb4d83 100644 --- a/src/routes/docs/products/auth/+page.markdoc +++ b/src/routes/docs/products/auth/+page.markdoc @@ -1,7 +1,8 @@ --- layout: article -title: Authentication +title: Overview description: This is the description used for SEO. +back: /docs --- Appwrite Authentication delivers more than just user sign up and log in. diff --git a/src/routes/docs/products/auth/accounts/+page.markdoc b/src/routes/docs/products/auth/accounts/+page.markdoc index 87283fd9c9..2fe19ab83d 100644 --- a/src/routes/docs/products/auth/accounts/+page.markdoc +++ b/src/routes/docs/products/auth/accounts/+page.markdoc @@ -4,7 +4,7 @@ title: Accounts description: This is the description used for SEO. --- -Appwrite allows users to create accounts. +Appwrite Account API is used for user signup and login in client applications. Users can be organized into teams and be given labels, so they can be given different permissions and access different resources. Each user's account can also have their own preference object, which you can use to save preferences such as theme, language, and notification settings. @@ -22,7 +22,7 @@ authentication. ## Preferences {% #preferences %} -You can store user preferences on a user's account using Appwrite's [Update Preferences](#) endpoint. You can store preferences such as theme, notification settings, or preferred language so they can be synced across multiple devices. +You can store user preferences on a user's account using Appwrite's [Update Preferences](/docs/references/cloud/client-web/account#updatePrefs) endpoint. You can store preferences such as theme, notification settings, or preferred language so they can be synced across multiple devices. Preferences are stored as a key-value JSON object. The maximum allowed size for preferences is 64kB, and an error will be thrown if this limit is exceeded. @@ -108,7 +108,7 @@ mutation { ``` {% /multicode %} -After a user's preferences are updated, they can be retrieved using the [Get Preferences](#) endpoint. +After a user's preferences are updated, they can be retrieved using the [get account preferences](/docs/references/cloud/client-web/account#getPrefs) endpoint. {% multicode %} ```js @@ -183,4 +183,6 @@ individual users using the `Role.user(, )` role. | Verified user | `Role.user(, 'verified')`| | Unverified user | `Role.user(, 'unverified')` | -[Learn more about permissions](/docs/advanced/platform/permissions) \ No newline at end of file + + +[Learn more about permissions {% icon icon="cheveron-right" /%}](/docs/advanced/platform/permissions) \ No newline at end of file diff --git a/src/routes/docs/products/auth/anonymous/+page.markdoc b/src/routes/docs/products/auth/anonymous/+page.markdoc index 2b9243ec9b..e9f45c8a49 100644 --- a/src/routes/docs/products/auth/anonymous/+page.markdoc +++ b/src/routes/docs/products/auth/anonymous/+page.markdoc @@ -1,16 +1,16 @@ --- layout: article -title: Anonymous +title: Anonymous login description: This is the description used for SEO. --- -Anonymous sessions allow you to implement guest users. Guest users let you store user information like items in their cart or theme preferences before they create an account. This reduces the friction for your users to get started with your app. +Anonymous sessions allow you to implement **guest** users. Guest users let you store user information like items in their cart or theme preferences before they create an account. This reduces the friction for your users to get started with your app. **If a user later creates an account**, their information will be inherited by the newly created account. ## Create anonymous session {% #createSession %} -Create an anonymous session with [Create Anonymous Session](#) route. +Create an anonymous session with [Create Anonymous Session](/docs/references/cloud/client-web/account#createAnonymousSession) route. {% multicode %} ```js @@ -82,7 +82,10 @@ Anonymous users cannot sign back in. If the session expires, they move to anothe Create an account with any of these methods to transition from an anonymous session to a user account session. -- [Email and password](/docs/products/auth/email-password) -- [Phone (SMS)](/docs/products/auth/phone-sms) -- [Magic URL](/docs/products/auth/magic-url) -- [OAuth2](/docs/products/auth/oauth2) +[Email and password {% icon icon="cheveron-right" /%}](/docs/products/auth/email-password) + +[Phone (SMS) {% icon icon="cheveron-right" /%}](/docs/products/auth/phone-sms) + +[Magic URL {% icon icon="cheveron-right" /%}](/docs/products/auth/magic-url) + +[OAuth2 {% icon icon="cheveron-right" /%}](/docs/products/auth/oauth2) diff --git a/src/routes/docs/products/auth/email-password/+page.markdoc b/src/routes/docs/products/auth/email-password/+page.markdoc index 616e6ba7ad..3225185f4b 100644 --- a/src/routes/docs/products/auth/email-password/+page.markdoc +++ b/src/routes/docs/products/auth/email-password/+page.markdoc @@ -1,12 +1,12 @@ --- layout: article -title: Email and Password +title: Email and password login description: This is the description used for SEO. --- Email and password login is the most commonly used authentication method. Appwrite Authentication promotes a safer internet by providing secure APIs and promoting better password choices to end users. Appwrite supports added security features like blocking personal info in passwords, password dictionary, and password history to help users choose good passwords. -## Sign up {% #sign-up %} +## Signup {% #sign-up %} You can use the Appwrite Client SDKs to create an account using email and password. @@ -28,7 +28,7 @@ promise.then(function (response) { }); ``` -Passwords are hashed with [Argon2](#), a resilient and secure password hashing algorithm. +Passwords are hashed with [Argon2](https://github.com/P-H-C/phc-winner-argon2), a resilient and secure password hashing algorithm. ## Verification {% #verification %} @@ -106,7 +106,7 @@ promise.then(function (response) { If a user forgets their password, they can initiate a password recovery flow to recover their password. The Create Password Recovery endpoint sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link, they are redirected back to the password reset URL with the secret key and email address values attached to the URL as query strings. -Only redirect URLs to domains added as a platform on your Appwrite console will be accepted. URLs not added as a platform are rejected to protect against redirect attacks. +Only redirect URLs to domains added as a platform on your Appwrite Console will be accepted. URLs not added as a platform are rejected to protect against redirect attacks. ```js import { Client, Account } from "appwrite"; diff --git a/src/routes/docs/products/auth/server-integrations/+page.markdoc b/src/routes/docs/products/auth/jwt/+page.markdoc similarity index 96% rename from src/routes/docs/products/auth/server-integrations/+page.markdoc rename to src/routes/docs/products/auth/jwt/+page.markdoc index 2b91eeaa3f..6c1474562f 100644 --- a/src/routes/docs/products/auth/server-integrations/+page.markdoc +++ b/src/routes/docs/products/auth/jwt/+page.markdoc @@ -1,10 +1,10 @@ --- layout: article -title: Server Integrations +title: JWT login description: This is the description used for SEO. --- -You can extend Appwrite's APIs by building backend apps using [Server SDKs](#). To secure your backend app's APIs, client apps must prove their identity against your backend app before accessing sensitive information. You can secure these APIs and enforce access permissions in your backend app by using JWT authentication. +You can extend Appwrite's APIs by building backend apps using [Server SDKs](/docs/sdks#server). To secure your backend app's APIs, client apps must prove their identity against your backend app before accessing sensitive information. You can secure these APIs and enforce access permissions in your backend app by using JWT authentication. If you are already authenticated on your client-side app and need your backend app to **act on behalf of the user**, this guide will walk you through the process. @@ -20,7 +20,7 @@ When you build backend APIs to extend Appwrite's functionality, these APIs shoul You need to create a session using the Client SDKs **before** generating a JWT. The JWT will be a stateless proof of claim for the identity of the authenticated user and expire after 15 minutes or when the session is deleted. -You can generate a JWT like this: +You can generate a JWT like this on a [Client SDK](/docs/sdks#client). {% multicode %} ```js @@ -79,6 +79,7 @@ mutation { Your server application can use the JWT to act on behalf of the user by creating a `Client` instance with the JWT for **each request it receives**. To keep your API secure, **discard the client object** after each request. +Use JWTs tokens like this in a [Server SDK](/docs/sdks#server). {% multicode %} ```js const { Client } = require('node-appwrite'); @@ -364,7 +365,7 @@ Only Kevin's birthday is returned and documents where `user-A` has no permission } ``` -If the same request is made where the Server SDK's `client` is authenticated with an API key instead of a JWT, the results returned will be different. +If the same request is made where the [Server SDK](/docs/sdks#server)'s `client` is authenticated with an API key instead of a JWT, the results returned will be different. {% multicode %} ```js diff --git a/src/routes/docs/products/auth/labels/+page.markdoc b/src/routes/docs/products/auth/labels/+page.markdoc index e3c4c916fa..b0adad8fbf 100644 --- a/src/routes/docs/products/auth/labels/+page.markdoc +++ b/src/routes/docs/products/auth/labels/+page.markdoc @@ -183,4 +183,4 @@ This would correspond with the permissions below. | Delete | `Permissions.delete(Role.label('subscriber'))` | | Create | `Permissions.create(Role.label('subscriber'))` | -[Learn more about permissions](/docs/advanced/platform/permissions) +[Learn more about permissions {% icon icon="cheveron-right" /%}](/docs/advanced/platform/permissions) \ No newline at end of file diff --git a/src/routes/docs/products/auth/magic-url/+page.markdoc b/src/routes/docs/products/auth/magic-url/+page.markdoc index f316c4bd5c..1ba64b0f84 100644 --- a/src/routes/docs/products/auth/magic-url/+page.markdoc +++ b/src/routes/docs/products/auth/magic-url/+page.markdoc @@ -1,14 +1,14 @@ --- layout: article -title: Magic URL +title: Magic URL login description: This is the description used for SEO. --- Magic URL is a password-less way to authenticate users. When a user logs in by providing their email, they will receive an email with a "magic" link that contains a secret used to log in the user. The user can simply click the link to be logged in. -## Send Email {% #init %} +## Send email {% #init %} -Initialize the log in process with the [Create Magic URL Session](#) route. If the email has never been used, a **new account is generated**, then the user will receive an email. If the email is already attached to an account, the **user ID is ignored** and the user will receive a link in their email. +Initialize the log in process with the [Create Magic URL Session](/docs/references/cloud/client-web/account#createMagicURLSession) route. If the email has never been used, a **new account is generated**, then the user will receive an email. If the email is already attached to an account, the **user ID is ignored** and the user will receive a link in their email. {% multicode %} ```js diff --git a/src/routes/docs/products/auth/oauth2/+page.markdoc b/src/routes/docs/products/auth/oauth2/+page.markdoc index ff42ee15a0..70a7e2903e 100644 --- a/src/routes/docs/products/auth/oauth2/+page.markdoc +++ b/src/routes/docs/products/auth/oauth2/+page.markdoc @@ -1,6 +1,6 @@ --- layout: article -title: OAuth 2 +title: OAuth 2 login description: This is the description used for SEO. --- @@ -22,7 +22,7 @@ Before using OAuth 2 login, you need to enable and configure an OAuth 2 login pr ## Initialize OAuth 2 login {% #init %} -To initialize the OAuth 2 login process, use the [Create OAuth 2 Session](#) route. +To initialize the OAuth 2 login process, use the [Create OAuth 2 Session](/docs/references/cloud/client-web/account#createOAuth2Session) route. {% tabs %} {% tabsitem #js title="Javascript" %} @@ -221,7 +221,7 @@ print(session.providerAccessToken); {% /multicode %} -An OAuth 2 [session](https://appwrite.io/docs/models/session) will have the following attributes. +An OAuth 2 [session](/docs/references/cloud/models/session) will have the following attributes. | Property | Description | | -------------------------- | --------------------------------------------------------------------------------------------------------- | @@ -234,7 +234,7 @@ You can use the `providerAccessToken` to make requests to your OAuth 2 provider. ## OAuth 2 profile {% #profile %} -OAuth 2 sessions expire to protect from security risks. OAuth 2 sessions should be refreshed periodically, so access tokens don't expire. Check value of `providerAccessTokenExpiry` to know if the token is expired or is about to expire. Refreshing before every request might cause rate limit problems. You can do this by calling the [Update OAuth Session](#) endpoint when ever your user visits your app. +OAuth 2 sessions expire to protect from security risks. OAuth 2 sessions should be refreshed periodically, so access tokens don't expire. Check value of `providerAccessTokenExpiry` to know if the token is expired or is about to expire. Refreshing before every request might cause rate limit problems. You can do this by calling the [Update OAuth Session](/docs/references/cloud/client-web/account#updateSession) endpoint when ever your user visits your app. {% multicode %} ```js @@ -293,4 +293,6 @@ let session = try await account.updateSession( {% /multicode %} -> **Note**: OAuth 2 is not available through the GraphQL API. You can use the REST API or any Client SDK instead. \ No newline at end of file +{% info title="GraphQL" %} +OAuth 2 is not available through the GraphQL API. You can use the REST API or any Client SDK instead. +{% /info %} \ No newline at end of file diff --git a/src/routes/docs/products/auth/phone-sms/+page.markdoc b/src/routes/docs/products/auth/phone-sms/+page.markdoc index 2b77134f9e..ae02d4b28f 100644 --- a/src/routes/docs/products/auth/phone-sms/+page.markdoc +++ b/src/routes/docs/products/auth/phone-sms/+page.markdoc @@ -1,12 +1,12 @@ --- layout: article -title: Phone and SMS +title: Phone (SMS) login description: This is the description used for SEO. --- Phone authentication lets users create accounts using their phone numbers and log in through SMS messages. -## [Send SMS Message](#init) {% #init %} +## Send SMS message {% #init %} Phone authentication is done using a two-step authentication process. When using phone authentication, the authentication request is initiated from the client application and an SMS message is sent to the user's phone. The SMS message will contain a secret the user can use to log in. @@ -97,7 +97,7 @@ mutation { {% /multicode %} -## [Log In](#login) {% #login %} +## Login {% #login %} After initiating the phone authentication process, the returned user ID and secret are used to confirm the user. The secret will usually be a 6-digit number in the SMS message sent to the user. diff --git a/src/routes/docs/products/auth/quick-start/+page.markdoc b/src/routes/docs/products/auth/quick-start/+page.markdoc index 1f6a2f1810..658770599a 100644 --- a/src/routes/docs/products/auth/quick-start/+page.markdoc +++ b/src/routes/docs/products/auth/quick-start/+page.markdoc @@ -10,7 +10,7 @@ Adding signup and login is as simple as this. ## Sign up {% #sign-up %} -You can use the Appwrite Client SDKs to create an account using email and password. +You can use the Appwrite [Client SDKs](/docs/sdks#client) to create an account using email and password. {% multicode %} ```js @@ -91,7 +91,7 @@ mutation { ## Login {% #login %} -After you've created your account, users can be logged in using the Create Email Session route. +After you've created your account, users can be logged in using the [Create Email Session](/docs/references/cloud/client-web/account#createEmailSession) route. {% multicode %} ```js diff --git a/src/routes/docs/products/auth/security/+page.markdoc b/src/routes/docs/products/auth/security/+page.markdoc index 80544b5574..1435590669 100644 --- a/src/routes/docs/products/auth/security/+page.markdoc +++ b/src/routes/docs/products/auth/security/+page.markdoc @@ -10,15 +10,16 @@ Appwrite provides many security features to keep both your Appwrite project and Appwrite handles the persistence of the session in a consistent way across SDKs. After authenticating with an SDK, the SDK will persist the session so that the user will not need to log in again the next time they open the app. The mechanism for persistence depends on the SDK. -> **Best Practice** -> Only keep user sessions active as long as needed and maintain exactly **one** instance of the Client SDK in your app to avoid conflicting session data. +{% info title="Best Practice" %} +Only keep user sessions active as long as needed and maintain exactly **one** instance of the Client SDK in your app to avoid conflicting session data. +{% /info %} -| | Framework | Storage method | +| {% width=70 %} | Framework {% width=120 %} | Storage method | |:----------------------------------------------------------------------------------------------------:|:---:|:----------------------------------------------------------------------------------------------------------------------:| -| [TODO] | Web | Uses a secure session cookie and falls back to local storage when a session cookie is not available. | -| [TODO] | Flutter | Uses a session cookie stored in Application Documents through the **path_provider** package. | -| [TODO] | Apple | Uses a session cookie stored in **UserDefaults**. | -| [TODO] | Android | Uses a session cookie stored in **SharedPreferences**. | +| {% only_dark %}{% icon_image src="/images/platforms/dark/javascript.svg" alt="Javascript logo" size="m" /%}{% /only_dark %}{% only_light %}{% icon_image src="/images/platforms/javascript.svg" alt="Javascript logo" size="m" /%}{% /only_light %} | Web | Uses a secure session cookie and falls back to local storage when a session cookie is not available. | +| {% only_dark %}{% icon_image src="/images/platforms/dark/flutter.svg" alt="Javascript logo" size="m" /%}{% /only_dark %}{% only_light %}{% icon_image src="/images/platforms/flutter.svg" alt="Javascript logo" size="m" /%}{% /only_light %} | Flutter | Uses a session cookie stored in Application Documents through the **path_provider** package. | +| {% only_dark %}{% icon_image src="/images/platforms/dark/apple.svg" alt="Javascript logo" size="m" /%}{% /only_dark %}{% only_light %}{% icon_image src="/images/platforms/apple.svg" alt="Javascript logo" size="m" /%}{% /only_light %} | Apple | Uses a session cookie stored in **UserDefaults**. | +| {% only_dark %}{% icon_image src="/images/platforms/dark/android.svg" alt="Javascript logo" size="m" /%}{% /only_dark %}{% only_light %}{% icon_image src="/images/platforms/android.svg" alt="Javascript logo" size="m" /%}{% /only_light %} | Android | Uses a session cookie stored in **SharedPreferences**. | ## Session limits In Appwrite versions 1.2 and above, you can limit the number of active sessions created per user to prevent the accumulation of unused but active sessions. New sessions created by the same user past the session limit delete the oldest session. diff --git a/src/routes/docs/products/auth/teams/+page.markdoc b/src/routes/docs/products/auth/teams/+page.markdoc index 2ccffd89ad..b3f032f2ff 100644 --- a/src/routes/docs/products/auth/teams/+page.markdoc +++ b/src/routes/docs/products/auth/teams/+page.markdoc @@ -5,10 +5,10 @@ description: This is the description used for SEO. --- Teams are a good way to allow users to share access to resources. -For example, in a todo app, a user can [create a team](#) for one of their todo lists and [invite another user](#) to the team to grant the other user access. +For example, in a todo app, a user can [create a team](/docs/references/cloud/client-web/teams#create) for one of their todo lists and [invite another user](/docs/references/cloud/client-web/teams#createMembership) to the team to grant the other user access. You can further give special rights to parts of a team using team roles. -The invited user can [accept the invitation](#) to gain access. If the user's ever removed from the team, they'll lose access again. +The invited user can [accept the invitation](/docs/references/cloud/client-web/teams#updateMembershipStatus) to gain access. If the user's ever removed from the team, they'll lose access again. ## Create team {% #create %} For example, we can create a team called `teachers` with roles `maths`, `sciences`, `arts`, and `literature`. @@ -195,4 +195,7 @@ individual roles in the team using the `Role.team(, [, | Description | Role | | ------------------------------------------- | ------------------------------------------- | | All members | `Role.team()`| -| Select roles | `Role.team(, [, , ...])`| \ No newline at end of file +| Select roles | `Role.team(, [, , ...])`| + + +[Learn more about permissions {% icon icon="cheveron-right" /%}](/docs/advanced/platform/permissions) \ No newline at end of file diff --git a/src/routes/docs/products/auth/users/+page.markdoc b/src/routes/docs/products/auth/users/+page.markdoc new file mode 100644 index 0000000000..f967a704db --- /dev/null +++ b/src/routes/docs/products/auth/users/+page.markdoc @@ -0,0 +1,15 @@ +--- +layout: article +title: Manage users +description: This is the description used for SEO. +--- + +Appwrite Users API is used for managing users in server applications. +Users API can only be used with an API key with the [Server SDK](/docs/sdks#server), to manage all users. +If you need to act on behalf of users through an Appwrite Function or your own backend, use [JWT login](/docs/products/auth/jwt). + +{% partial file="account-vs-user.md" /%} + +The users API can be used to create users, import users, update user info, get user audit logs, and remove users. + +[Learn more in the Users API references {% icon icon="cheveron-right" /%}](/docs/references/cloud/server-nodejs/users) diff --git a/src/routes/docs/products/databases/+layout.svelte b/src/routes/docs/products/databases/+layout.svelte index b1ebf61e20..432fede1ad 100644 --- a/src/routes/docs/products/databases/+layout.svelte +++ b/src/routes/docs/products/databases/+layout.svelte @@ -62,7 +62,16 @@ href: '/docs/products/databases/pagination' } ] - } + }, + { + label: 'References', + items: [ + { + label: 'Databases API', + href: '/docs/references/cloud/client-web/databases' + }, + ] + }, ]; diff --git a/src/routes/docs/products/databases/+page.markdoc b/src/routes/docs/products/databases/+page.markdoc index 9a81116efd..f64d3f0042 100644 --- a/src/routes/docs/products/databases/+page.markdoc +++ b/src/routes/docs/products/databases/+page.markdoc @@ -1,6 +1,6 @@ --- layout: article -title: Databases +title: Overview description: This is the description used for SEO. --- @@ -14,4 +14,4 @@ Databases store data, if you need to store files like images, PDFs or videos, us You can organize data into databases, collections, and documents. You can also paginate, order, and query documents. For complex business logic, Appwrite supports relationships to help you model your data. -[Quick start {% icon icon="cheveron-right" /%}](#) \ No newline at end of file +[Quick start {% icon icon="cheveron-right" /%}](/docs/products/databases/quick-start) \ No newline at end of file diff --git a/src/routes/docs/products/databases/collections/+page.markdoc b/src/routes/docs/products/databases/collections/+page.markdoc index f05f1b376c..3b83491bad 100644 --- a/src/routes/docs/products/databases/collections/+page.markdoc +++ b/src/routes/docs/products/databases/collections/+page.markdoc @@ -11,15 +11,15 @@ The terms collections and documents are used because the Appwrite JSON REST API That said, Appwrite is designed to support both SQL and NoSQL database adapters like MariaDB, MySQL, or MongoDB in future versions. ## Create collection -You can create collections using the Appwrite Console or a [Server SDK](#). +You can create collections using the Appwrite Console or a [Server SDK](/docs/sdks#server). {% tabs %} {% tabsitem #console title="Console" %} -You can create a collection by heading to the **Databases** page, navigate to a [database](#), and click **Create collection**. +You can create a collection by heading to the **Databases** page, navigate to a [database](/docs/products/databases/databases), and click **Create collection**. {% /tabsitem %} {% tabsitem #server-sdk title="Server SDK" %} -You can also create collections programmatically using a [Server SDK](#). Appwrite [Server SDKs](#) require an [API key](#). +You can also create collections programmatically using a [Server SDK](/docs/sdks#server). Appwrite [Server SDKs](/docs/sdks#server) require an [API key](/docs/advanced/platform/api-keys). {% multicode %} @@ -223,7 +223,7 @@ let collection = try await databases.createCollection( ``` {% /multicode %} -You can also configure **permissions** in the `createCollection` method, learn more about the `createCollection` in the [API references](#). +You can also configure **permissions** in the `createCollection` method, learn more about the `createCollection` in the [API references](/docs/references). {% /tabsitem %} {% /tabs %} @@ -254,7 +254,7 @@ You can choose between the following types. | `ip` | IP address attribute for IPv4 and IPv6. | | `email` | Email address attribute. | | `url` | URL attribute. | -| `relationship` | Relationship attribute relates one collection to another. [Learn more about relationships.](#) | +| `relationship` | Relationship attribute relates one collection to another. [Learn more about relationships.](/docs/products/databases) | If an attribute must be populated in all documents, set it as `required`. If not, you may optionally set a default value. @@ -272,6 +272,6 @@ The following indexes are currently supported: |------------|--------------------------------------------------------------------------------------------------------------| | `key` | Plain Index to allow queries. | | `unique` | Unique Index to disallow duplicates. | -| `fulltext` | For searching within string attributes. Required for the [search query method](#). | +| `fulltext` | For searching within string attributes. Required for the [search query method](/docs/products/databases/queries#query-class). | -You can create an index by navigating to your collection's **Indexes** tab or by using your favorite [Server SDK](#). +You can create an index by navigating to your collection's **Indexes** tab or by using your favorite [Server SDK](/docs/sdks#server). diff --git a/src/routes/docs/products/databases/databases/+page.markdoc b/src/routes/docs/products/databases/databases/+page.markdoc index ac8b6aee3d..2b1773c16f 100644 --- a/src/routes/docs/products/databases/databases/+page.markdoc +++ b/src/routes/docs/products/databases/databases/+page.markdoc @@ -16,7 +16,7 @@ You can create a database by navigating to the **Databases** page and clicking * ## Create a database using Server SDKs -You can programmatically create databases using a [Server SDK](#). Appwrite [Server SDKs](#) require an [API key](#). +You can programmatically create databases using a [Server SDK](/docs/sdks#server). Appwrite [Server SDKs](/docs/sdks#server) require an [API key](/docs/advanced/platform/api-keys). {% multicode %} ```js diff --git a/src/routes/docs/products/databases/documents/+page.markdoc b/src/routes/docs/products/databases/documents/+page.markdoc index 5c738ca2c9..e4894eefa5 100644 --- a/src/routes/docs/products/databases/documents/+page.markdoc +++ b/src/routes/docs/products/databases/documents/+page.markdoc @@ -135,7 +135,7 @@ You must grant **read** permissions to users at the **collection level** before [Learn more about permissions](#permissions) {% /info %} -Documents can be retrieved using the [List Document](#) endpoint. +Documents can be retrieved using the [List Document](/docs/references/cloud/client-web/databases#listDocuments) endpoint. Results can be filtered, sorted, and paginated using Appwrite's shared set of query methods. You can find a full guide on querying in the [Queries Guide](/docs/products/databases/queries). diff --git a/src/routes/docs/products/databases/order/+page.markdoc b/src/routes/docs/products/databases/order/+page.markdoc index 88ab2ad32e..0fdb5020d9 100644 --- a/src/routes/docs/products/databases/order/+page.markdoc +++ b/src/routes/docs/products/databases/order/+page.markdoc @@ -7,11 +7,11 @@ readtime: 5 --- You can order results returned by Appwrite Databases by using an order query. -For best performance, create an [index](#) on the column you plan to order by. +For best performance, create an [index](/docs/products/databases/collections#indexes) on the column you plan to order by. ## Ordering one column {% #one-column %} -When querying using the [listDocuments](#) endpoint, +When querying using the [listDocuments](/docs/references/cloud/client-web/databases#listDocuments) endpoint, you can specify the order of the documents returned using the `Query.orderAsc()` and `Query.orderDesc()` query methods. {% multicode %} diff --git a/src/routes/docs/products/databases/permissions/+page.markdoc b/src/routes/docs/products/databases/permissions/+page.markdoc index 8c783f695c..17dea9f76f 100644 --- a/src/routes/docs/products/databases/permissions/+page.markdoc +++ b/src/routes/docs/products/databases/permissions/+page.markdoc @@ -19,7 +19,7 @@ If a user has read, create, update, or delete permissions at the collection leve Configure collection level permissions by navigating to **Your collection** > **Settings** > **Permissions**. -[Learn more about permissions and roles](#) +[Learn more about permissions and roles](/docs/advanced/platform/permissions) ## Document level {% #document-level %} Document level permissions grant access to individual documents. @@ -28,8 +28,8 @@ If a user has read, create, update, or delete permissions at the document level, Document level permissions are only applied if Document Security is enabled in the settings of your collection. Enable document level permissions by navigating to **Your collection** > **Settings** > **Document security**. -Document level permissions are configured in individual [documents](#). +Document level permissions are configured in individual documents. -[Learn more about permissions and roles](#) +[Learn more about permissions and roles](/docs/advanced/platform/permissions) diff --git a/src/routes/docs/products/databases/queries/+page.markdoc b/src/routes/docs/products/databases/queries/+page.markdoc index 7b569ef873..24b5c79eb2 100644 --- a/src/routes/docs/products/databases/queries/+page.markdoc +++ b/src/routes/docs/products/databases/queries/+page.markdoc @@ -26,13 +26,13 @@ Appwrite SDKs provide a `Query` class to help you build queries. The `Query` cla | `Query.isNotNull("name")` | Returns documents where attribute value is **not** null. | | `Query.startsWith("name", "Once upon a time")` | Returns documents if a string attributes starts with a substring. | | `Query.endsWith("name", "happily ever after.")` | Returns documents if a string attributes ends with a substring. | -| `Query.search("text", "key words")` | Searches string attributes for provided keywords. Requires a [Full-text index](#) on queried attributes. | +| `Query.search("text", "key words")` | Searches string attributes for provided keywords. Requires a [full-text index](/docs/products/databases/collections#indexes) on queried attributes. | | `Query.orderDesc("attribute")` | Orders results in descending order by attribute. Attribute must be indexed. Pass in an empty string to return in natural order. | | `Query.orderAsc("attribute")` | Orders results in ascending order by attribute. Attribute must be indexed. Pass in an empty string to return in natural order. | -| `Query.limit(25)` | Limits the number of results returned by the query. Used for [pagination](#). If the limit query is not used, the limit defaults to 25 results. | -| `Query.offset(0)` | Offset the results returned by skipping some of the results. Used for [pagination](#). | -| `Query.cursorAfter("62a7...f620")` | Places the cursor after the specified resource ID. Used for [pagination](#). | -| `Query.cursorBefore("62a7...a600")` | Places the cursor before the specified resource ID. Used for [pagination](#). | +| `Query.limit(25)` | Limits the number of results returned by the query. Used for [pagination](/docs/products/databases/pagination). If the limit query is not used, the limit defaults to 25 results. | +| `Query.offset(0)` | Offset the results returned by skipping some of the results. Used for [pagination](/docs/products/databases/pagination). | +| `Query.cursorAfter("62a7...f620")` | Places the cursor after the specified resource ID. Used for [pagination](/docs/products/databases/pagination). | +| `Query.cursorBefore("62a7...a600")` | Places the cursor before the specified resource ID. Used for [pagination](/docs/products/databases/pagination). | ## Building Queries {% #building-queries %} diff --git a/src/routes/docs/products/databases/relationships/+page.markdoc b/src/routes/docs/products/databases/relationships/+page.markdoc index 32672c19eb..aeb3159069 100644 --- a/src/routes/docs/products/databases/relationships/+page.markdoc +++ b/src/routes/docs/products/databases/relationships/+page.markdoc @@ -63,7 +63,7 @@ Appwrite also allows you to define the behavior of a relationship when a documen | Set null | If a document has related documents, when it is deleted, the related documents are kept with their relationship attribute set to null.| ## Creating relationships {% #create-relationships %} -You can define relationships in the Appwrite Console, or using a [Server SDK](#) +You can define relationships in the Appwrite Console, or using a [Server SDK](/docs/sdks#server) {% tabs %} {% tabsitem #console title="Console" %} @@ -616,7 +616,6 @@ databases.updateDocument( {% /multicode %} ## Delete relationships {% #delete %} -[TODO WHY ARE H2 and H3 same sizee] ### Unlink relationships, retain documents {% #unlink %} If you need to unlink documents in a relationship but retain the documents, you can do this by **updating the relationship attribute** and removing the ID of the related document. diff --git a/src/routes/docs/products/functions/+layout.svelte b/src/routes/docs/products/functions/+layout.svelte index 7718528faa..b960ec0941 100644 --- a/src/routes/docs/products/functions/+layout.svelte +++ b/src/routes/docs/products/functions/+layout.svelte @@ -22,7 +22,7 @@ ] }, { - label: 'Guides', + label: 'Journeys', items: [ { label: 'Development', @@ -45,7 +45,16 @@ href: '/docs/products/functions/examples' } ] - } + }, + { + label: 'References', + items: [ + { + label: 'Functions API', + href: '/docs/references/cloud/client-web/functions' + }, + ] + }, ]; diff --git a/src/routes/docs/products/functions/+page.markdoc b/src/routes/docs/products/functions/+page.markdoc index 9d1b73762d..b5bd4d3cc0 100644 --- a/src/routes/docs/products/functions/+page.markdoc +++ b/src/routes/docs/products/functions/+page.markdoc @@ -1,6 +1,6 @@ --- layout: article -title: Functions +title: Overview description: [TODO] difficulty: beginner readtime: 3 @@ -16,6 +16,6 @@ Each function will have its own URL, execute in its own isolated container, and Appwrite Functions let you build anything you can imagine, but this flexibility makes it difficult to know where to start. Start exploring by cloning one of the quick start templates or using a template with pre-built integration to quickly implement features. -[Quick start {% icon icon="cheveron-right" /%}](/docs/products/function/quick-start) +[Quick start {% icon icon="cheveron-right" /%}](/docs/products/functions/quick-start) ![](https://appwrite.io/images-ee/docs/functions-starter-dark.png) \ No newline at end of file diff --git a/src/routes/docs/products/functions/deployment/+page.markdoc b/src/routes/docs/products/functions/deployment/+page.markdoc index 801aad05ac..1c45da16a3 100644 --- a/src/routes/docs/products/functions/deployment/+page.markdoc +++ b/src/routes/docs/products/functions/deployment/+page.markdoc @@ -40,8 +40,9 @@ Before deploying your function with Git, create a new function attached to your ## CLI {% #cli %} -> ### CLI Setup {% #cli-setup %} -> Before you can deploy with the Appwrite CLI, make sure you've [installed and initialized](#) the CLI. +{% info title="CLI setup" %} +Before you can deploy with the Appwrite CLI, make sure you've [installed and initialized](/docs/tooling/command-line/installation) the CLI. +{% /info %} To deploy with the Appwrite CLI, your function must be added to `appwrite.json`. Use the `appwrite init function` method to create a starter function, then paste in your function code. diff --git a/src/routes/docs/products/functions/development/+page.markdoc b/src/routes/docs/products/functions/development/+page.markdoc index d1d586b272..9d7aa62a62 100644 --- a/src/routes/docs/products/functions/development/+page.markdoc +++ b/src/routes/docs/products/functions/development/+page.markdoc @@ -419,10 +419,10 @@ You'll find these properties in the context object. | Property | Description | |----------|--------------------------------------------------------------------------------------------------------------------------| -| req | Contains request information like method, body, and headers. See full examples [here](#). | -| res | Contains methods to build a response and return information. See full examples [here](#). | -| log() | Method to log information to the Appwrite Console, end users will not be able to see these logs. See full examples [here](#). | -| error() | Methoc to log errors to the Appwrite Console, end users will not be able to see these errors. See full examples [here](#). | +| req | Contains request information like method, body, and headers. See full examples [in the request section](#request). | +| res | Contains methods to build a response and return information. See full examples [in the response section](#response). | +| log() | Method to log information to the Appwrite Console, end users will not be able to see these logs. See full examples [in the logging section](#logging). | +| error() | Methoc to log errors to the Appwrite Console, end users will not be able to see these errors. See full examples [in the logging section](#logging). | #### Destructuring assignment {% #destructuring %} Some languages, namely JavaScript, support destructuring. @@ -683,7 +683,7 @@ These are provided alongside any custom headers sent to the function. | `x-appwrite-trigger` | Describes how the function execution was invoked. Possible values are `http`, `schedule` or `event`. | | `x-appwrite-event` | If the function execution was triggered by an event, describes the triggering event. | | `x-appwrite-user-id` | If the function execution was invoked by an authenticated user, display the user ID. This doesn't apply to Appwrite Console users or API keys. | -| `x-appwrite-user-jwt` | JWT token generated from the invoking user's session. Used to authenticate Server SDKs to respect access permissions. [Learn more about JWT tokens](#). | +| `x-appwrite-user-jwt` | JWT token generated from the invoking user's session. Used to authenticate Server SDKs to respect access permissions. [Learn more about JWT tokens](/docs/products/auth/jwt). | | `x-appwrite-country-code` | Displays the country code of the configured locale. | | `x-appwrite-continent-code` | Displays the continent code of the configured locale. | | `x-appwrite-continent-eu` | Describes if the configured local is within the EU. | @@ -928,7 +928,7 @@ namespace runtime { ``` {% /multicode %} -To get the different response types, set one of the following query parameters in the [generated domain](#) of your function. +To get the different response types, set one of the following query parameters in the [generated domain](/docs/products/functions/deployment#domains) of your function. | Type | Query Param | Example | |----------|-----------------|-------------------------------------------------------------| @@ -1088,12 +1088,13 @@ You can access these logs through the following steps. 3. Under the Executions tab, click on an execution. 4. In the Response section, you'll be able to view logs under the Logs and Errors tabs. -## Accessing Environment Variables {% #environment-variables %} +## Accessing environment variables {% #environment-variables %} If you need to pass constants or secrets to Appwrite Functions, you can use environment variables. Environmental variables can be global, or function-specific. -> ### Appwrite API keys -> If your function is using an Appwrite SDK with an API key, this API key needs to be generated and passed in manually. API keys are not passed by default for security reasons. +{% info title="Appwrite API keys" %} +If your function is using an Appwrite SDK with an API key, this API key needs to be generated and passed in manually. API keys are not passed by default for security reasons. +{% /info %} | Variable | Description | |-----------------------------------|------------------------------------------------| @@ -1218,28 +1219,89 @@ namespace runtime { ## Dependencies {% #dependencies %} Your function's dependencies should be managed by the package manager of each language. By default, we include the following package managers in each runtime. -| Language | Package Manager | Commands | | -|----------|-----------------|-----------------------|------------------------------------| -| [TODO] | Node.js | npm | npm install | -| [TODO] | PHP | Composer | composer install | -| [TODO] | Python | pip | pip install -r requirements.txt | -| [TODO] | Ruby | Bundler | bundle install | -| [TODO] | Deno | deno | deno cache | -| [TODO] | Dart | pub | pub get | -| [TODO] | Swift | Swift Package Manager | swift package resolve | -| [TODO] | .NET | NuGet | dotnet restore | -| [TODO] | Kotlin | Gradle | N/A | -| [TODO] | Java | Gradle | N/A | -| [TODO] | C++ | None | N/A | + +{% table %} +*   {% width=80 %} +* Language +* Package Manager +* Commands +--- +* {% only_dark %}{% icon_image src="/images/platforms/dark/nodejs.svg" alt="Node.js logo" size="m" /%}{% /only_dark %} +{% only_light %}{% icon_image src="/images/platforms/nodejs.svg" alt="Node.js logo" size="m" /%}{% /only_light %} +* Node.js +* NPM +* `npm install` +--- +* {% only_dark %}{% icon_image src="/images/platforms/dark/php.svg" alt="PHP logo" size="m" /%}{% /only_dark %} +{% only_light %}{% icon_image src="/images/platforms/php.svg" alt="PHP logo" size="m" /%}{% /only_light %} +* PHP +* Composer +* `composer install` +--- +* {% only_dark %}{% icon_image src="/images/platforms/dark/python.svg" alt="Python logo" size="m" /%}{% /only_dark %} +{% only_light %}{% icon_image src="/images/platforms/python.svg" alt="Python logo" size="m" /%}{% /only_light %} +* Python +* pip +* `pip install -r requirements.txt` +--- +* {% only_dark %}{% icon_image src="/images/platforms/dark/ruby.svg" alt="Ruby logo" size="m" /%}{% /only_dark %} +{% only_light %}{% icon_image src="/images/platforms/ruby.svg" alt="Ruby logo" size="m" /%}{% /only_light %} +* Ruby +* Bundler +* bundle install +--- +* {% only_dark %}{% icon_image src="/images/platforms/dark/deno.svg" alt="Deno logo" size="m" /%}{% /only_dark %} +{% only_light %}{% icon_image src="/images/platforms/deno.svg" alt="Deno logo" size="m" /%}{% /only_light %} +* Deno +* deno +* `deno cache ` +--- +* {% only_dark %}{% icon_image src="/images/platforms/dark/dart.svg" alt="Dart logo" size="m" /%}{% /only_dark %} +{% only_light %}{% icon_image src="/images/platforms/dart.svg" alt="Dart logo" size="m" /%}{% /only_light %} +* Dart +* pub +* `pub get` +--- +* {% only_dark %}{% icon_image src="/images/platforms/dark/swift.svg" alt="Swift logo" size="m" /%}{% /only_dark %} +{% only_light %}{% icon_image src="/images/platforms/swift.svg" alt="Swift logo" size="m" /%}{% /only_light %} +* Swift +* Swift Package Manager +* `swift package resolve` +--- +* {% only_dark %}{% icon_image src="/images/platforms/dark/dotnet.svg" alt=".NET logo" size="m" /%}{% /only_dark %} +{% only_light %}{% icon_image src="/images/platforms/dotnet.svg" alt=".NET logo" size="m" /%}{% /only_light %} +* .NET +* NuGet +* `dotnet restore` +--- +* {% only_dark %}{% icon_image src="/images/platforms/dark/kotlin.svg" alt="Kotlin logo" size="m" /%}{% /only_dark %} +{% only_light %}{% icon_image src="/images/platforms/kotlin.svg" alt="Kotlin logo" size="m" /%}{% /only_light %} +* Kotlin +* Gradle +* N/A +--- +* {% only_dark %}{% icon_image src="/images/platforms/dark/java.svg" alt="Java logo" size="m" /%}{% /only_dark %} +{% only_light %}{% icon_image src="/images/platforms/java.svg" alt="Java logo" size="m" /%}{% /only_light %} +* Java +* Gradle +* N/A +--- +* {% only_dark %}{% icon_image src="/images/platforms/dark/c.svg" alt="C++ logo" size="m" /%}{% /only_dark %} +{% only_light %}{% icon_image src="/images/platforms/c.svg" alt="C++ logo" size="m" /%}{% /only_light %} +* C++ +* None +* N/A +{% /table %} + To install your dependencies before your function is built, you should add the relevant install command to the top your function's **Build setting** > **Commands**. ## Using Appwrite in a function {% #using-appwrite %} Appwrite can be used in your functions by adding the relevant SDK to your function's dependencies. Authenticating with Appwrite is done via an API key or a JWT token. -API keys must be generated and exported as an [environment variable](#). +API keys must be generated and exported as an [environment variable](/docs/advanced/self-hosting/environment-variables). -You can read more about authentication in the [Server authentication](#) section of the docs. +You can read more about authentication in the [JWT login](/docs/products/auth/jwt) section of the docs. ### Using with API key {% #using-api-key %} API keys have defined scopes when you create them. @@ -2124,10 +2186,10 @@ You will have to migrate your old functions to follow new runtime syntax. Here's a checklist of things you need to know. -1. The parameter passed into functions has changed. `req` and `res` has been replaced by `context`, which contains new logger methods. [Learn about context](#). -2. To improve privacy and logging reliability, we provide new `context.log()` and `context.error()` functions. You can no longer use native logging methods. [Learn about logging](#). -3. The old way of `req.variables` has been deprecated. You can now access variables passed into each function as environment variables. [Learn about environment variables](#). -4. The `req` object has been updated to use terminology consistent with typical HTTP concepts. You'll now find familiar concepts like headers, body, HTTP methods, and others. [Learn about request](#). -5. The response object has been updated. You can now specify headers, as well as use new methods like return redirects or empty responses. [Learn about response](#). -6. Now, you must return a response such as return `context.res.send("")`. This prevents confusing errors when functions are terminated prematurely before a response is sent. [Learn about response](#). +1. The parameter passed into functions has changed. `req` and `res` has been replaced by `context`, which contains new logger methods. [Learn about context](/docs/products/functions/development#context-object). +2. To improve privacy and logging reliability, we provide new `context.log()` and `context.error()` functions. You can no longer use native logging methods. [Learn about logging](/docs/products/functions/development#logging). +3. The old way of `req.variables` has been deprecated. You can now access variables passed into each function as environment variables. [Learn about environment variables](/docs/products/functions/development#environment-variables). +4. The `req` object has been updated to use terminology consistent with typical HTTP concepts. You'll now find familiar concepts like headers, body, HTTP methods, and others. [Learn about request](/docs/products/functions/development#request). +5. The response object has been updated. You can now specify headers, as well as use new methods like return redirects or empty responses. [Learn about response](/docs/products/functions/development#response). +6. Now, you must return a response such as return `context.res.send("")`. This prevents confusing errors when functions are terminated prematurely before a response is sent. [Learn about response](/docs/products/functions/development#response). 7. Some variables about how a function was triggered are now found in the context.req object as headers. \ No newline at end of file diff --git a/src/routes/docs/products/functions/runtimes/+page.markdoc b/src/routes/docs/products/functions/runtimes/+page.markdoc index 3d31d10062..5b4444cf53 100644 --- a/src/routes/docs/products/functions/runtimes/+page.markdoc +++ b/src/routes/docs/products/functions/runtimes/+page.markdoc @@ -10,7 +10,7 @@ Appwrite Functions supports an extensive list of runtimes to meet your unique te Below is a list of available Functions runtimes. The Appwrite team continually adds support for new runtimes. {% table %} -*   {% width=80 %} +*   {% width=48 %} * Name {% width=120 %} * Versions * Architectures diff --git a/src/routes/docs/products/storage/+layout.svelte b/src/routes/docs/products/storage/+layout.svelte index bdbe83487a..5a21fcbc44 100644 --- a/src/routes/docs/products/storage/+layout.svelte +++ b/src/routes/docs/products/storage/+layout.svelte @@ -35,7 +35,7 @@ ] }, { - label: 'Guides', + label: 'Journeys', items: [ { label: 'Upload and download', @@ -46,7 +46,16 @@ href: '/docs/products/storage/images' }, ] - } + }, + { + label: 'References', + items: [ + { + label: 'Storage API', + href: '/docs/references/cloud/client-web/storage' + }, + ] + }, ]; diff --git a/src/routes/docs/products/storage/+page.markdoc b/src/routes/docs/products/storage/+page.markdoc index 2458da1dfa..1a8105808e 100644 --- a/src/routes/docs/products/storage/+page.markdoc +++ b/src/routes/docs/products/storage/+page.markdoc @@ -1,6 +1,6 @@ --- layout: article -title: Storage +title: Overview description: This is the description used for SEO. difficulty: beginner readtime: 5 diff --git a/src/routes/docs/products/storage/buckets/+page.markdoc b/src/routes/docs/products/storage/buckets/+page.markdoc index 75ae1a8dd7..0d8714aacd 100644 --- a/src/routes/docs/products/storage/buckets/+page.markdoc +++ b/src/routes/docs/products/storage/buckets/+page.markdoc @@ -10,7 +10,7 @@ Storage buckets are a group of files, similar to collections in Appwrite Databas Buckets let you limit file size and extensions, whether or not to encrypt the files, and more. ## Create Bucket -You can create your bucket from the Appwrite Console or a [Server SDK](#). +You can create your bucket from the Appwrite Console or a [Server SDK](/docs/sdks#server). {% tabs %} {% tabsitem #console title="Console" %} @@ -19,7 +19,7 @@ You can create a bucket by heading to the **Storage** page and clicking **Create {% /tabsitem %} {% tabsitem #server-sdk title="Server SDK" %} -You can also create collections programmatically using a [Server SDK](#). Appwrite [Server SDKs](#) require an [API key](#). +You can also create collections programmatically using a [Server SDK](/docs/sdks#server). Appwrite [Server SDKs](/docs/sdks#server) require an [API key](/docs/advanced/platform/api-keys). {% multicode %} @@ -219,7 +219,7 @@ let bucket = try await storage.createBucket( ``` {% /multicode %} -You can also configure permission, file size and extension restrictions, and more in the `createBucket` method, learn more about the `createBucket` in the [API references](#). +You can also configure permission, file size and extension restrictions, and more in the `createBucket` method, learn more about the `createBucket` in the [API references](/docs/references/cloud/server-nodejs/storage#createBucket). {% /tabsitem %} {% /tabs %} diff --git a/src/routes/docs/products/storage/images/+page.markdoc b/src/routes/docs/products/storage/images/+page.markdoc index bee82f9d95..27d02f76ed 100644 --- a/src/routes/docs/products/storage/images/+page.markdoc +++ b/src/routes/docs/products/storage/images/+page.markdoc @@ -10,7 +10,7 @@ Appwrite provides utilities to manipulate images for previewing images in your a ## Image manipulation {% #image-manupulation %} -Appwrite Storage's [preview endpoint](#) let you manipulate resolution, add borders and the border-radius, add background-color, set the opacity for the image, and get the image in the appropriate output format. +Appwrite Storage's [preview endpoint](/docs/references/cloud/client-web/storage#getFilePreview) let you manipulate resolution, add borders and the border-radius, add background-color, set the opacity for the image, and get the image in the appropriate output format. You can manipulate images resolution to display appropriately on responsive websites. You can also adjust the image border, background color, and border-radius to match the theming of your application. The Appwrite Storage also allows you to change the format and compression of your images for network transfer optimization and to help you speed your application. You can do all that without caring about how the image was originally uploaded. @@ -37,7 +37,7 @@ Below you can find all the different parameters offered by the preview endpoint | output | Set the output image format. If not provided, will use the original image's format. Supported formats are: `jpg`, `jpeg`, `png`, `gif`, and `webp` | ## Examples {% #examples %} -Here are some examples using [Client SDKs](#). +Here are some examples using [Client SDKs](/docs/sdks#client). {% multicode %} ```js import { Client, Storage } from "appwrite"; diff --git a/src/routes/docs/products/storage/permissions/+page.markdoc b/src/routes/docs/products/storage/permissions/+page.markdoc index dc4c974712..c2b0e3c9b8 100644 --- a/src/routes/docs/products/storage/permissions/+page.markdoc +++ b/src/routes/docs/products/storage/permissions/+page.markdoc @@ -19,7 +19,7 @@ If a user has read, create, update, or delete permissions at the bucket level, t Configure bucket level permissions by navigating to **Your bucket** > **Settings** > **Permissions**. -[Learn more about permissions and roles](#) +[Learn more about permissions and roles](/docs/advanced/platform/permissions) ## File level {% #file-level %} File level permissions grant access to individual files. @@ -28,8 +28,8 @@ If a user has read, create, update, or delete permissions at the file level, the File level permissions are only applied if File Security is enabled in the settings of your bucket. Enable file level permissions by navigating to **Your bucket** > **Settings** > **File security**. -File level permissions are configured in individual [files](#). +File level permissions are configured in individual [files](/docs/products/storage/permissions#file-level). -[Learn more about permissions and roles](#) +[Learn more about permissions and roles](/docs/advanced/platform/permissions) diff --git a/src/routes/docs/products/storage/upload-download/+page.markdoc b/src/routes/docs/products/storage/upload-download/+page.markdoc index a1d334b5ea..2672b10416 100644 --- a/src/routes/docs/products/storage/upload-download/+page.markdoc +++ b/src/routes/docs/products/storage/upload-download/+page.markdoc @@ -127,7 +127,7 @@ To do so, navigate to the **Documents** tab of your collection and click the **A ## Large files {% #large-files %} When you are trying to upload any files above 5MB, you will need to upload them in chunks for better reliability and performance. If you're using an Appwrite SDK, this is handled automatically. -If you're not using an SDK, you can [learn more about REST API file handling](#). +If you're not using an SDK, you can [learn more about REST API file handling](/docs/apis/rest#files). ## InputFile {% #input-file %} Every language and platform handles file inputs differently. This section documents the expected input type of each SDK. Where applicable, Appwrite provides an `InputFile` class to accept multiple file sources, like paths, buffers, streams, or plain text. @@ -491,9 +491,8 @@ class MainActivity : AppCompatActivity() { ``` {% /multicode %} -## View file {% #view-file%} - -To view a file, use the `getFileView` method. +## Get File {% #get-file %} +To get a file, use the `getFile` method. {% multicode %} ```js @@ -508,9 +507,13 @@ client .setProject('5df5acd0d48c2') // Your project ID ; -const result = storage.getFileView('[BUCKET_ID]', '[FILE_ID]'); +const promise = storage.getFile('[BUCKET_ID]', '[FILE_ID]'); -console.log(result); // Resource URL +promise.then(function (response) { + console.log(response); // Success +}, function (error) { + console.log(error); // Failure +}); ``` ```dart import 'package:appwrite/appwrite.dart'; @@ -524,7 +527,7 @@ void main() { // Init SDK .setProject('5df5acd0d48c2') // Your project ID ; // downloading file - Future result = storage.getFileView( + Future result = storage.getFile( bucketId: '[BUCKET_ID]', fileId: '[FILE_ID]', ).then((bytes) { @@ -537,7 +540,7 @@ void main() { // Init SDK //displaying image preview FutureBuilder( - future: storage.getFileView( + future: storage.getFile( bucketId: '[BUCKET_ID]', fileId: '[FILE_ID]', ), //works for both public file and private file, for private files you need to be logged in @@ -558,7 +561,7 @@ func main() async throws { .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID let storage = Storage(client) - let byteBuffer = try await storage.getFileView( + let byteBuffer = try await storage.getFile( bucketId: "[BUCKET_ID]", fileId: "[FILE_ID]" ) @@ -586,7 +589,7 @@ class MainActivity : AppCompatActivity() { val storage = Storage(client) GlobalScope.launch { - val result = storage.getFileView( + val result = storage.getFile( bucketId = "[BUCKET_ID]", fileId = "[FILE_ID]" ) @@ -597,9 +600,8 @@ class MainActivity : AppCompatActivity() { ``` {% /multicode %} -## Get file preview {% #get-file-preview %} +## Get File Preview {% #get-file-preview %} To get a file preview image , use the `getFilePreview` method. -You can learn more about the **image manupulation options** in [this guide](/docs/products/storage/images). {% multicode %} ```js @@ -701,4 +703,110 @@ class MainActivity : AppCompatActivity() { } } ``` +{% /multicode %} + +## View File {% #view-file%} + +To view a file, use the `getFileView` method. + +{% multicode %} +```js +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('5df5acd0d48c2') // Your project ID +; + +const result = storage.getFileView('[BUCKET_ID]', '[FILE_ID]'); + +console.log(result); // Resource URL +``` +```dart +import 'package:appwrite/appwrite.dart'; + +void main() { // Init SDK + Client client = Client(); + Storage storage = Storage(client); + + client + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + ; + // downloading file + Future result = storage.getFileView( + bucketId: '[BUCKET_ID]', + fileId: '[FILE_ID]', + ).then((bytes) { + final file = File('path_to_file/filename.ext'); + file.writeAsBytesSync(bytes) + }).catchError((error) { + print(error.response); + }) +} + +//displaying image preview +FutureBuilder( + future: storage.getFileView( + bucketId: '[BUCKET_ID]', + fileId: '[FILE_ID]', + ), //works for both public file and private file, for private files you need to be logged in + builder: (context, snapshot) { + return snapshot.hasData && snapshot.data != null + ? Image.memory( + snapshot.data, + ) + : CircularProgressIndicator(); + }, +); +``` +```swift +import Appwrite + +func main() async throws { + let client = Client() + .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + let storage = Storage(client) + let byteBuffer = try await storage.getFileView( + bucketId: "[BUCKET_ID]", + fileId: "[FILE_ID]" + ) + + print(String(describing: byteBuffer) +} +``` +```kotlin +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import io.appwrite.Client +import io.appwrite.services.Storage + +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) + + val client = Client(applicationContext) + .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + + val storage = Storage(client) + + GlobalScope.launch { + val result = storage.getFileView( + bucketId = "[BUCKET_ID]", + fileId = "[FILE_ID]" + ) + println(result); // Resource URL + } + } +} +``` {% /multicode %} \ No newline at end of file diff --git a/src/routes/docs/quick-starts/+layout.svelte b/src/routes/docs/quick-starts/+layout.svelte index 435d61794c..67b37fbb9a 100644 --- a/src/routes/docs/quick-starts/+layout.svelte +++ b/src/routes/docs/quick-starts/+layout.svelte @@ -1,9 +1,10 @@ - + diff --git a/src/routes/docs/quick-starts/+page.svelte b/src/routes/docs/quick-starts/+page.svelte index 6ba718cf67..eb46da9785 100644 --- a/src/routes/docs/quick-starts/+page.svelte +++ b/src/routes/docs/quick-starts/+page.svelte @@ -1,23 +1,134 @@ - -
    - {#each qs as q} -
  • - {q} -
  • - {/each} -
+
+
+
+
+
+

Quick start

+
+
+
+
+
+ {#each quickStarts as category} +
+

{category.title}

+ +
+ {/each} +
+
+ + +
+ + diff --git a/src/routes/docs/quick-starts/android/+page.markdoc b/src/routes/docs/quick-starts/android/+page.markdoc index 23f1bdd2ad..462fc9a7ff 100644 --- a/src/routes/docs/quick-starts/android/+page.markdoc +++ b/src/routes/docs/quick-starts/android/+page.markdoc @@ -1,56 +1,242 @@ --- layout: article -title: Quick start with Android +title: Start with Android description: Learn how to quickly integrate Appwrite products and services into your Android project. difficulty: beginner readtime: 3 --- -Learn to setup your first Apple project powered by Appwrite. -{% section #step-1 step=1 title="Create project" %} +Learn to setup your first Android project powered by Appwrite. + +{% section #step-1 step=1 title="Create Android project" %} +Open Android Studio and click **New Project** to create a new project. + +Choose your desired project template and click **Next**. + +Now enter your app **name** and **package name**. You will need both of these later when you create your project in the Appwrite console. Click **Finish** to create your project. + +{% /section %} + +{% section #step-2 step=2 title="Create Appwrite project" %} Head to the [Appwrite Console](https://cloud.appwrite.io/console). ![Create project screen](/images/docs/databases/quick-start/create-project.png) If this is your first time using Appwrite, create an accout and create your first project. -Then, under **Add a platform**, add a **Android app** with the **Name** `My Application` and **Package name** `com.example.myapplication`. +Then, under **Add a platform**, add an **Android app**. + +Add your app's **name** and **package name**, your package name is the one entered when creating an Android project. For existing projects, you should use the **applicationId** in your app-level [build.gradle](https://github.com/appwrite/playground-for-android/blob/master/app/build.gradle#L11) file. ![Add a platform](/images/docs/databases/quick-start/add-platform.png) You can skip optional steps. -{% /section %} -{% section #step-2 step=2 title="Create Android project" %} -Open Android Studios and click **New Project**, select **Empty Activity**. -**Name** the project `My Application` with **Package Name** `com.example.myapplication`. {% /section %} -{% section #step-3 step=3 title="Install Appwrite" %} -Install the Appwrite SDK for Android. +{% section #step-3 step=3 title="Add the Appwrite SDK" %} +To add the Appwrite SDK for Android as a dependency, add the following to your app-level **build.gradle.kts** file inside the **dependencies** block. +```kotlin +implementation("io.appwrite:sdk-for-android:4.0.0") +``` +In order to allow creating OAuth sessions, the following activity needs to be added inside the `` tag, along side the existing `` tags in your [AndroidManifest.xml](https://github.com/appwrite/playground-for-flutter/blob/master/android/app/src/main/AndroidManifest.xml). +Be sure to replace the **[PROJECT_ID]** string with your actual Appwrite project ID. +You can find your Appwrite project ID in you project settings screen in your Appwrite Console. + +```xml + + ... + + ... + + + + + + + + + + + +``` {% /section %} -{% section #step-4 step=4 title="Import Appwrite" %} +{% section #step-4 step=4 title="Create Appwrite Singleton" %} Find your project's ID in the **Settings** page. ![Settings page in Appwrite Console.](/images/docs/databases/quick-start/project-id.png) -Create a new file `src/lib/appwrite.js` and add the following code to it, replace `` with your project ID. - -```swift -TODO +Create a new file `Appwrite.kt` and add the following code to it, replacing `[YOUR_PROJECT_ID]` with your project ID. + +```kotlin +package com.example.myapplication + +import android.content.Context +import io.appwrite.Client +import io.appwrite.ID +import io.appwrite.models.* +import io.appwrite.services.* + +object Appwrite { + lateinit var client: Client + lateinit var account: Account + + fun init(context: Context) { + client = Client(context) + .setEndpoint("https://cloud.appwrite.io/v1") + .setProject("[YOUR_PROJECT_ID]") + + account = Account(client) + } + + suspend fun onLogin( + email: String, + password: String, + ): Session { + return account.createEmailSession( + email, + password, + ) + } + + suspend fun onRegister( + email: String, + password: String, + ): User> { + return account.create( + userId = ID.unique(), + email, + password, + ) + } + + suspend fun onLogout() { + account.deleteSession("current") + } +} ``` {% /section %} {% section #step-5 step=5 title="Create a login page" %} -Add the following code to `src/App.jsx`. - -```swift -TODO +Add the following code to `MainActivity.kt`. + +```kotlin +package com.example.myapplication + +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import androidx.compose.foundation.layout.* +import androidx.compose.foundation.text.* +import androidx.compose.material3.* +import androidx.compose.runtime.* +import androidx.compose.ui.* +import androidx.compose.ui.text.input.* +import androidx.compose.ui.unit.* +import com.example.myapplication.ui.theme.MyApplicationTheme +import kotlinx.coroutines.launch + +class MainActivity : ComponentActivity() { + @OptIn(ExperimentalMaterial3Api::class) + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + Appwrite.init(applicationContext) + + setContent { + MyApplicationTheme { + Surface( + modifier = Modifier.fillMaxSize(), + color = MaterialTheme.colorScheme.background + ) { + val coroutineScope = rememberCoroutineScope() + + var user by remember { mutableStateOf("") } + var email by remember { mutableStateOf("") } + var password by remember { mutableStateOf("") } + + if (user.isNotEmpty()) { + Column( + modifier = Modifier.fillMaxSize(), + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center + ) { + Text(text = "Logged in as $user") + Button(onClick = { + coroutineScope.launch { + Appwrite.onLogout() + } + }) { + Text("Logout") + } + } + } + + Column( + modifier = Modifier.fillMaxSize(), + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center + ) { + TextField( + value = email, + onValueChange = { email = it }, + label = { Text("Username") }, + modifier = Modifier + .fillMaxWidth() + .padding(16.dp) + ) + TextField( + value = password, + onValueChange = { password = it }, + label = { Text("Password") }, + modifier = Modifier + .fillMaxWidth() + .padding(16.dp), + visualTransformation = PasswordVisualTransformation(), + keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password) + ) + Row( + modifier = Modifier + .fillMaxWidth() + .padding(16.dp), + horizontalArrangement = Arrangement.SpaceBetween + ) { + Button(onClick = { + coroutineScope.launch { + try { + Appwrite.onLogin(email, password) + + user = email + } catch (e: Exception) { + e.printStackTrace() + } + } + }) { + Text("Login") + } + Button(onClick = { + coroutineScope.launch { + try { + Appwrite.onRegister(email, password) + } catch (e: Exception) { + e.printStackTrace() + } + } + }) { + Text("Register") + } + } + } + } + } + } + } +} ``` {% /section %} -{% section #step-6 step=6 title="Checkout what you've built" %} -Run your project with `npm run dev -- --open --port 3000` and open [http://localhost:3000](http://localhost:3000) in your browser. +{% section #step-6 step=6 title="All set" %} +Run your project by clicking **Run app** in Android Studio. {% /section %} \ No newline at end of file diff --git a/src/routes/docs/quick-starts/angular/+page.markdoc b/src/routes/docs/quick-starts/angular/+page.markdoc index df6370310f..dfabc2ac28 100644 --- a/src/routes/docs/quick-starts/angular/+page.markdoc +++ b/src/routes/docs/quick-starts/angular/+page.markdoc @@ -1,9 +1,16 @@ --- layout: article -title: Quick start with Angular +title: Start with Angular description: Learn how to quickly integrate Appwrite products and services into your Angular project. difficulty: beginner readtime: 3 --- -hello world \ No newline at end of file +Improve the docs, add this guide. + +We still don't have this guide in place, but we do have some great news. +The Appwrite docs, just like Appwrite, is completely open sourced. +This means, anyone can help improve them and add new guides and tutorials. + +If you see this page, **we're actively looking for contributions to this page**. +Follow our contribution guidelines, open a PR to [our Website repo](https://github.com/appwrite/website), and collaborate with our core team to improve this page. \ No newline at end of file diff --git a/src/routes/docs/quick-starts/apple/+page.markdoc b/src/routes/docs/quick-starts/apple/+page.markdoc index 059fec0d4f..a199a4ad02 100644 --- a/src/routes/docs/quick-starts/apple/+page.markdoc +++ b/src/routes/docs/quick-starts/apple/+page.markdoc @@ -1,61 +1,190 @@ --- layout: article title: Start with Apple -description: Learn how to quickly integrate Appwrite products and services into your iOS, iPadOS, macOS, watchOS, tvOS, or visionOS project. +description: Learn how to quickly integrate Appwrite products and services into your Apple project. difficulty: beginner readtime: 3 --- Learn to setup your first Apple project powered by Appwrite. -{% section #step-1 step=1 title="Create project" %} + +{% section #step-1 step=1 title="Create Apple project" %} +Open Xcode and click **Create a new Xcode project**. + +Choose your desired project template and click **Next**. + +Now enter your app **product name** and **bundle identifier** and click **Next**. You will need both of these values later when you create your project in the Appwrite console. + +Choose a directory for your project in and click **Create** to create your project. + +{% /section %} + +{% section #step-2 step=2 title="Create Appwrite project" %} Head to the [Appwrite Console](https://cloud.appwrite.io/console). ![Create project screen](/images/docs/databases/quick-start/create-project.png) If this is your first time using Appwrite, create an accout and create your first project. -Then, under **Add a platform**, add a **Apple app**. The **Bundle ID** can be `example.my-app`. +Then, under **Add a platform**, add an **Apple app**. Choose any of **iOS**, **macOS**, **watchOS** or **tvOS** as your Apple platform. If you are creating a multi-platform app, you can add more platforms later. + +Add your app's **product name** and **bundle identifier**, your bundle identifier is the one entered when creating an Xcode project. For existing projects, you should use the **bundle identifier** from your project files **Identity** section. ![Add a platform](/images/docs/databases/quick-start/add-platform.png) You can skip optional steps. -{% /section %} -{% section #step-2 step=2 title="Create XCode project" %} -Open XCode and select **Create a new XCode project** > select **App** > create an app named `my-app` under the **Organization Identifier** `example`. -This creates a new app with the **Bundle ID** `example.my-app`. {% /section %} -{% section #step-3 step=3 title="Install Appwrite" %} -Install the Appwrite SDK for Apple. +{% section #step-3 step=3 title="Add the Appwrite SDK" %} +To add the Appwrite SDK for Apple as a dependency, open the **File** menu and click **Add Packages**. -1. Select **File** > **Add Packages** -2. Search for the Appwrite SDK with the URL `https://github.com/appwrite/sdk-for-apple` -3. In the right panel, select your target project and add your desired version rules -4. Select Add Package and wait for package resolution to complete -5. Make sure the Appwrite package product is checked and select Add Package again +In the **Package URL** search box, enter https://github.com/appwrite/sdk-for-apple. +Once the SDK is found, select **Up to Next Major Version** as your **Dependency Rule** and click **Add Package**. + +When dependency resolution is complete, click **Add Package** again to add the SDK package to your target. + +In order to allow creating OAuth sessions, the following URL scheme must be added to your **Info.plist** file. + +```plist +CFBundleURLTypes + + + CFBundleTypeRole + Editor + CFBundleURLName + io.appwrite + CFBundleURLSchemes + + appwrite-callback-[PROJECT_ID] + + + +``` + +If you're using UIKit as opposed to SwiftUI, you will also need to add the following to your **SceneDelegate.swift** file. + +```swift +func scene(_ scene: UIScene, openURLContexts URLContexts: Set) { + guard let url = URLContexts.first?.url, + url.absoluteString.contains("appwrite-callback") else { + return + } + + WebAuthComponent.handleIncomingCookie(from: url) +} +``` {% /section %} -{% section #step-4 step=4 title="Import Appwrite" %} +{% section #step-4 step=4 title="Create Appwrite Singleton" %} Find your project's ID in the **Settings** page. ![Settings page in Appwrite Console.](/images/docs/databases/quick-start/project-id.png) -Create a new file `src/lib/appwrite.js` and add the following code to it, replace `` with your project ID. +Create a new file `Appwrite.swift` and add the following code to it, replacing `[YOUR_PROJECT_ID]` with your project ID. ```swift -TODO +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("[YOUR_PROJECT_ID]") + + 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.createEmailSession( + email: email, + password: password + ) + } + + public func onLogout() async throws { + _ = try await account.deleteSession( + sessionId: "current" + ) + } + +} + ``` {% /section %} {% section #step-5 step=5 title="Create a login page" %} -Add the following code to `src/App.jsx`. +Add the following code to `ContentView.swift`. ```swift -TODO +import SwiftUI + +class ViewModel: ObservableObject { + @Published var email: String = "" + @Published var password: String = "" +} + +struct ContentView: View { + @ObservedObject var viewModel = ViewModel() + + var body: some View { + VStack { + TextField( + "Email", + text: $viewModel.email + ) + SecureField( + "Password", + text: $viewModel.password + ) + Button( + action: { Task { + try await Appwrite.onRegister( + viewModel.email, + viewModel.password + ) + }}, + label: { + Text("Register") + } + ) + Button( + action: { Task { + try! await Appwrite.onLogin( + viewModel.email, + viewModel.password + ) + }}, + label: { + Text("Login") + } + ) + } + .padding() + } +} ``` {% /section %} -{% section #step-6 step=6 title="Checkout what you've built" %} -Run your project with `npm run dev -- --open --port 3000` and open [http://localhost:3000](http://localhost:3000) in your browser. +{% section #step-6 step=6 title="All set" %} +Run your project by clicking **Start active scheme** in Xcode. {% /section %} \ No newline at end of file diff --git a/src/routes/docs/quick-starts/astro/+page.markdoc b/src/routes/docs/quick-starts/astro/+page.markdoc index 5a459774dd..e057511264 100644 --- a/src/routes/docs/quick-starts/astro/+page.markdoc +++ b/src/routes/docs/quick-starts/astro/+page.markdoc @@ -1,6 +1,6 @@ --- layout: article -title: Quick start with Astro +title: Start with Astro description: Learn how to quickly integrate Appwrite products and services into your Astro project. difficulty: beginner readtime: 3 diff --git a/src/routes/docs/quick-starts/dart/+page.markdoc b/src/routes/docs/quick-starts/dart/+page.markdoc new file mode 100644 index 0000000000..e6a6a94c0d --- /dev/null +++ b/src/routes/docs/quick-starts/dart/+page.markdoc @@ -0,0 +1,202 @@ +--- +layout: article +title: Start with Dart +description: This is the description used for SEO. +--- +Learn to setup your first Dart project powered by Appwrite. +{% section #step-1 step=1 title="Create project" %} +Head to the [Appwrite Console](https://cloud.appwrite.io/console). + +![Create project screen](/images/docs/databases/quick-start/create-project.png) + +If this is your first time using Appwrite, create an account and create your first project. + + +Then, under **Integrate with your server**, add an **API Key** with the following scopes. + +| Category {% width=120 %} | Required scopes | Purpose | +|-----------|-----------------------|---------| +| Database | `databases.write` | Allows API key to create, update, and delete [databases](/docs/products/databases/databases). | +| | `collections.write` | Allows API key to create, update, and delete [collections](/docs/products/databases/collections). | +| | `attributes.write` | Allows API key to create, update, and delete [attributes](/docs/products/databases/collections#attributes). | +| | `documents.read` | Allows API key to create, update, and delete [documents](/docs/products/databases/documents). | +| | `documents.write` | Allows API key to read [documents](/docs/products/databases/documents). | + +Other scopes are optional. + +![Add API Key]() + +{% /section %} +{% section #step-2 step=2 title="Create Dart project" %} +Create a Dart CLI application. + +```sh +dart create -t console my_app +cd my_app +``` + +After entering the project directory, remove the `lib/` and `test/` directories. + +{% /section %} +{% section #step-3 step=3 title="Install Appwrite" %} + +Install the Dart Appwrite SDK. + +```sh +dart pub add dart_appwrite +``` +{% /section %} +{% section #step-4 step=4 title="Import Appwrite" %} + +Find your project ID in the **Settings** page. Also, click on the **View API Keys** button to find the API key that was created earlier. + +![Settings page in Appwrite Console.](/images/docs/databases/quick-start/project-id.png) + +Open `bin/my_app.dart` and initialize the Appwrite Client. Replace `` with your project ID and `` with your API key. + +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; + +var client = Client(); + +Future main() async { + client + .setEndpoint("https://cloud.appwrite.io/v1") + .setProject("") + .setKey(""); +} +``` + +{% /section %} +{% section #step-5 step=5 title="Initialize database" %} + +Once the Appwrite Client is initialized, create a function to configure a todo collection. + +```dart +var databases; +var todoDatabase; +var todoCollection; + +Future prepareDatabase() async { + databases = Databases(client); + + todoDatabase = await databases.create( + databaseId: ID.unique(), + name: 'TodosDB' + ); + + todoCollection = await databases.createCollection( + databaseId: todoDatabase.$id, + collectionId: ID.unique(), + name: 'Todos' + ); + + await databases.createStringAttribute( + databaseId: todoDatabase.$id, + collectionId: todoCollection.$id, + key: 'title', + size: 255, + xrequired: true + ); + + await databases.createStringAttribute( + databaseId: todoDatabase.$id, + collectionId: todoCollection.$id, + key: 'description', + size: 255, + xrequired: false, + xdefault: 'This is a test description' + ); + + await databases.createBooleanAttribute( + databaseId: todoDatabase.$id, + collectionId: todoCollection.$id, + key: 'isComplete', + xrequired: true + ); +} +``` + +{% /section %} +{% section #step-6 step=6 title="Add documents" %} +Create a function to add some mock data into your new collection. +```dart +Future seedDatabase() async { + var testTodo1 = { + 'title': 'Buy apples', + 'description': 'At least 2KGs', + 'isComplete': true + }; + + var testTodo2 = { + 'title': 'Wash the apples', + 'isComplete': true + }; + + var testTodo3 = { + 'title': 'Cut the apples', + 'description': 'Don\'t forget to pack them in a box', + 'isComplete': false + }; + + await databases.createDocument( + databaseId: todoDatabase.$id, + collectionId: todoCollection.$id, + documentId: ID.unique(), + data: testTodo1 + ); + + await databases.createDocument( + databaseId: todoDatabase.$id, + collectionId: todoCollection.$id, + documentId: ID.unique(), + data: testTodo2 + ); + + await databases.createDocument( + databaseId: todoDatabase.$id, + collectionId: todoCollection.$id, + documentId: ID.unique(), + data: testTodo3 + ); +} +``` + +{% /section %} +{% section #step-7 step=7 title="Retrieve documents" %} + +Create a function to retrieve the mock todo data. +```dart +Future getTodos() async { + var todos = await databases.listDocuments( + databaseId: todoDatabase.$id, + collectionId: todoCollection.$id + ); + + todos.documents.forEach((todo) { + print('Title: ${todo.data['title']}\nDescription: ${todo.data['description']}\nIs Todo Complete: ${todo.data['isComplete']}\n\n'); + }); +} +``` + +Finally, revisit the `main()` function and call the functions created in previous steps. +```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(); +} +``` + +{% /section %} +{% section #step-8 step=8 title="All set" %} + +Run your project with `dart run bin/my_app.dart` and view the response in your console. + +{% /section %} \ No newline at end of file diff --git a/src/routes/docs/quick-starts/flutter/+page.markdoc b/src/routes/docs/quick-starts/flutter/+page.markdoc index 4df853c009..d3f66e666e 100644 --- a/src/routes/docs/quick-starts/flutter/+page.markdoc +++ b/src/routes/docs/quick-starts/flutter/+page.markdoc @@ -1,13 +1,22 @@ --- layout: article -title: Quick start with Flutter +title: Start with Flutter description: Learn how to quickly integrate Appwrite products and services into your Flutter project. difficulty: beginner readtime: 3 --- Learn to setup your first Flutter project powered by Appwrite. -{% section #step-1 step=1 title="Create project" %} + +{% section #step-1 step=1 title="Create Flutter project" %} +Create a Flutter project. + +```sh +flutter create my_app && cd my_app +``` +{% /section %} + +{% section #step-2 step=2 title="Create project" %} Head to the [Appwrite Console](https://cloud.appwrite.io/console). ![Create project screen](/images/docs/databases/quick-start/create-project.png) @@ -60,7 +69,7 @@ You have to change your iOS Deployment Target in Xcode to be iOS >= 11 to be abl {% /tabsitem %} {% tabsitem #android title="Android" %} -Add your app's **name** and *package name*, Your package name is generally the **applicationId** in your app-level [build.gradle](https://github.com/appwrite/playground-for-flutter/blob/master/android/app/build.gradle#L41) file. +Add your app's **name** and **package name**, Your package name is generally the **applicationId** in your app-level [build.gradle](https://github.com/appwrite/playground-for-flutter/blob/master/android/app/build.gradle#L41) file. In order to capture the Appwrite OAuth callback url, the following activity needs to be added inside the `` tag, along side the existing `` tags in your [AndroidManifest.xml](https://github.com/appwrite/playground-for-flutter/blob/master/android/app/src/main/AndroidManifest.xml). Be sure to replace the **[PROJECT_ID]** string with your actual Appwrite project ID. @@ -128,17 +137,10 @@ If you cannot find the correct package name, run the application in Windows, and {% /tabs %} -![Add a platform](/images/docs/databases/quick-start/add-platform.png) +![Add a platform]() You can skip optional steps. -{% /section %} -{% section #step-2 step=2 title="Create Flutter project" %} -Create a Flutter project. - -```sh -flutter create my_app && cd my_app -``` {% /section %} {% section #step-3 step=3 title="Install Appwrite" %} @@ -155,60 +157,39 @@ Find your project's ID in the **Settings** page. ![Settings page in Appwrite Console.](/images/docs/databases/quick-start/project-id.png) -Create a new file `lib/appwrite.dart` and add the following code to it, replace `` with your project ID. +Open the generated `lib/main.dart` and add the following code to it, replace `` with your project ID. +This imports and initializes Appwrite. ```dart +import 'package:flutter/material.dart'; import 'package:appwrite/appwrite.dart'; +import 'package:appwrite/models.dart' as models; -class Appwrite { - static final Appwrite instance = Appwrite._internal(); - - late final Client client; - late final Account account; - factory Appwrite._() { - return instance; - } - - Appwrite._internal() { - client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") - .setProject(""); - account = Account(client); - } +void main() { + WidgetsFlutterBinding.ensureInitialized(); + Client client = Client(); + client = Client() + .setEndpoint("https://cloud.appwrite.io/v1") + .setProject("650209298acac4ee1bb6"); + ; + Account account = Account(client); + + runApp(MyApp( + account: account, + )); } ``` {% /section %} {% section #step-5 step=5 title="Create a login page" %} -Add the following code to `src/App.jsx`. +Then, append the following widgets to `lib/main.dart` create your login page. import 'package:appwrite/appwrite.dart'; ```dart -import 'package:flutter/material.dart'; -import 'package:appwrite/appwrite.dart'; -import 'package:appwrite/models.dart' as models; - -import 'package:my_app/appwrite.dart'; - -void main() { - runApp(MyApp()); -} +class MyForm extends StatefulWidget { + final Account account; -class MyApp extends StatelessWidget { - @override - Widget build(BuildContext context) { - return MaterialApp( - home: Scaffold( - appBar: AppBar(title: const Text('My App')), - body: Padding( - padding: const EdgeInsets.all(16.0), - child: MyForm(), - ), - ), - ); - } -} + MyForm({required this.account}); -class MyForm extends StatefulWidget { @override MyFormState createState() { return MyFormState(); @@ -222,22 +203,21 @@ class MyFormState extends State { final TextEditingController nameController = TextEditingController(); Future login(String email, String password) async { - await Appwrite.instance.account - .createEmailSession(email: email, password: password); - final user = await Appwrite.instance.account.get(); + await widget.account.createEmailSession(email: email, password: password); + final user = await widget.account.get(); setState(() { loggedInUser = user; }); } Future register(String email, String password, String name) async { - await Appwrite.instance.account.create( + await widget.account.create( userId: ID.unique(), email: email, password: password, name: name); await login(email, password); } Future logout() async { - await Appwrite.instance.account.deleteSession(sessionId: 'current'); + await widget.account.deleteSession(sessionId: 'current'); setState(() { loggedInUser = null; }); @@ -294,6 +274,6 @@ class MyFormState extends State { ``` {% /section %} -{% section #step-6 step=6 title="Checkout what you've built" %} +{% section #step-6 step=6 title="All set" %} Run your project with `flutter run` and select a browser, platform, or emulator to run your project. {% /section %} \ No newline at end of file diff --git a/src/routes/docs/quick-starts/nextjs/+page.markdoc b/src/routes/docs/quick-starts/nextjs/+page.markdoc index bdc8c3e597..2fc5a6aaf3 100644 --- a/src/routes/docs/quick-starts/nextjs/+page.markdoc +++ b/src/routes/docs/quick-starts/nextjs/+page.markdoc @@ -1,9 +1,16 @@ --- layout: article -title: Quick start with Next.js +title: Start with Next.js description: Learn how to quickly integrate Appwrite products and services into your Next.js project. difficulty: beginner readtime: 3 --- -hello world \ No newline at end of file +Improve the docs, add this guide. + +We still don't have this guide in place, but we do have some great news. +The Appwrite docs, just like Appwrite, is completely open sourced. +This means, anyone can help improve them and add new guides and tutorials. + +If you see this page, **we're actively looking for contributions to this page**. +Follow our contribution guidelines, open a PR to [our Website repo](https://github.com/appwrite/website), and collaborate with our core team to improve this page. \ No newline at end of file diff --git a/src/routes/docs/quick-starts/node/+page.markdoc b/src/routes/docs/quick-starts/node/+page.markdoc new file mode 100644 index 0000000000..e666bcd6d3 --- /dev/null +++ b/src/routes/docs/quick-starts/node/+page.markdoc @@ -0,0 +1,191 @@ +--- +layout: article +title: Start with Node.js +description: This is the description used for SEO. +--- +Learn to setup your first Node.js project powered by Appwrite. +{% section #step-1 step=1 title="Create project" %} +Head to the [Appwrite Console](https://cloud.appwrite.io/console). + +![Create project screen](/images/docs/databases/quick-start/create-project.png) + +If this is your first time using Appwrite, create an account and create your first project. + +Then, under **Integrate with your server**, add an **API Key** with the following scopes. + +| Category {% width=120 %} | Required scopes | Purpose | +|-----------|-----------------------|---------| +| Database | `databases.write` | Allows API key to create, update, and delete [databases](/docs/products/databases/databases). | +| | `collections.write` | Allows API key to create, update, and delete [collections](/docs/products/databases/collections). | +| | `attributes.write` | Allows API key to create, update, and delete [attributes](/docs/products/databases/collections#attributes). | +| | `documents.read` | Allows API key to create, update, and delete [documents](/docs/products/databases/documents). | +| | `documents.write` | Allows API key to read [documents](/docs/products/databases/documents). | + +Other scopes are optional. + +![Add API Key]() + +{% /section %} +{% section #step-2 step=2 title="Create Node.js project" %} +Create a Node.js CLI application. + +```sh +mkdir my-app +cd my-app +npm init +``` + +{% /section %} +{% section #step-3 step=3 title="Install Appwrite" %} + +Install the Node.js Appwrite SDK. + +```sh +npm install node-appwrite +``` +{% /section %} +{% section #step-4 step=4 title="Import Appwrite" %} + +Find your project ID in the **Settings** page. Also, click on the **View API Keys** button to find the API key that was created earlier. + +![Settings page in Appwrite Console.](/images/docs/databases/quick-start/project-id.png) + +Create a new file `app.js` and initialize the Appwrite Client. Replace `` with your project ID and `` with your API key. + +```js +const sdk = require("node-appwrite"); + +const client = new sdk.Client(); + +client + .setEndpoint("https://cloud.appwrite.io/v1") + .setProject("") + .setKey(""); +``` + +{% /section %} +{% section #step-5 step=5 title="Initialize database" %} + +Once the Appwrite Client is initialized, create a function to configure a todo collection. + +```js +const databases = new sdk.Databases(client); + +var todoDatabase; +var todoCollection; + +async function prepareDatabase() { + todoDatabase = await databases.create( + sdk.ID.unique(), + 'TodosDB' + ); + + todoCollection = await databases.createCollection( + todoDatabase.$id, + sdk.ID.unique(), + 'Todos' + ); + + await databases.createStringAttribute( + todoDatabase.$id, + todoCollection.$id, + 'title', + 255, + true + ); + + await databases.createStringAttribute( + todoDatabase.$id, + todoCollection.$id, + 'description', + 255, false, + 'This is a test description' + ); + + await databases.createBooleanAttribute( + todoDatabase.$id, + todoCollection.$id, + 'isComplete', + true + ); +} +``` + +{% /section %} +{% section #step-6 step=6 title="Add documents" %} +Create a function to add some mock data into your new collection. +```js +async function seedDatabase() { + var testTodo1 = { + title: 'Buy apples', + description: 'At least 2KGs', + isComplete: true + }; + + var testTodo2 = { + title: 'Wash the apples', + isComplete: true + }; + + var testTodo3 = { + title: 'Cut the apples', + description: 'Don\'t forget to pack them in a box', + isComplete: false + }; + + await databases.createDocument( + todoDatabase.$id, + todoCollection.$id, + sdk.ID.unique(), + testTodo1 + ); + + await databases.createDocument( + todoDatabase.$id, + todoCollection.$id, + sdk.ID.unique(), + testTodo2 + ); + + await databases.createDocument( + todoDatabase.$id, + todoCollection.$id, + sdk.ID.unique(), + testTodo3 + ); +} +``` + +{% /section %} +{% section #step-7 step=7 title="Retrieve documents" %} + +Create a function to retrieve the mock todo data and a function to execute the requests in order. +Run the functions to by calling `runAllTasks();`. + +```js +async function getTodos() { + var todos = await databases.listDocuments( + todoDatabase.$id, + todoCollection.$id + ); + + todos.documents.forEach(todo => { + console.log(`Title: ${todo.title}\nDescription: ${todo.description}\nIs Todo Complete: ${todo.isComplete}\n\n`); + }); +} + +async function runAllTasks() { + await prepareDatabase(); + await seedDatabase(); + await getTodos(); +} +runAllTasks(); +``` + +{% /section %} + +{% section #step-8 step=8 title="All set" %} + +Run your project with `node app.js` and view the response in your console. + +{% /section %} \ No newline at end of file diff --git a/src/routes/docs/quick-starts/nuxt/+page.markdoc b/src/routes/docs/quick-starts/nuxt/+page.markdoc index 19a02f7a90..cc11a79c1e 100644 --- a/src/routes/docs/quick-starts/nuxt/+page.markdoc +++ b/src/routes/docs/quick-starts/nuxt/+page.markdoc @@ -1,9 +1,16 @@ --- layout: article -title: Quick start with Nuxt +title: Start with Nuxt description: Learn how to quickly integrate Appwrite products and services into your Nuxt project. difficulty: beginner readtime: 3 --- -hello world \ No newline at end of file +Improve the docs, add this guide. + +We still don't have this guide in place, but we do have some great news. +The Appwrite docs, just like Appwrite, is completely open sourced. +This means, anyone can help improve them and add new guides and tutorials. + +If you see this page, **we're actively looking for contributions to this page**. +Follow our contribution guidelines, open a PR to [our Website repo](https://github.com/appwrite/website), and collaborate with our core team to improve this page. \ No newline at end of file diff --git a/src/routes/docs/quick-starts/qwik/+page.markdoc b/src/routes/docs/quick-starts/qwik/+page.markdoc index 435d65283b..3793c4229f 100644 --- a/src/routes/docs/quick-starts/qwik/+page.markdoc +++ b/src/routes/docs/quick-starts/qwik/+page.markdoc @@ -1,6 +1,6 @@ --- layout: article -title: Quick start with Qwik +title: Start with Qwik description: Learn how to quickly integrate Appwrite products and services into your Qwik project. difficulty: beginner readtime: 3 diff --git a/src/routes/docs/quick-starts/react/+page.markdoc b/src/routes/docs/quick-starts/react/+page.markdoc index 9859409d62..7201c0604d 100644 --- a/src/routes/docs/quick-starts/react/+page.markdoc +++ b/src/routes/docs/quick-starts/react/+page.markdoc @@ -117,6 +117,6 @@ export default App; ``` {% /section %} -{% section #step-6 step=6 title="Checkout what you've built" %} +{% section #step-6 step=6 title="All set" %} Run your project with `npm run dev -- --open --port 3000` and open [http://localhost:3000](http://localhost:3000) in your browser. {% /section %} \ No newline at end of file diff --git a/src/routes/docs/quick-starts/sveltekit/+page.markdoc b/src/routes/docs/quick-starts/sveltekit/+page.markdoc index 2208fab870..e17b8dbd0f 100644 --- a/src/routes/docs/quick-starts/sveltekit/+page.markdoc +++ b/src/routes/docs/quick-starts/sveltekit/+page.markdoc @@ -9,7 +9,7 @@ Head to the [Appwrite Console](https://cloud.appwrite.io/console). ![Create project screen](/images/docs/databases/quick-start/create-project.png) -If this is your first time using Appwrite, create an accout and create your first project. +If this is your first time using Appwrite, create an account and create your first project. Then, under **Add a platform**, add a **Web app**. The **Hostname** should be `localhost`. @@ -99,7 +99,7 @@ Create a new file `src/routes/index.svelte` and add the following code to it. ``` {% /section %} -{% section #step-6 step=6 title="Checkout what you've built" %} +{% section #step-6 step=6 title="All set" %} Run your project with `npm run dev -- --open --port 3000` and open [http://localhost:3000](http://localhost:3000) in your browser. {% /section %} diff --git a/src/routes/docs/quick-starts/vuejs/+page.markdoc b/src/routes/docs/quick-starts/vue/+page.markdoc similarity index 97% rename from src/routes/docs/quick-starts/vuejs/+page.markdoc rename to src/routes/docs/quick-starts/vue/+page.markdoc index 5c8bf345c9..1879d2b1fe 100644 --- a/src/routes/docs/quick-starts/vuejs/+page.markdoc +++ b/src/routes/docs/quick-starts/vue/+page.markdoc @@ -108,6 +108,6 @@ const logout = async () => { ``` {% /section %} -{% section #step-6 step=6 title="Checkout what you've built" %} +{% section #step-6 step=6 title="All set" %} Run your project with `npm run dev -- --open --port 3000` and open [http://localhost:3000](http://localhost:3000) in your browser. {% /section %} diff --git a/src/routes/docs/references/Layout.svelte b/src/routes/docs/references/Layout.svelte index 65bd07f068..a9c1185884 100644 --- a/src/routes/docs/references/Layout.svelte +++ b/src/routes/docs/references/Layout.svelte @@ -21,7 +21,7 @@ ] }, { - label: 'Services', + label: 'APIs', items: [ { label: 'Account', @@ -64,7 +64,16 @@ href: `${prefix}/avatars` } ] - } + }, + { + label: 'Debugging', + items: [ + { + label: 'Response codes', + href: '/docs/advanced/platform/response-codes', + } + ] + }, ] as NavTree; const parent: NavParent = { diff --git a/src/routes/docs/references/[version]/[platform]/[service]/+page.svelte b/src/routes/docs/references/[version]/[platform]/[service]/+page.svelte index f950516af1..87e71d05fa 100644 --- a/src/routes/docs/references/[version]/[platform]/[service]/+page.svelte +++ b/src/routes/docs/references/[version]/[platform]/[service]/+page.svelte @@ -75,7 +75,7 @@
- +
diff --git a/src/routes/docs/references/[version]/models/[model]/+page.svelte b/src/routes/docs/references/[version]/models/[model]/+page.svelte index 607e1d4471..226c06720e 100644 --- a/src/routes/docs/references/[version]/models/[model]/+page.svelte +++ b/src/routes/docs/references/[version]/models/[model]/+page.svelte @@ -32,7 +32,7 @@ {/each} - Example + Example diff --git a/src/routes/docs/sdks/+page.markdoc b/src/routes/docs/sdks/+page.markdoc index 2a225437f6..cc32cc7782 100644 --- a/src/routes/docs/sdks/+page.markdoc +++ b/src/routes/docs/sdks/+page.markdoc @@ -8,12 +8,12 @@ Appwrite provides SDK libraries for major programming languages and platforms so We're always working on improving and extending the current stack of available platforms and SDKs, listed below is a list of official libraries the Appwrite team is maintaining. -## Client Side {% #client-side %} +## Client {% #client %} Client libraries for integrating with Appwrite to build client-based applications and websites. Read one of the many [quick starts](/docs/quick-starts) guides for your framework of choice to start building your first application. {% table %} -*   {% width=80 %} +*   {% width=48 %} * Platform * GitHub Repository *   {% width=80 %} @@ -43,12 +43,12 @@ Client libraries for integrating with Appwrite to build client-based application * {% /table %} -## Server Side {% #server-side %} +## Server {% #server %} Server libraries for integrating with Appwrite to build server side integrations or use inside your [Appwrite Functions](/docs/products/functions). Read one of the many [quick starts](/docs/quick-starts) guides for your language/runtime of choice to start building your first server integration. {% table %} -*   {% width=80 %} +*   {% width=48 %} * Platform * GitHub Repository *   {% width=80 %} @@ -114,9 +114,12 @@ If you would like to help us extend our platforms and SDKs stack, you are more t We are always looking to add new SDKs to our platform. If the SDK you are looking for is still missing, labeled as beta or experimental, or you simply do not want to integrate with an SDK, you can always integrate with Appwrite directly using any standard HTTP, GraphQL, or WebSocket clients and the relevant Appwrite protocol. Appwrite supports multiple API protocols for maximum flexibility and developer convenience. You can learn more about how to integrate directly with them using one of the following available guides: -- [Integrate with the Appwrite REST API](#) -- [Integrate with the Appwrite GraphQL API](#) -- [Integrate with the Appwrite Realtime API](#) + +[Integrate with the Appwrite Realtime API {% icon icon="cheveron-right" /%}](/docs/apis/realtime) + +[Integrate with the Appwrite REST API {% icon icon="cheveron-right" /%}](/docs/apis/rest) + +[Integrate with the Appwrite GraphQL API {% icon icon="cheveron-right" /%}](/docs/apis/graphql) ## Community {% #community %} If you have created your own framework or any other technology specific integration and would like us to list it here please [contact us](/contact-us). diff --git a/src/routes/docs/tooling/assistant/+page.markdoc b/src/routes/docs/tooling/assistant/+page.markdoc index 9993e6fb1d..ef4ddf6521 100644 --- a/src/routes/docs/tooling/assistant/+page.markdoc +++ b/src/routes/docs/tooling/assistant/+page.markdoc @@ -12,7 +12,7 @@ While the Appwrite Assistant remains under active development and is considered ## Getting started {% #getting-started %} -To engage the Appwrite Assistant, access the Command Center within your Appwrite console, and proceed to the `Ask the AI` tab in the navigation. +To engage the Appwrite Assistant, access the Command Center within your Appwrite Console, and proceed to the `Ask the AI` tab in the navigation. ## Querying {% #querying %} diff --git a/src/routes/docs/tooling/command-line/deployment/+page.markdoc b/src/routes/docs/tooling/command-line/deployment/+page.markdoc index 8f5a7b27e0..236d836366 100644 --- a/src/routes/docs/tooling/command-line/deployment/+page.markdoc +++ b/src/routes/docs/tooling/command-line/deployment/+page.markdoc @@ -14,7 +14,7 @@ After you're logged in, the CLI needs to be initialized with your Appwrite proje appwrite init project ``` -The following prompts will guide you through the setup process. The init command also creates an [appwrite.json](/docs/command-line-deployment#appwriteJSON) file representing your Appwrite project. +The following prompts will guide you through the setup process. The init command also creates an [appwrite.json](/docs/tooling/command-line/deployment#appwrite-json) file representing your Appwrite project. You can fetch all the existing databases and collections in your current project using: @@ -54,7 +54,7 @@ appwrite deploy function The Appwrite CLI also helps you deploy your project's databases and collections schema from one project to another. -You can deploy all the databases and collections in your [appwrite.json](#) file by running this command in the folder holding your `appwrite.json` file. +You can deploy all the databases and collections in your [appwrite.json](/docs/tooling/command-line/deployment#appwrite-json) file by running this command in the folder holding your `appwrite.json` file. The deploy command will overwrite existing collections causing existing data to be lost. If you already have data in your project, you will need to write your own migration script using a Server SDK instead of using the CLI. @@ -64,7 +64,7 @@ appwrite deploy collection ## Deploying Teams {% #deploying-teams %} -The Appwrite CLI can create teams to organize users. Teams can be used to grant access permissions to a group of users. [Learn more about permissions](/docs/permissions#permission-roles). +The Appwrite CLI can create teams to organize users. Teams can be used to grant access permissions to a group of users. Learn more about permissions. Deploy teams by running this command in the folder holding your `appwrite.json` file. @@ -74,7 +74,7 @@ appwrite deploy team ## Deploying Storage {% #deploying-storage %} -The Appwrite CLI allows you to configure and deploy buckets across projects. All the bucket's settings are available through the [appwrite.json](/docs/command-line-deployment#appwriteJSON) file. +The Appwrite CLI allows you to configure and deploy buckets across projects. All the bucket's settings are available through the [appwrite.json](/docs/tooling/command-line/deployment#appwrite-json) file. Deploy storage buckets by running this command in the folder holding your `appwrite.json` file. @@ -84,7 +84,7 @@ appwrite deploy bucket ## Conflicts {% #conflicts %} -When using `appwrite.json`, changes made in the Appwrite Console can cause conflicts with the local config. To avoid conflicts, prefer updating configuration locally and deploying instead of using the console. +When using `appwrite.json`, changes made in the Appwrite Console can cause conflicts with the local config. To avoid conflicts, prefer updating configuration locally and deploying instead of using the Console. ## The appwrite.json file {% #appwrite-json %} @@ -98,11 +98,11 @@ Here's a complete list of all configurable options in `appwrite.json`: | --- | --- | --- | | `projectId` | string | ID of your Appwrite Project. | | `projectName` | string | Name of your Appwrite Project. | -| `functions` | array of [functions](/docs/command-line-deployment#function-options) | Configuration of functions in your project. | -| `databases` | array of [databases](/docs/command-line-deployment#databases-options) | Configuration of databases in your project. | -| `collections` | array of [collections](/docs/command-line-deployment#collection-options) | Configuration of collections in your project. | -| `teams` | array of [teams](/docs/command-line-deployment#teams-options) | Configuration of teams in your project. | -| `buckets` | array of [buckets](/docs/command-line-deployment#buckets-options) | Configuration of teams in your project. | +| `functions` | array of functions | Configuration of functions in your project. | +| `databases` | array of databases | Configuration of databases in your project. | +| `collections` | array of collections | Configuration of collections in your project. | +| `teams` | array of teams | Configuration of teams in your project. | +| `buckets` | array of buckets | Configuration of teams in your project. | #### Function options @@ -110,13 +110,13 @@ Here's a complete list of all configurable options in `appwrite.json`: | --- | --- | --- | | `$id` | string | Function ID. | | `name` | string | Function Name. | -| `runtime` | string | Function runtime, must be enabled. [Learn more about runtimes](/docs/functions#supportedRuntimes). | +| `runtime` | string | Function runtime, must be enabled. [Learn more about runtimes](/docs/products/functions/runtimes#available-runtimes). | | `path` | string | Path to folder containing the function's source code. | | `entrypoint` | string | Entry point of the function relative to the folder specified in path. | -| `ignore` | array of strings | Files to ignore inside the function. [Learn more about ignoring files](/docs/functions#ignoreFiles). | -| `execute` | array of strings | Grants execute permissions to users. [Learn more about role strings](/docs/rest#permissions). | -| `events` | array of strings | Events that trigger the function to execute. [Learn more about events](/docs/events). | -| `schedule` | string | Execute schedule for the function. [Learn more about scheduled executions](/docs/functions#scheduled-execution). | +| `ignore` | array of strings | Files to ignore inside the function. [Learn more about ignoring files](/docs). | +| `execute` | array of strings | Grants execute permissions to users. [Learn more about role strings](/docs/apis/rest#permissions). | +| `events` | array of strings | Events that trigger the function to execute. [Learn more about events](/docs). | +| `schedule` | string | Execute schedule for the function. [Learn more about scheduled executions](/docs/products/functions/execution#schedule). | | `timeout` | int | Execution timeout of the function in seconds, with a maximum configurable limit of 900 seconds. | | `variables` | JSON object | Variables provided to the function on execution stored as a key-value JSON object. | @@ -136,9 +136,9 @@ Here's a complete list of all configurable options in `appwrite.json`: | `databaseId` | string | ID of the database to which this collection belongs. | | `enabled` | bool | If the collection is enabled. | | `documentSecurity` | bool | If access permissions can be defined at the document level. | -| `$permissions` | array of strings | Grants access permissions to users at the collection level. [Learn more about permissions](/docs/rest#permissions). | -| `attributes` | array of objects | Defines a list of attributes in the collection. [Learn more about the Attributes List Object](/docs/models/attributeList). | -| `indexes` | array of objects | Defines a list of indexes in the collection. [Learn more about the Indexes List Object](/docs/models/indexList). | +| `$permissions` | array of strings | Grants access permissions to users at the collection level. [Learn more about permissions](/docs/apis/rest#permissions). | +| `attributes` | array of objects | Defines a list of attributes in the collection. [Learn more about the Attributes List Object](/docs/references/cloud/models/attributeList). | +| `indexes` | array of objects | Defines a list of indexes in the collection. [Learn more about the Indexes List Object](/docs/references/cloud/models/indexList). | #### Buckets options @@ -146,8 +146,8 @@ Here's a complete list of all configurable options in `appwrite.json`: | --- | --- | --- | | `$id` | string | Bucket ID. | | `name` | string | Bucket Name. | -| `$permissions` | array of strings | Grants access permissions to users at the bucket level. [Learn more about permissions](/docs/rest#permissions). | -| `fileSecurity` | boolean | Whether file-level security is enabled. [Learn more about permissions](/docs/rest#permissions). | +| `$permissions` | array of strings | Grants access permissions to users at the bucket level. [Learn more about permissions](/docs/apis/rest#permissions). | +| `fileSecurity` | boolean | Whether file-level security is enabled. [Learn more about permissions](/docs/apis/rest#permissions). | | `enabled` | boolean | Whether the bucket is enabled or disabled. | | `maximumFileSize` | integer | Maximum file size supported. | | `allowedFileExtensions` | string\[\] | List of allowed file extensions. | diff --git a/src/routes/docs/tooling/command-line/installation/+page.markdoc b/src/routes/docs/tooling/command-line/installation/+page.markdoc index 77584185a8..1d7b829a9f 100644 --- a/src/routes/docs/tooling/command-line/installation/+page.markdoc +++ b/src/routes/docs/tooling/command-line/installation/+page.markdoc @@ -95,11 +95,11 @@ You can use the CLI to create and deploy functions and collections. Deploy comma Besides utility commands, the CLI can be used to execute commands like a Server SDK. -[Find a full list of commands](#) +[Find a full list of commands](/docs/tooling/command-line/commands) You can choose to use the CLI in a headless and non-interactive mode without the need for config files or sessions. This is useful for CI or scripting use cases. -[Learn more about CI mode](#) +[Learn more about CI mode](/docs/tooling/command-line/non-interactive) ## Help {% #help %} diff --git a/src/routes/docs/tooling/command-line/non-interactive/+page.markdoc b/src/routes/docs/tooling/command-line/non-interactive/+page.markdoc index 6338b1bdb8..f62f92f4b4 100644 --- a/src/routes/docs/tooling/command-line/non-interactive/+page.markdoc +++ b/src/routes/docs/tooling/command-line/non-interactive/+page.markdoc @@ -17,7 +17,7 @@ When you set the global configuration parameters using the `appwrite client` com In this mode, the CLI can only interact with one project at a time. ## API Keys {% #api-keys %} -In non-interactive mode, the CLI uses an API key to authenticate. Your API key must have sufficient permissions to execute the commands you plan to use. [Learn more about API Keys](/docs/platform/api-keys). +In non-interactive mode, the CLI uses an API key to authenticate. Your API key must have sufficient permissions to execute the commands you plan to use. [Learn more about API Keys](/docs/advanced/platform/api-keys). ## Deployment {% #deployment %} Appwrite's deploy commands can also be executed in a non-interactive mode. This applies to both function and collection deployment. diff --git a/src/routes/docs/tutorials/+page.svelte b/src/routes/docs/tutorials/+page.svelte index 34392306f8..965697ceaf 100644 --- a/src/routes/docs/tutorials/+page.svelte +++ b/src/routes/docs/tutorials/+page.svelte @@ -1,6 +1,4 @@ @@ -21,8 +19,8 @@
  • -

    Lorem ipsum dolor sit amet consectetur. @@ -32,8 +30,8 @@

  • -

    Lorem ipsum dolor sit amet consectetur. @@ -43,8 +41,8 @@

  • -

    Lorem ipsum dolor sit amet consectetur. @@ -54,147 +52,19 @@

  • -

    Lorem ipsum dolor sit amet consectetur.

  • -
  • -
    -
    -
    -
    -
  • -
  • -
    -
    -
    -
    -
  • -
  • -
    -
    -
    -
    -
  • -
  • -
    -
    -
    -
    -
  • - - -
    -

    Server

    -
      -
    • -
      -
      -
      -

      - Lorem ipsum dolor sit amet consectetur. -

      -
      -
    • -
    • -
      -
      -
      -

      - Lorem ipsum dolor sit amet consectetur. -

      -
      -
    • -
    • -
      -
      -
      -

      - Lorem ipsum dolor sit amet consectetur. -

      -
      -
    • -
    • -
      -
      -
      -

      - Lorem ipsum dolor sit amet consectetur. -

      -
      -
    • -
    • -
      -
      -
      -
      -
    • -
    • -
      -
      -
      -
      -
    • -
    • -
      -
      -
      -
      -
    • -
    • -
      -
      -
      -
      -
    • -
    -
    -
  • -
    -
    -
    -

    Authentication

    -
    -
    -
    -
    -
    -
    -

    Client

    -
    • -

      Lorem ipsum dolor sit amet consectetur. @@ -204,322 +74,14 @@

    • -

      Lorem ipsum dolor sit amet consectetur.

    • -
    • -
      -
      -
      -

      - Lorem ipsum dolor sit amet consectetur. -

      -
      -
    • -
    • -
      -
      -
      -

      - Lorem ipsum dolor sit amet consectetur. -

      -
      -
    • -
    • -
      -
      -
      -
      -
    • -
    • -
      -
      -
      -
      -
    • -
    • -
      -
      -
      -
      -
    • -
    • -
      -
      -
      -
      -
    • -
    -
    -
    -

    Server

    -
      -
    • -
      -
      -
      -

      - Lorem ipsum dolor sit amet consectetur. -

      -
      -
    • -
    • -
      -
      -
      -

      - Lorem ipsum dolor sit amet consectetur. -

      -
      -
    • -
    • -
      -
      -
      -

      - Lorem ipsum dolor sit amet consectetur. -

      -
      -
    • -
    • -
      -
      -
      -

      - Lorem ipsum dolor sit amet consectetur. -

      -
      -
    • -
    • -
      -
      -
      -
      -
    • -
    • -
      -
      -
      -
      -
    • -
    • -
      -
      -
      -
      -
    • -
    • -
      -
      -
      -
      -
    • -
    -
    -
    - -
    -
    -
    -

    Databases

    -
    -
    -
    -
    -
    -
    -

    Client

    -
      -
    • -
      -
      -
      -

      - Lorem ipsum dolor sit amet consectetur. -

      -
      -
    • -
    • -
      -
      -
      -

      - Lorem ipsum dolor sit amet consectetur. -

      -
      -
    • -
    • -
      -
      -
      -

      - Lorem ipsum dolor sit amet consectetur. -

      -
      -
    • -
    • -
      -
      -
      -

      - Lorem ipsum dolor sit amet consectetur. -

      -
      -
    • -
    • -
      -
      -
      -
      -
    • -
    • -
      -
      -
      -
      -
    • -
    • -
      -
      -
      -
      -
    • -
    • -
      -
      -
      -
      -
    • -
    -
    -
    -

    Server

    -
      -
    • -
      -
      -
      -

      - Lorem ipsum dolor sit amet consectetur. -

      -
      -
    • -
    • -
      -
      -
      -

      - Lorem ipsum dolor sit amet consectetur. -

      -
      -
    • -
    • -
      -
      -
      -

      - Lorem ipsum dolor sit amet consectetur. -

      -
      -
    • -
    • -
      -
      -
      -

      - Lorem ipsum dolor sit amet consectetur. -

      -
      -
    • -
    • -
      -
      -
      -
      -
    • -
    • -
      -
      -
      -
      -
    • -
    • -
      -
      -
      -
      -
    • -
    • -
      -
      -
      -
      -
    diff --git a/src/routes/docs/tutorials/react/step-1/+page.markdoc b/src/routes/docs/tutorials/react/step-1/+page.markdoc index 3a46e1177d..02a772cef6 100644 --- a/src/routes/docs/tutorials/react/step-1/+page.markdoc +++ b/src/routes/docs/tutorials/react/step-1/+page.markdoc @@ -12,8 +12,6 @@ In this tutorial, you will build Idea Tracker with Appwrite and React. [TODO: Image] -You can follow along with a fresh repo or [clone the project on GitHub](#). - ## Concepts {% #concepts %} This tutorial will introduce the following concepts: @@ -28,4 +26,4 @@ This tutorial will introduce the following concepts: ## Prerequisites {% #prerequisites %} 1. Basic knowledge of JavaScript and React. -2. Have [Node.js](#) and [NPM](#) installed on your computer \ No newline at end of file +2. Have [Node.js](https://nodejs.org/en) and [NPM](https://www.npmjs.com/) installed on your computer \ No newline at end of file diff --git a/src/routes/docs/tutorials/sveltekit/step-1/+page.markdoc b/src/routes/docs/tutorials/sveltekit/step-1/+page.markdoc index 7051ac9c3a..98a10a49a0 100644 --- a/src/routes/docs/tutorials/sveltekit/step-1/+page.markdoc +++ b/src/routes/docs/tutorials/sveltekit/step-1/+page.markdoc @@ -12,8 +12,6 @@ In this tutorial, you will build Idea Tracker with Appwrite and SvelteKit. [TODO: Image] -You can follow along with a fresh repo or [clone the project on GitHub](#). - ## Concepts {% #concepts %} This tutorial will introduce the following concepts: @@ -25,4 +23,4 @@ This tutorial will introduce the following concepts: ## Prerequisites {% #prerequisites %} 1. Basic knowledge of JavaScript and Svelte. -2. Have [Node.js](#) and [NPM](#) installed on your computer \ No newline at end of file +2. Have [Node.js](https://nodejs.org/en) and [NPM](https://www.npmjs.com/) installed on your computer \ No newline at end of file diff --git a/src/routes/docs/tutorials/test/introduction/+page.markdoc b/src/routes/docs/tutorials/test/introduction/+page.markdoc index ba62c0633b..d59b7a9eb4 100644 --- a/src/routes/docs/tutorials/test/introduction/+page.markdoc +++ b/src/routes/docs/tutorials/test/introduction/+page.markdoc @@ -31,7 +31,7 @@ promise.then(function (response) { }); ``` -Passwords are hashed with [Argon2](#), a resilient and secure password hashing algorithm. +Passwords are hashed with [Argon2](https://github.com/P-H-C/phc-winner-argon2), a resilient and secure password hashing algorithm. ## Verification {% #verification %} diff --git a/src/routes/docs/tutorials/vue/step-1/+page.markdoc b/src/routes/docs/tutorials/vue/step-1/+page.markdoc index 2e577d4854..3b6dde83ed 100644 --- a/src/routes/docs/tutorials/vue/step-1/+page.markdoc +++ b/src/routes/docs/tutorials/vue/step-1/+page.markdoc @@ -12,8 +12,6 @@ In this tutorial, you will build Idea Tracker with Appwrite and Vue. [TODO: Image] -You can follow along with a fresh repo or [clone the project on GitHub](#). - ## Concepts {% #concepts %} This tutorial will introduce the following concepts: @@ -28,4 +26,4 @@ This tutorial will introduce the following concepts: ## Prerequisites {% #prerequisites %} 1. Basic knowledge of JavaScript and Vue. -2. Have [Node.js](#) and [NPM](#) installed on your computer \ No newline at end of file +2. Have [Node.js](https://nodejs.org/en) and [NPM](https://www.npmjs.com/) installed on your computer. \ No newline at end of file diff --git a/src/routes/pricing/+page.svelte b/src/routes/pricing/+page.svelte index b988074d7c..6053a37e81 100644 --- a/src/routes/pricing/+page.svelte +++ b/src/routes/pricing/+page.svelte @@ -10,7 +10,6 @@
    @@ -42,11 +41,11 @@ >
    -

    Free

    +

    Starter

    $0
    per user/month

    - For personal passion projects and non-commercial use + For personal passion projects and students.

    Start building @@ -78,14 +77,14 @@
    $15
    per user/month

    - For pro teams and production projects that need to scale + For pro developers and teams that need to scale their products.

    -

    Everything in Free plus:

    +

    Everything in Starter plus:

    • 300GB bandwidth
    • Unlimited projects
    • @@ -124,7 +123,7 @@
      -

      Everything in Free & Pro, plus:

      +

      Everything in Starter & Pro, plus:

      • Extra support log retention days
      • Additional org member roles
      • @@ -164,7 +163,7 @@

        Open-source teams

        - We support OSS companies with a free Pro Plan. Get in touch to find out. + We support OSS maintainers with a free Pro Plan. Get in touch to find out.

        Contact us diff --git a/src/routes/pricing/compare-plans.svelte b/src/routes/pricing/compare-plans.svelte index e6550c753d..cf994be91b 100644 --- a/src/routes/pricing/compare-plans.svelte +++ b/src/routes/pricing/compare-plans.svelte @@ -2,6 +2,7 @@ import { browser } from '$app/environment'; import { Tabs } from '$lib/UI'; import { visible } from '$lib/actions/visible'; + import { isHeaderHidden } from '$lib/layouts/Main.svelte'; import { getScrollDir } from '$lib/utils/getScrollDir'; import { isVisible } from '$lib/utils/isVisible'; import { createAccordion, melt } from '@melt-ui/svelte'; @@ -327,7 +328,7 @@