Appwrite credentials#
Open lib/config/appwrite_config.dart (in some versions lib/app/appwrite/appwrite_config.dart) and fill in the values you noted while setting up the backend:
static const String apiEndpoint = 'https://fra.cloud.appwrite.io/v1';
static const String projectId = 'YOUR_PROJECT_ID';
static const String databaseId = 'YOUR_DATABASE_ID';
static const String apiKey = 'YOUR_APPWRITE_API_KEY';
static const String postsBucketId = 'images';
static const String messagingProviderId = 'YOUR_FCM_PROVIDER_ID';
static const String notificationFunctionId = 'YOUR_NOTIFICATION_FUNCTION_ID';
static const String broadCastTopicId = 'YOUR_BROADCAST_TOPIC_ID';
static const String storeAdminTopicId = 'YOUR_STORE_ADMIN_TOPIC_ID';
| Constant | Where to find it |
|---|---|
apiEndpoint, projectId |
Project settings |
databaseId | Databases → kiko_mart_db |
apiKey |
API key you created |
postsBucketId |
ID of the
images bucket
|
messagingProviderId |
Messaging → Providers → Notification Sender |
notificationFunctionId |
Functions → notification_function |
broadCastTopicId, storeAdminTopicId |
Messaging → Topics |
Don't leave any value empty or as a placeholder. Missing values cause a Null cast error when the app starts.
Automated database seeding#
The seeding script creates all database tables, columns and indexes, plus your first Store Admin account.
Open a terminal in the Store App root folder.
-
Run the seeding script:
dart lib/scripts/seed_database.dart -
When prompted, enter the Store Admin email (e.g.
admin@store.com) and password (at least 8 characters). Wait for the script to finish. Use these credentials to log in to the Store App.
Run the seeding script once, before setting up the Customer and Delivery apps. They depend on the tables it creates.
Register the app in Appwrite#
- In your Appwrite project, go to Apps → + Add app.
- Choose Flutter as the platform and Android as the target, then click Continue.
- Enter a name, e.g.
KikoMart Store. - Enter the package name you set in the app, e.g.
com.yourcompany.kiko_mart_store. - Click Done.
Follow the same steps as for Android, but choose iOS as the target and enter your iOS bundle identifier.
Next, set up maps for the Store App.
