Appwrite is an open-source, self-hosted Backend-as-a-Service that makes app development easier with a suite of SDKs and APIs to accelerate app development. #30DaysOfAppwrite is a month-long event focused on giving developers a walkthrough of all of Appwrite's features, starting from the basics to more advanced features like Cloud Functions! Alongside we will also be building a fully-featured Medium Clone to demonstrate how these concepts can be applied when building a real-world app. We also have some exciting prizes for developers who follow along with us!
Welcome to Day 4 👋. It's time to finally take a look at Appwrite's shiny dashboard and look at all of Appwrite's features. This will only be a high-level overview as we will be going through each section in detail in our later tutorials.
After logging into your Appwrite console, you will be greeted with a getting started page. This is where you can create your first project.
Once you create a new project or select a project, you will be taken to the project home page 😊.
On the home page, you will be greeted with some pretty graphs that highlight your project's usage stats. Here you can find the total number of requests that Appwrite has handled, the total bandwidth consumed, the total number of documents in your collections, the total number of users in your project, and more.
Below this, you will find the Platforms section. This is where you can add a Web or Flutter project to Appwrite ( Stay tuned for more platforms coming soon 🤩 ). Adding a Platform is important because it tells Appwrite about trusted domains and restricts requests coming in from domains that are not listed here. This also fixes those nasty CORS issues 😏.
Let's start with the first item on the sidebar, Database.
Once you create a collection, you can then click on it to configure it further. Under the Settings tab, you will find the options to change the collection name, add rules to your collection, change the read and write permissions for your collection, delete your collection, etc. We will cover these concepts in detail in the upcoming days. For now, you just need to know where to find them.
Think of a rule as a column in a relational database. Click the Add Rule button and you can create your first rule. You can give your rule (ahem.. column) a name, and give it a type.
The interesting rule here is the Document rule type. The Document rule type allows your collection to have nested documents from other collections.
The second option in the sidebar is Storage. This is where you can manage all the files uploaded to your server. You can upload files using the '+' button at the bottom right. This dialog also allows you to set read and write permissions for your file.
You can definitely use an SDK to upload your files. This is just the console way of doing it.
This is also where you can create and manage teams and enable OAuth providers. We have a total of 24 different OAuth providers(!), most of which was contributed by the community. So, if there is still a provider that we are missing, feel free to take a look at how you can help add a new OAuth Provider.
The fourth option on the sidebar is Cloud Functions - one of Appwrite's most powerful features! As the name suggests, Cloud Functions allows you and your users to execute serverless functions. As of writing this tutorial, we support 13 different environments for languages, including Node, PHP, Python, Ruby, Deno, Dart, and .NET. You can find more information about Cloud Functions here
Once you create a function, you can configure much of its behavior. You can add new code versions of your functions, which we refer to as a tag. Each tag gets its own ID and exclusive container for executing its code.
Under the Monitors section, you will find visualizations that highlight executions, CPU utilization, and failures.
Under the Logs section, you will find execution logs for each execution of the function.
Finally, under the Settings section, you can set permissions for executing your function or set up CRON schedules for triggering the function. You can also set up listeners to execute functions triggered by system events. System Events are emitted when certain actions take place on the server like the creation of a user, creation of a collection, document, etc., which can be used to trigger your cloud function. An example use-case: you would like to send a welcome email when a user signs up with your app. We have covered this usecase in-depth and more, over at dev.to.
Finally, in the Settings section of your Cloud Function, you can also add environment variables that this function may require. This could include API keys for third-party APIs that you may be using.
The next option in the sidebar is Tasks. Tasks can be thought of as a precursor to Cloud Functions. Instead of running your functions on the Appwrite server, Tasks allows you to schedule HTTP requests to any external endpoint that you may have. This could be some of your other backend servers where you may have some additional business logic setup.
The next item on our list is Webhooks. Webhooks allow you to hit 3rd party endpoints when server events take place inside Appwrite. They are similar to tasks in that they can be used to hit external HTTP endpoints, but they are triggered differently from tasks (which use a CRON schedule).
The next section on our list is API Keys. API Keys are required to interact with Appwrite from a Server SDK. Each API key is scoped to restrict access to only the selected features and prevent misuse. To create an API Key, simply select Add API Key, select the required scopes, give your key a name and click Create. You can now use this API key in your Server Side Integration.
The Settings tab is where you will find the options to manage your project. You will find options to invite members to your project, set up custom domains, change the project name, delete the project, etc.
Feel free to reach out to us on Discord if you would like to learn more about Appwrite, Aliens, or Unicorns 🦄. Stay tuned for tomorrow's article! Until then 👋