Walking Appwrite - Starting my Appwrite project
Tags: appwritehack
Published: 2022-04-22 20:07:39

---
title: Walking Appwrite - Starting my Appwrite project
published: true
date: 2022-04-19 00:00:00 UTC
tags: appwritehack 
series: ["SteGriff AppwriteHack"]
canonical_url: https://stegriff.co.uk/upblog/walking-appwrite/
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hzu392fexztoa7f1jvoq.png
---

I saw [this Appwrite hackathon](https://dev.to/devteam/announcing-the-appwrite-hackathon-on-dev-1oc0) on dev.to and I guess I was taken in by the big numbers or the promise of a free t-shirt, but one way or another I thought “I could do that!” and so now I’m doing that.

While developing my current project I realised I could use a tool that lets you manage palettes at scale. A lot of the existing things out there let you work with one palette at a time in a very arty, considered way – I need to create, update, and delete palettes with a broad view. I want to import and export lots of JSON. And export CSS too. So this seemed like an opportunity to build that, and get rewarded at the same time.

It’s called ‘palace’ (palette ace, see).

## Starting up Appwrite

Appwrite is a backend-as-a-service, and it’s delivered as a Docker… crate? Is that what they’re called? I [played with Docker](/upblog/learning-to-use-docker/) one time but I’m not confident with it, plus, I want to create an app that’s Truly Live On The Internet and I’m not gonna go through exposing my local PC and opening firewall holes, etc.

[Appwrite is a one-click app on DigitalOcean](https://marketplace.digitalocean.com/apps/appwrite). So, it seemed like a chance to try out DigitalOcean. I splashed $5 prepayment on a “small droplet” for a month – the hackathon deadline is a month away anyway. Nice.

Suddenly the amount of new information and details to remember was proliferating rapidly, bees circling my head, seeking a place to nest. I put the bees to bed in a tidy new [Kinopio](https://kinopio.club) space (pictured) as it helps me group and organise details and useful links.

![My Appwrite Kinopio planning space](https://stegriff.co.uk/assets/appwrite/appwrite-kinopio.png)

I’ve gotta say the one-click experience on DO was really easy. And after it comes up, you get a big button to take you to your Appwrite dashboard. It gets a public IPv4 address (a rare commodity!) and you can assign a custom domain if you want.

Looking at Appwrite features, I thought the instant account management would be fun to use. Accounts and auth are always a bit of a pain so this seems like a handy feature to leverage.

The thing that struck me right away was “Anonymous Sessions”. I love tools with anonymous sessions! You can just get to trying it without creating an account, and then promote your account into a real one later.

## Frontend

I’m learning Vue3 with the Composition API, `<script setup>`, Typescript, etc. Appwrite provide a useful sample project called [demo-todo-with-vue](https://github.com/appwrite/demo-todo-with-vue/), so I keep the [readme](https://github.com/appwrite/demo-todo-with-vue/) open in one tab and a [GitHub Dev window of the source code](https://github.dev/appwrite/demo-todo-with-vue/blob/main/src/api/index.js) open in another.

The most useful thing here was their `api.js` wrapper around the API. It made it simpler to understand how to use the underlying Appwrite library.

I had some trouble picking a good colour picker, and settled on [vue3-colorpicker](https://aesoper101.github.io/vue3-colorpicker/), but I had to do some CSS hacks to get it to display where I wanted.

Also troublesome was the npm `color` package, which doesn’t play nice with Typescript – fortunately someone made [colord](https://www.npmjs.com/package/colord) to solve this problem.

Lastly, I realised pretty quick I need some global state management. I usually steer away from a redux store unless it’s absolutely necessary, because of all the extra code you have to write. To my pleasant surprise, [pinia](https://pinia.vuejs.org/introduction.html#basic-example) (the replacement for Vuex as of Vue3) is simpler than it’s predecessor, and they’ve completely done away with `Mutations`, which were gross. So I’m really happy. Using it is a breeze! 🎑

![First screenshot of palace](https://stegriff.co.uk/assets/appwrite/palace-1.png)

I have a test instance on Netlify… URL secret for now 🙂

## Progress

So far, I’ve got it to get or create an anonymous session, and I’ve investigated saving data back to Appwrite. I didn’t enjoy Appwrite’s interface for setting up “collection attributes” (database columns) - it is a pretty painful click-and-wait web UI. I can’t imagine architecting a large database with that tool, I guess (hope) there is some kind of bulk interface where you can upload a YAML or something.

I’m not sure whether I want to use the traditional “records” concept for each palette, or whether to store the user’s entire app state into an unstructured document and just sync that. The latter seems easier to acheive because my CRUD operations aren’t as clearly defined as in the trivial todo app sample.

So, I’ve got some technical choices to make and some work to do. But I’m having fun 😄 See you later!