What is Appwrite and How to use it Efficiently

noviicee

Anamika

Posted on October 2, 2021

What is Appwrite and How to use it Efficiently

What is Appwrite

Going by it's official web-page, Appwrite is a self-hosted solution that provides developers with a set of easy-to-use and integrate REST APIs to manage their core backend needs.
Basically, it is a new open-source, end-to-end, back end server for front-end and mobile developers that allows to build apps much faster. Its main goal is to abstract and simplify common development tasks behind REST APIs and tools, helping developers build advanced apps faster.

appwrite

Where can it be used

how-t-use-it

As we already saw, Appwrite is a self-hosted backend as a service. It is packaged as a set of Docker micro-services. It makes it easier to build applications without writing any backend code. But this is not just the only way to use it. Basically if we go by Appwrite's official documentation, Appwrite wasn’t designed to replace the backend team, but to provide a better starting point for your project and a better developer experience.

There a many ways to use Appwrite- Appwrite for Web, Appwrite for Flutter, Appwrite for Android, Appwrite for Server etc. You can find many tutorials, videos, demonstrations, source codes, etc to get started with these applications over here.
So go ahead and make great use of them!

Getting Started

The very first step to get started with Appwrite is to install it.
Since, Appwrite is packaged as a set of Docker containers, it can be installed and run on any operating system that can run a Docker CLI. You can either use Appwrite on your local desktop or on a cloud provider. Its your choice :D

System Requirements
The tiny requirements to install Appwrite is- a little 1 CPU core and 2GB of RAM, and an operating system that supports Docker.

Install with Docker

install-with-docker

The easiest way to start running your Appwrite server is by running Docker installer tool from the terminal.

  • Unix


docker run -it --rm \
    --volume /var/run/docker.sock:/var/run/docker.sock \
    --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
    --entrypoint="install" \
    appwrite/appwrite:0.10.4


Enter fullscreen mode Exit fullscreen mode
  • Windows

Make sure to enable Hyper-V and Containers Windows features in order to run Appwrite on Windows with Docker.

We can either use the CMD or PowerShell on Windows for the purpose of running commands, in order to proceed with the installation process.

  1. Windows CMD


docker run -it --rm ^
    --volume //var/run/docker.sock:/var/run/docker.sock ^
    --volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
    --entrypoint="install" ^
    appwrite/appwrite:0.10.4


Enter fullscreen mode Exit fullscreen mode
  1. Windows PowerShell


docker run -it --rm ,
    --volume /var/run/docker.sock:/var/run/docker.sock ,
    --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ,
    --entrypoint="install" ,
    appwrite/appwrite:0.10.4


Enter fullscreen mode Exit fullscreen mode

(Note that I have used the latest version of Appwrite in the installation commands)
Know more about installation here

How to use it efficiently

who-can-benefit

How to take Advantage of the Appwrite API Without Using Any SDK

As developers, sometimes, we might not want to use the Appwrite SDK, but to directly use Appwrite’s plain HTTP API to integrate our application.

Step- 1: Client Authentication
If you are integrating from a new client platform, you just need to pass the project ID. This can be done by attaching your request the 'X-Appwrite-Project' header like this:


 -XGET -H 'X-Appwrite-Project: [MY-PROJECT-ID]' -H "Content-type: application/json" 'https://appwrite.io/v1/locale'

Enter fullscreen mode Exit fullscreen mode

Step-2: Server Authentication
The server authentication provides more scope permissions than by default. For this step, we need to pass our API key. API keys can be generated from the Appwrite dashboard and, permissions for the applications can also be chosen from here.

We need to pass the API Key with Appwrite’s 'X-Appwrite-Key' header as follows:


 -XGET -H 'X-Appwrite-Project: [MY-PROJECT-ID]' -H 'X-Appwrite-Key: [MY-API-KEY]' -H "Content-type: application/json" 'https://appwrite.io/v1/users'

Enter fullscreen mode Exit fullscreen mode

One can also set an Appwrite header to change the API locale. The Appwrite API has support for 46 different locales, and this number is constantly growing.
You can use the locale service to get different responses from the Appwrite’s Locale API, or even in case if you want any sort of emails sent to your users in a different language from the default English.

Final Step: Start Sending API Calls
After authenticating and changing your Appwrite server locale, you can start sending requests to any of the Appwrite API’s.

Advantages and Features

perks

  1. Anonymous Login and JWT 🔐
    You are right! Not every app needs users to create an account right away. Appwrite is one of such apps.
    Appwrite provides the features of Anonymous Login, which helps to save sessions without asking for email addresses. Later those users can be converted to registered accounts easily.
    Know more about it here

  2. ARM Support
    A dynamic arm support is an assistive technology product which helps people with limited arm and shoulder function, to move their arms and hands freely (again), and therefore make it possible to conduct all kinds of daily activities.
    Starting with 0.8, install Appwrite on your favorite 64-bit ARM device, from Amazon Graviton2 down to the Raspberry Pi 4! ARM support also contributes in making Appwrite technology agnostic.

  3. Slimmer and Faster
    The recent versions of Appwrite have includes SMTP server rather than the ClamAV server for development. These changes, have helped reduce the minimum requirements to just 1GB of RAM.

but-wait-there-s-more

Apart from these, there are many more advantages of using Appwrite. Some of them are:

  • Fast and Secure
  • Manage Access control
  • File Previews
  • Image Manipulations
  • Authenticate, Confirm and Manage your Users
  • Multiple Signin Methods
  • Auto-Generated SSL
  • Built-in Files and Secrets Encryption
  • Built-in Anti-Virus scanner
  • Webhooks
  • Background Tasks
  • Open-Source
  • Self-Hosted
  • Privacy
  • Cross-Platform
  • Flutter Support
  • Audit Logging
  • Input Validation
  • Abuse Protection
  • HTTP\2 Support

Next Steps

You can join the Appwrite Community on Discord. It can help newcomers clear more doubts, provide them with constant support, or just simply chat about Appwrite.
You can also check the Github Repositories here. These can help you find lots of resources about Appwrite, including text, video tutorials and many demo applications.
Don't forget to check the Official Documentation for Appwrite here.

Happy Appwriting ❤️

party

💖 💪 🙅 🚩
noviicee
Anamika

Posted on October 2, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related