KikoMart uses two Go cloud functions. You'll find both in the Functions folder of your package:
-
kikomart-v1.0/
- Documentation/
Functions/
- Notification.tar.gz sends push notifications
- Strip.tar.gz handles Stripe payments
Notification function#
Go to Functions → + Create Function → Create Manually.
Set Name to
notification_function.Set Runtime to Go (go-1.26).
Set Entrypoint to
main.go.-
Under Deployment, upload
Notification.tar.gzand click Deploy. -
Open the function's Settings and add these required environment variables. Enter the real values from your own project:
Variable Value APPWRITE_API_ENDPOINTYour API endpoint, e.g. https://fra.cloud.appwrite.io/v1APPWRITE_API_KEYThe API key you created DATABASE_IDThe Database ID of kiko_mart_dbSTORE_ADMIN_TOPIC_IDTopic ID of Store admin topicfrom Messaging → TopicsDELIVERYMAN_TOPIC_IDTopic ID of deliveryman topicfrom Messaging → TopicsPAYMENT_FUNCTION_IDFunction ID of the Stripe payment function PAYMENT_API_SECRETThe same value you set as API_SECRETin the Stripe payment functionSECURITY_ENFORCETurns request security checks on or off ( trueorfalse) -
In Settings → Executions → Scopes, enable these scopes and click Update:
Category Scopes Auth teams.read,teams.write,users.readDatabases rows.read,rows.writeFunctions executions.write -
Under Security, click Add role and select All users so the apps can run the function.
-
Note down the Function ID. The apps use it as
notificationFunctionId.
PAYMENT_FUNCTION_ID and PAYMENT_API_SECRET come from the Stripe payment function below. Create that function first, or come back and fill these two in afterwards.
Stripe payment function#
Only required if you accept online payments with Stripe.
Go to Functions → + Create Function → Create Manually.
Set Function Name to
stripe_payment.Set Runtime to Go (go-1.26).
Set Entrypoint to
main.go.-
Under Deployment, upload
Strip.tar.gzand click Deploy. -
Open the function's Settings and add these required environment variables:
Variable Description STRIPE_SECRET_KEYYour Stripe secret key ( sk_test_…orsk_live_…)API_SECRETA secret string used to secure requests to the function PAYMENT_SUCCESS_URLPage the customer is sent to after a successful payment PAYMENT_CANCEL_URLPage the customer is sent to if the payment is cancelled PAYMENT_MODEPayment mode (test or live) STRIPE_WEBHOOK_SECRETSigning secret of your Stripe webhook ( whsec_…) -
In Settings → Executions → Scopes → Functions, enable
executions.writeand click Update. -
Under Security, click Add role and select All users.
-
Note down the Function ID. The Customer App uses it as
stripePaymentFunctionId.
Use Stripe test keys while developing and switch to live keys only when you go to production.
Your backend is ready. Next, set up the Store App.
