Embedding CTAs as a 16384-byte JSON blob on `insights` was the wrong shape — they're real documents with their own lifecycle. Move them out. Schema: - New platform `ctas` collection. Each row carries `projectInternalId`, `projectId`, `insightInternalId`, `insightId` (backref), plus the CTA fields: `key`, `label`, `service`, `method`, `params`. - Indexes: `(projectInternalId, insightInternalId)` for the subquery lookup and a UNIQUE `(insightInternalId, key)` so the per-insight uniqueness invariant lives at the DB layer (not just in PHP). - The `ctas` field on `insights` becomes a virtual attribute backed by a new `subQueryInsightCTAs` filter that joins child docs at read time. Consumers still get CTAs embedded on the insight response — one round-trip from their perspective. - The CTA descriptor's within-insight identifier renamed `id` → `key` (clashed with the document `$id`). Validator updated. Endpoints: - Manager Create now persists CTAs as separate `ctas` documents after the parent insight, then re-fetches the insight so the response carries the freshly-joined CTA list. - User Update trimmed to user-controlled state only (`severity`, `status`). `title`, `summary`, `payload`, `ctas`, and `analyzedAt` are analyzer-controlled — analyzers re-ingest by deleting and POSTing again to the manager endpoint. - Insight Delete cascades to CTAs. - Report Delete cascades through Insights → CTAs. Response model: - InsightCTA gains the standard document headers (`$id`, `$createdAt`, `$updatedAt`) and an `insightId` backref. The caller-supplied identifier is now `key`. Tests: - E2E sampleCTA factory uses `key` everywhere; testCreate asserts the freshly-created CTA carries `$id`, `$createdAt`, `insightId`, and the right shape. - Dropped the testUpdate*CTA* tests — user Update no longer accepts CTAs. testDismissViaUpdate now depends on testUpdate directly. - Unit tests rewritten to validate `key` instead of `id`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Appwrite
Appwrite is an open-source, all-in-one development platform. Use built-in backend infrastructure and web hosting, all from a single place.English | 简体中文
Appwrite is an open-source development platform for building web, mobile, and AI applications. It brings together backend infrastructure and web hosting in one place, so teams can build, ship, and scale without stitching together a fragmented stack. Appwrite is available as a managed cloud platform and can also be self-hosted on infrastructure you control.
With Appwrite, you can add authentication, databases, storage, functions, messaging, realtime capabilities, and integrated web app hosting through Sites. It is designed to reduce the repetitive backend work required to launch modern products while giving developers secure primitives and flexible APIs to build production-ready applications faster.
Find out more at https://appwrite.io.
Table of Contents:
- Products
- Installation & Setup
- Self-Hosting
- One-Click Setups
- Getting Started
- Architecture
- Contributing
- Security
- Follow Us
- License
Products
-
Appwrite Auth - Secure user authentication with multiple login methods including email/password, SMS, OAuth, anonymous sessions, and magic links. Includes session management, multi-factor authentication, and user verification flows.
-
Appwrite Databases - Scalable structured data storage with support for databases, tables, and rows. Includes querying, pagination, indexing, and relationships to model complex application data.
-
Appwrite Storage - Secure file storage with support for uploads, downloads, encryption, compression, and file transformations for media and assets.
-
Appwrite Functions - Serverless compute platform to run custom backend logic in isolated runtimes, triggered by events or scheduled jobs.15 runtimes supported.
-
Appwrite Messaging - Multi-channel messaging system for sending emails, SMS, and push notifications to users for engagement, alerts, and transactional workflows.
-
Appwrite Sites - Integrated hosting platform to deploy and scale web applications with support for custom domains, SSR, and seamless backend integration. Git integration and previews are supported.
Installation & Setup
The easiest way to get started with Appwrite is by signing up for Appwrite Cloud. While Appwrite Cloud is in public beta, you can build with Appwrite completely free, and we won't collect your credit card information.
Self-Hosting
Appwrite is designed to run in a containerized environment. Running your server is as easy as running one command from your terminal. You can either run Appwrite on your localhost using docker-compose or on any other container orchestration tool, such as Kubernetes, Docker Swarm, or Rancher.
Before running the installation command, make sure you have Docker installed on your machine:
Unix
docker run -it --rm \
--publish 20080:20080 \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
--entrypoint="install" \
appwrite/appwrite:1.9.0
Windows
CMD
docker run -it --rm ^
--publish 20080:20080 ^
--volume //var/run/docker.sock:/var/run/docker.sock ^
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
--entrypoint="install" ^
appwrite/appwrite:1.9.0
PowerShell
docker run -it --rm `
--publish 20080:20080 `
--volume /var/run/docker.sock:/var/run/docker.sock `
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw `
--entrypoint="install" `
appwrite/appwrite:1.9.0
Once the Docker installation is complete, go to http://localhost to access the Appwrite console from your browser. Please note that on non-Linux native hosts, the server might take a few minutes to start after completing the installation.
For advanced production and custom installation, check out our Docker environment variables docs. You can also use our public docker-compose.yml and .env files to manually set up an environment.
Upgrade from an Older Version
If you are upgrading your Appwrite server from an older version, you should use the Appwrite migration tool once your setup is completed. For more information regarding this, check out the Installation Docs.
One-Click Setups
In addition to running Appwrite locally, you can also launch Appwrite using a pre-configured setup. This allows you to get up and running quickly with Appwrite without installing Docker on your local machine.
Choose from one of the providers below:
|
DigitalOcean |
Akamai Compute |
AWS Marketplace |
Getting Started
Getting started with Appwrite is as easy as creating a new project, choosing your platform, and integrating its SDK into your code. You can easily get started with your platform of choice by reading one of our Getting Started tutorials.
SDKs
Below is a list of currently supported platforms and languages. If you would like to help us add support to your platform of choice, you can go over to our SDK Generator project and view our contribution guide.
Client
- ✅ Web
- ✅ Flutter
- ✅ Apple
- ✅ Android
- ✅ React Native
Server
Looking for more SDKs? - Help us by contributing a pull request to our SDK Generator!
Architecture
Appwrite uses a microservices architecture that was designed for easy scaling and delegation of responsibilities. In addition, Appwrite supports multiple APIs, such as REST, WebSocket, and GraphQL to allow you to interact with your resources by leveraging your existing knowledge and protocols of choice.
The Appwrite API layer was designed to be extremely fast by leveraging in-memory caching and delegating any heavy-lifting tasks to the Appwrite background workers. The background workers also allow you to precisely control your compute capacity and costs using a message queue to handle the load. You can learn more about our architecture in the contribution guide.
Contributing
All code contributions, including those of people having commit access, must go through a pull request and be approved by a core developer before being merged. This is to ensure a proper review of all the code.
We truly ❤️ pull requests! If you wish to help, you can learn more about how you can contribute to this project in the contribution guide.
Security
For security issues, kindly email us at security@appwrite.io instead of posting a public issue on GitHub.
Follow Us
Join our growing community around the world! Check out our official Blog. Follow us on X, LinkedIn, Dev Community or join our live Discord server for more help, ideas, and discussions.
License
This repository is available under the BSD 3-Clause License.