Templates
Appwrite
11min
appwrite is an open source backend server for web and mobile applications that provides a set of apis and tools for developers to easily build and manage their app's backend it includes features such as user authentication, database management, file storage, and more appwrite can be used with various programming languages and frameworks and can be deployed on premises or in the cloud it also offers a user friendly dashboard for managing your app's backend, making it a convenient solution for developers of all levels of experience to build scalable and sophisticated commerce setups with low effort and great developer experience infrastructure ownership the appwrite infrastructure will be provisioned on your own aws account you retain full control over your infrastructure and data while getting all the benefits of infrastructure automation one click deploy click deploy with microtica below and follow the template steps to deploy your appwrite on your aws account what will be provisioned on aws since microtica deploys on your cloud account, you would expect nothing less than complete transparency of what resources are going to be provisioned using the appwrite template, you will create two components in the environment vpc — vpc, subnets and networking eks cluster container infrastructure based on kubernetes, application load balancer and persistent storage built in environment variables below is a list of built in environment variables provided in the appwrite runtime name description required databasepassword password for the mariadb database the same password will be used as a token for the appwrite executor yes custom environment variables to simplify the initial setup, this template sets the default configuration for the appwrite application if you need to customize the configuration and use custom variables like app smtp host, app smtp port (see the full list of environment variables ) you can to that in two ways please note that the appwrite template contains multiple containers, each with its own distinct set of supported environment variables as such, when defining environment variables, it is crucial to ensure that they are specified for the appropriate container configure environment variables from microtica console to configure environment variable from microtica console you need to first define the variables in the schema json file the input properties defined here will become available in the microtica console with this approach you get consistent configuration for the application as well as strong validation rules { "$schema" "http //json schema org/draft 07/schema#", "$id" "schema //microtica/schema json", "title" "application schema", "type" "object", "properties" { "inputs" { "type" "object", "properties" { " app smtp host" { "type" "string", "default" "smtp sendgrid net", "description" "smtp server host name address use an empty string to disable all mail sending from the server the default value for this variable is an empty string" } }, "required" \[] } }, "additionalproperties" false } next, to inject the environment variable in the application container runtime, just reference the variable using the {{env var name}} syntax \# apiversion apps/v1 kind deployment metadata namespace "{{mic namespace}}" name "{{mic name}} appwrite" labels app "{{mic name}} appwrite" microticaservice "{{mic name}}" spec replicas 1 template spec containers \ name "appwrite appwrite" image appwrite/appwrite 1 2 0 env \# reference the environment variable \# during deployment the placeholder will be replaced with the configured value \ name app smtp host value "{{ app smtp host}}" \# \# configure environment variables directly in the kubernetes spec to configure an environment variable directly in the kubernetes spec you need to update the kube config file similar to the previous example, now provide the environment variable value directly in the spec \# apiversion apps/v1 kind deployment metadata namespace "{{mic namespace}}" name "{{mic name}} appwrite" labels app "{{mic name}} appwrite" microticaservice "{{mic name}}" spec replicas 1 template spec containers \ name "appwrite appwrite" image appwrite/appwrite 1 2 0 env \# provide the environment variable value directly in the spec \ name app smtp host value "smtp sendgrid net" \# \# estimated aws cost the estimated cost of the aws cloud depends on the configuration of the appwrite infrastructure below is the cost estimation breakdown assuming the resources are running all the time eks cluster $70/month application load balancer $17/month 2 x t3 large ec2 instances $60/month total cost per month with this minimal configuration is approximately $150/month optimize aws cost to save costs while using appwrite in a non production environment, consider running it from monday to friday, 8 hours per day this schedule can help you achieve at least a 65% reduction in your cloud expenses in the resources or cost dashboard , create a saving schedule to implement these cost saving measures known issues usage stats are not available cannot add alternative custom domains temporary solution add additional ingress resource in microtica/kube config