DEV Community

Taweechai Maklay
Taweechai Maklay

Posted on

Appwrite secure open-source backend server for Flutter example app

Appwrite is an opensource backend that can use as web and mobile backend since it's already packed with developer must-use features e.g. account, database, object store which enough to develop an application for these days.

The first step installs the Appwrite backend ...

docker run -it --rm \
    --volume /var/run/docker.sock:/var/run/docker.sock \
    --volume "$(pwd)"/appwrite:/install/appwrite:rw \
    -e version=0.6.1 \
    appwrite/install 

After docker running, open the Appwrite url http://localhost .

Alt Text

Signup user for console access(need to restrict when using in production).
Alt Text

Login to admin console for backend management http://localhost/console .
Alt Text

Since Appwrite supported multiple projects so we create one for our testing.
Alt Text

Then we can access to project's console
Alt Text

Next, we will enable the project's mobile SDK, this example will use Flutter for example.
Alt Text

Add more app's package information.
Alt Text

Create new user for our example app testing (I've created the user with user: test01@test.com and password: 123456).
Alt Text

After added project and SDK information, we will create a database.
Alt Text

Add new database field's rule. This example model the data for note application.
Alt Text

An important part of the database is the collection's permission setting. This example will use '*' for 'read access' and leave 'write access' as empty to grant only collection's owner to update the collection's rule for example.
Alt Text

Next for the example application, I've pushed source code to github if you need to see source code.

GitHub logo netfirms / appnote

example flutter app with Appwrite backend

appwrite_example

Appwrite and Flutter example application project.

Getting Started

####Please install Appwrite backend and config app's url in 'app_state.dart' before run

####Android will use http://10.0.2.2/v1 as proxy to access to Appwrite from Android emulator

docker run -it --rm \
    --volume /var/run/docker.sock:/var/run/docker.sock \
    --volume "$(pwd)"/appwrite:/install/appwrite:rw \
    -e version=0.6.1 \
    appwrite/install

####For more information about Appwrite installation and Flutter SDK usage can follow links below

https://appwrite.io/docs/installation https://appwrite.io/docs/getting-started-for-flutter

For Flutter, first, add Appwrite flutter package to project with official Appwrite document

The example application will have 4 functions

  • Login
  • List note
  • Create note
  • Edit note
  • Delete note

To play around with app, you login with user you created in admin console.
Alt Text

Once login completed you will see app page with blank note.
Alt Text

So let create one for example.
Alt Text

After added note's list state will be reloaded (since we use provider state management).
Alt Text

Then we checked in our Appwrite's database we can see the new note's data was added.
Alt Text

This Flutter app is just an example to show how easy that mobile and web developers. can take advantage of Appwrite and able to save more backend development time and paying more to the business and innovation.

More information about Appwrite available at https://appwrite.io/

Top comments (0)