Beginner Guide to Appwrite

Samson Adesanoye
5 min readFeb 7, 2023

Are you a web or mobile developer? Are you intending to build API for your application? Appwrite is the answer for you. Appwrite is a self-hosted backend-as-a-service platform that provides developers with all the core APIs required to build any application quickly and securely.

Appwrite website : https://appwrite.io/

Appwrite provides you with a set of APIs, tools, and a management console UI to help you build your apps much faster and more securely. Appwrite can run anywhere because it is packaged as a Docker container which you can easily set up using a simple docker compose command from your terminal.

Prerequisites

Installation

Appwrite can be installed by copying and pasting any of the commands below into your operating system 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:1.0.3

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:1.0.3

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:1.0.3

Installation begins with a few prompts to configure Appwrite on your device.

Prompt 1:

Choose your server HTTP port: (default: 80). If your server’s port 80 is free, press “enter” to add the default port. Else, choose a different port, e.g 5000

Prompt 2:

Choose your server HTTPS port: (default: 443). If your server’s port 443 is free, press “enter” to add the default port. Else, choose a different port, e.g., 445

Prompt 3:

Choose a secret API key (default: ‘your-secret-key’). Whatever secret key you choose, make sure you backup it up securely.

Prompt 4:

Enter your Appwrite hostname (default: ‘localhost/IP Address’). In this case, if you have a domain, e.g., appwritetestinstance.com, input it. If not, press “enter” to use the server IP Address.

Prompt 5:

Enter a DNS A record hostname to serve as a CNAME for your custom domains. You can use the same input as your Appwrite hostname with default as the server IP Address.

The installation process will create a docker-compose.yml file with the Appwrite stack and start your backend server. Once done, check your server instance is up by accessing the Appwrite in your browser at http://[your-hostname:your-port]/ e.g http://localhost:80

http://localhost:80

Register on Appwrite as a beginner using http://[your-hostname:your-port]/signup e.g http://localhost:80/auth/signup

Appwrite services

Appwrite Services

Databases: Store, query and manage access control to your app documents

Appwrite Databases

Auth & Users: Authenticate, confirm and manage users using multiple signin methods.

Appwrite Authentication

Storage: Upload, download and preview your app and users files.

Appwrite Storage

Functions: Run your backend code in a secure and isolated environment to customize your app.

Appwrite Functions

GEO & Localization: Detect your users location, locale and fetch GEO related data.

Console: Track your backend API usage and manage your project resources from a modern UI

Privacy: Own your data. Easily setup Appwrite self-hosted solution on your infrastructure

Security: End-to-end security for your backend APIs both in transit and at rest.

Database

Appwrite Database Service

Appwrite Database Service allows you to store your application and users’ data with ease of fetching it using different supported queries. It allows the creation of multiple databases that can be organized into collections and documents.

Appwrite Database Service contains documents. Each document contains collections. The terms collections and documents are used because the Appwrite JSON REST API resembles the API of a traditional NoSQL database.

Appwrite Database enforces your data structures and validation rules for each document in your collection. It enables access control over each document.

How to create a database on Appwrite

Before you can create a database, you ought to create a project first.

  1. Visit your Appwrite console, http://[your-hostname:your-port]/console e.g http://localhost:80/console and click on Create Project button.

2. Type a project name and click the Create button to create a new project.

3. Click Database in the sidebar menu.

4. Click Add Database and fill in the database name in the popup modal. You will be navigated to the new database created.

5. As mentioned earlier, Appwrite database is made up of collections and documents. A collection in SQL is called a table. To create a collection in Appwrite click Add Collection. Enter the collection name in the popup modal. You have successfully created a database.

6. Documents are data for the collection. Attributes are column names for the collection.

Why Appwrite

  • Easily Integrate with Web, Flutter, Apple, Android, Severs and Command Line.
  • Better Documentation for everything.
  • Cross Platform
  • Its self host
  • It open source
  • Backend Console UI

Appwrite vs Competitors

Firebase vs Supabase vs Appwrite

Conclusion

Congratulations on knowing about Firebase alternative, now you can join the discord channel, star the repository, and check out the documentation for more.

Resources:

--

--