DEV Community

Abdulbasid Guled
Abdulbasid Guled

Posted on

Appwrite: Get it cause we write Apps

Let's pretend that today's my birthday and completely ignore what I did today to focus on an intriguing framework I came across recently, Appwrite. It's suppose to be an alternative to Supabase as another open source framework to setup a secure backend for you. It includes all the usual stuff such as:

  • Database
  • Authentication
  • Storage
  • Serverless functions
  • Security

It even includes the ability to get GEO related user data, something I've been wanting to work with for some time.

Having worked with Supabase on personal stuff, and not getting to work with JS recently as my internship mainly uses Java, this really caught my eye. You can read more about Appwrite here but I want to focus on the simplicity of getting it setup and using it.

The service is self-hosted, something we can take advantage of using Docker (which I recommend any developer learn even if you won't ever use it, it's an amazing tool) and as for setting it up to run, even easier. Here's the example code shown on their site:

// Init your Web SDK
const client = new Client();
client
    .setEndpoint('http://localhost/v1')
    .setProject('455x34dfkj')

// Register User
const account = new Account(client);
account.create('unique()', 'me@example.com', 'password', 'Jane Doe')
        .then(response => {
            console.log(response);
        }, error => {
            console.log(error);
        });
Enter fullscreen mode Exit fullscreen mode

As you can see, we just setup the client object, then we can do whatever we want. Whether it's creating a new account, a new session, or even a new JWT token, it's all done here. It even can connect with your preferred oAuth of your choice which is amazing.
Their README and documentation is amazing by the way. See what I mean here

While geared mainly to mobile developers (Flutter specifically targeted), any web developer can also taken advantage of Appwrite to create a secure backend for their purposes. Really makes it an easy decision to focus on the frontend. Now, services like this and Supabase are generally made with the intention of hiding the complexity of creating a backend service so you miss out on learning exactly how web servers are made. If you know how they're generally operated however, this service enhances that developer experience tenfolds. I plan on trying this out on a future project whenever I get the motivation to get back into web development. In the meantime, give it a try. You won't be disappointed.

Top comments (0)