Don't Re-Invent The Wheel, Use Appwrite

Joel Olawanle - Sep 6 '22 - - Dev Community

When attempting to build a solution on the internet using any technology, it is the wisest and best advice to look for resources available to you. This eliminates the stress of creating a solution from scratch for a feature that should only require a few lines of code to integrate.

On the internet today, many groups of individuals, companies, and programmers are developing specific solutions, products, packages, and libraries to assist in the resolution of a specific problem. These solutions are designed to be easily added/integrated into your projects and used without struggling with the logic of how things work in your projects.

For example, many people struggle with implementing authentication within applications. Some companies and individuals took it upon themselves to create packages and solutions that anyone can easily integrate into their projects. You no longer have to worry about database security, data loss, and other issues.

In this article, you'll learn about Appwrite, what it does, how it can help you handle the heavy lifting for your projects, and why you should use it instead of building solutions from scratch.

What is Appwrite?

Appwrite is an open-source, end-to-end back-end server used by developers (mainly front-end and mobile developers) to build applications and web applications much faster by providing you with a set of APIs, tools, and a management console UI. It has over 24 thousand stars on GitHub and an active community of open-source contributors.

Appwrite is cross-platform and technology-agnostic, meaning it can run on any operating system, coding language, framework, or platform. You can use it with web technologies like JavaScript and its frameworks like React, Angular, and mobile technologies like Flutter, Android, Apple, and even servers.

The major goal of Appwrite is to reduce the complexity of performing certain tasks, implementing certain features, and in general, building a modern, advanced and fast application. You no longer need to re-invent the wheel; you can now use Appwrite easily.

Why use Appwrite?

Appwrite helps you save development time and allows you to focus on the major problem you are attempting to solve or build. Appwrite offers the following services making it easy to implement certain features without having to re-invent them:

Databases
You can use the Appwrite database service with whatever client application (web or native). It allows you to create a structured collection of documents to manage, apply advanced queries, filter and set read and write access permissions for a specific user or team, or even grant it public access (role:all).

The databases service accepts as many databases as you want, with each database containing as many collections as you want. These databases allow you to choose how you want to structure your database, the type of data, validation rules for each document in your database, and more. The structure of your documents is based on the collection attributes you define; which helps ensure all user-submitted data/document is validated and stored according to the collection structure.

Note: All data returned by the Databases service are represented as structured JSON documents.

Account and Authentication
The account and authentication service saves a lot of time, making it easy to create accounts, implement authentication, and log in even with third-party OAuth providers such as Facebook, GitHub, LinkedIn, and more.

The account service can also allow you to update user information, retrieve the user sessions (including information about the session location, device, operating system, and user agent) across different devices, and save user preferences like their UI language, timezone, or favorite theme. It also lets you fetch the user's security logs with their recent activity and other security-sensitive events.

Storage
The Appwrite storage service also makes it easy for your users to upload and manage files securely with read and write permission roles. This storage service offers a built-in integration with an auto-updated antivirus server whereby all uploaded files are scanned and validated to ensure the safety of your users and application.

The files are managed using buckets (similar to collections you have in your databases service). These buckets provide more power to decide what kinds of files, what sizes you want to allow in that bucket, whether to encrypt the files, scan with antivirus, and more.

The storage service also has a preview endpoint that allows you to generate preview images for your files. This preview endpoint allows you to manipulate the resulting image in terms of dimensions, file size, and style to fit perfectly inside your app. Using the preview endpoint, you can also change the resulting image file format for better compression or image quality for better network delivery.

Functions
Even with all the services that Appwrite provides, it also makes it easy for you to create custom behaviors in response to any predefined schedule or Appwrite system events like account creation, user login, or document update.

Appwrite functions run in a secure, isolated Docker container. You can easily create yours by following the Appwrite detailed documentation guide that covers the entire writing process to deploy your functions and lots more.

Localization
Localization has to do with displaying content based on specific locations of the user. It is a core feature that has to be implemented for your application to be used beyond your locality. For example, if a user is in a French-speaking country, you would like the content of your website to appear to that user in French, and the same applies to other languages.

The locale service allows you to display content based on your user's location, which is gotten via the user's location. It supports multiple locales and makes it possible for us to switch locales. This service also gives you access to your users' statistics, such as their IP address, countries, continents, phone codes, currencies, etc. You can learn how localization works with Appwrite in the localization documentation.

Teams
Appwrite teams service allows you to group users and share read and write permissions for them to access specific project resources like database documents or/and storage files. This makes it easy to implement access control for your application's resources.

How to get started with Appwrite

The Appwrite server is packaged as a Docker container, which you can easily set up on your local machine or any cloud provider of your choice with a simple docker-compose command from your terminal:

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.15.3
Enter fullscreen mode Exit fullscreen mode

Appwrite can be used to build all forms of applications, such as a todo application with React and lots more. You can check out more demos here.

Conclusion

In this article, you have learned what Appwrite is all about and why you should use Appwrite rather than coding from scratch. You can learn how to integrate Appwrite into all your platforms using the following quick start tutorials:

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .