Skip to content

Canvix — Free & open-source graphic design tool. A community-built Canva alternative with a drag-and-drop editor, templates, shapes, text, images & one-click export. Works on desktop, tablet & mobile.

docs(grants): the trust layer — SECURITY, GOVERNANCE, CONDUCT, funding.json

Ashiq Hussain Mirfe247531f0ac
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 0000000..fbb0681
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,132 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+We as members, contributors, and leaders pledge to make participation in our
+community a harassment-free experience for everyone, regardless of age, body
+size, visible or invisible disability, ethnicity, sex characteristics, gender
+identity and expression, level of experience, education, socio-economic status,
+nationality, personal appearance, race, caste, color, religion, or sexual
+identity and orientation.
+
+We pledge to act and interact in ways that contribute to an open, welcoming,
+diverse, inclusive, and healthy community.
+
+## Our Standards
+
+Examples of behavior that contributes to a positive environment for our
+community include:
+
+* Demonstrating empathy and kindness toward other people
+* Being respectful of differing opinions, viewpoints, and experiences
+* Giving and gracefully accepting constructive feedback
+* Accepting responsibility and apologizing to those affected by our mistakes,
+ and learning from the experience
+* Focusing on what is best not just for us as individuals, but for the overall
+ community
+
+Examples of unacceptable behavior include:
+
+* The use of sexualized language or imagery, and sexual attention or advances
+ of any kind
+* Trolling, insulting or derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or email address,
+ without their explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+ professional setting
+
+## Enforcement Responsibilities
+
+Community leaders are responsible for clarifying and enforcing our standards of
+acceptable behavior and will take appropriate and fair corrective action in
+response to any behavior that they deem inappropriate, threatening, offensive,
+or harmful.
+
+Community leaders have the right and responsibility to remove, edit, or reject
+comments, commits, code, wiki edits, issues, and other contributions that are
+not aligned to this Code of Conduct, and will communicate reasons for moderation
+decisions when appropriate.
+
+## Scope
+
+This Code of Conduct applies within all community spaces, and also applies when
+an individual is officially representing the community in public spaces.
+Examples of representing our community include using an official e-mail address,
+posting via an official social media account, or acting as an appointed
+representative at an online or offline event.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported to the community leader responsible for enforcement at
+All complaints will be reviewed and investigated promptly and fairly.
+
+All community leaders are obligated to respect the privacy and security of the
+reporter of any incident.
+
+## Enforcement Guidelines
+
+Community leaders will follow these Community Impact Guidelines in determining
+the consequences for any action they deem in violation of this Code of Conduct:
+
+### 1. Correction
+
+**Community Impact**: Use of inappropriate language or other behavior deemed
+unprofessional or unwelcome in the community.
+
+**Consequence**: A private, written warning from community leaders, providing
+clarity around the nature of the violation and an explanation of why the
+behavior was inappropriate. A public apology may be requested.
+
+### 2. Warning
+
+**Community Impact**: A violation through a single incident or series of
+actions.
+
+**Consequence**: A warning with consequences for continued behavior. No
+interaction with the people involved, including unsolicited interaction with
+those enforcing the Code of Conduct, for a specified period of time. This
+includes avoiding interactions in community spaces as well as external channels
+like social media. Violating these terms may lead to a temporary or permanent
+ban.
+
+### 3. Temporary Ban
+
+**Community Impact**: A serious violation of community standards, including
+sustained inappropriate behavior.
+
+**Consequence**: A temporary ban from any sort of interaction or public
+communication with the community for a specified period of time. No public or
+private interaction with the people involved, including unsolicited interaction
+with those enforcing the Code of Conduct, is allowed during this period.
+Violating these terms may lead to a permanent ban.
+
+### 4. Permanent Ban
+
+**Community Impact**: Demonstrating a pattern of violation of community
+standards, including sustained inappropriate behavior, harassment of an
+individual, or aggression toward or disparagement of classes of individuals.
+
+**Consequence**: A permanent ban from any sort of public interaction within
+the community.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage],
+version 2.1, available at
+[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
+
+Community Impact Guidelines were inspired by
+[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
+
+For answers to common questions about this code of conduct, see the FAQ at
+[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
+[https://www.contributor-covenant.org/translations][translations].
+
+[homepage]: https://www.contributor-covenant.org
+[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
+[Mozilla CoC]: https://github.com/mozilla/diversity
+[FAQ]: https://www.contributor-covenant.org/faq
+[translations]: https://www.contributor-covenant.org/translations
diff --git a/GOVERNANCE.md b/GOVERNANCE.md
new file mode 100644
index 0000000..2a971de
--- /dev/null
+++ b/GOVERNANCE.md
@@ -0,0 +1,77 @@
+# Governance
+
+## The model, in one line
+
+Canvix is a **solo-maintained project with a BDFL** — a Benevolent Dictator
+for Life. **Ashiq Hussain Mir** ([email protected]), the project's
+founder, is the sole maintainer and the final decision-maker for every
+change, release, and roadmap call.
+
+## Why solo, and why we say so plainly
+
+Honest governance beats aspirational governance. This project is currently
+built and run by one person; writing "steering committee" into a file would
+not make one exist, and contributors deserve to know exactly who says yes or
+no. Stating the model plainly is itself the accountability: every decision
+below traces to a named human, in the open, in the git history.
+
+## How decisions are made
+
+| Decision | Who decides |
+| --------------------------------- | ---------------------------------------------- |
+| Bug fixes, refactors, dep bumps | maintainer, directly on `main` |
+| Features and roadmap waves | maintainer plans; community input via issues shapes priorities |
+| External pull requests | maintainer reviews and merges (criteria below) |
+| Releases and breaking changes | maintainer, semver, recorded in `CHANGELOG.md` |
+| Security response | maintainer, per [`SECURITY.md`](SECURITY.md) |
+| Conduct enforcement | maintainer, per [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md) |
+
+The roadmap is developed in **waves** — each wave is a themed batch of work
+(v0.19 "AI Power-Up", v0.20 the Sound wave, v0.21 PPTX export, v0.22 the
+limits waves) that ships with a `docs/` companion and a changelog entry, so
+the reasoning behind big changes is public before and after they land.
+
+## What a contribution must clear
+
+Pull requests are genuinely welcome (see
+[`CONTRIBUTING.md`](CONTRIBUTING.md)) — one human reviews them, and the bar
+is the same for everyone:
+
+1. CI green — lint, typecheck, unit tests, build
+2. Fits the values below; in particular, no feature-gating, no watermarks,
+ no paywalls, no surprise telemetry or background network calls
+3. Public API or schema changes come with docs and a changelog note
+4. Anything security-sensitive goes through `SECURITY.md`, never a public
+ PR or issue
+
+## The values the BDFL answers to
+
+These predate this file and outrank it:
+
+- **Every feature is free, forever.** No Pro tier, no watermarks, no ransom.
+- **MIT license** — fork it, build a business on it, no permission needed.
+- **Self-hosting is first-class** — your server, your database, your keys.
+- **Privacy by architecture** — secrets stay server-side; usage counters
+ count, they don't identify.
+
+A change that violates these is rejected no matter who proposes it —
+including the maintainer's own ideas, which have been turned back for less.
+
+## Bus factor and succession
+
+Stated plainly: today the bus factor is one. The MIT license is the
+community's permanent escape hatch — forking is always allowed, and that is
+a feature of the model, not a failure of it. The project's
+[`funding.json`](funding.json) exists partly to reduce this risk: sustained
+funding keeps development at a pace where contributors can ramp up to
+co-maintainership.
+
+If the maintainer becomes unreachable for **six months** with critical
+issues outstanding, the community is encouraged — openly and without
+animosity — to fork, carry the project forward under the MIT license, and
+say so. Continuity of the software matters more than continuity of control.
+
+## Changing this document
+
+By the BDFL, in the open, through a normal commit to this repository — and
+a change that weakens the values section above will not be made.
diff --git a/README.md b/README.md
index 4f4e056..27b9f5a 100644
--- a/README.md
+++ b/README.md
@@ -783,12 +783,34 @@ background removal (local ONNX), color palettes and layout balancing keep workin
and provider-backed features show a clear setup notice. Every AI route is rate-
limited per IP and logs usage into the `AIUsage` table.
+### Capability slots — modular AI, one job per slot
+
+The AI layer is deliberately **not** one blob. It is split into capability
+slots — **text** (assistant, magic write, design plans, notes, theme,
+translate), **vision** (alt text, grounding), **image** (generation and magic
+editing) and **video** (text-to-video) — and every slot resolves its provider
+**independently** (`AI_SLOTS` in `src/lib/admin/config.ts`, resolution in
+`src/lib/ai/provider.ts`). Run everything on one provider, or mix vendors per
+slot through the admin console's multi-provider table, which carries per-slot
+base URLs, API keys and model ids. `/api/ai/capabilities` answers per-slot
+booleans, so the editor only ever offers what is actually configured — a
+missing slot degrades gracefully instead of breaking the app.
+
+Each slot speaks the same provider surface — a base URL and an API key (the
+video slot auto-detects both dialects it supports: the Sora-style async API
+and the z-ai one). That makes **moving from an experimental or local setup to
+official enterprise keys fully plug-and-play**: start self-hosting on whatever
+provider you already have, then point a slot at Fal.ai or Cloudflare Workers AI
+by updating the credentials in `.env` or the admin console and restarting. No
+code changes, no migrations, no editor redeploy — the slot, the probes and the
+feature gates all follow.
+
### Local-only vs provider-backed features
| Feature | Works without a provider? |
|---|---|
| Editor, templates, uploads, draw, groups, rulers, crop | ✅ always local |
-| Exports — PNG / JPG / PDF / SVG / video | ✅ always local |
+| Exports — PNG / JPG / PDF / SVG / PPTX / GIF / video | ✅ always local |
| Collaboration, presence, comments | ✅ only needs the database |
| Background remover | ✅ local (in-browser ONNX) |
| **Upscaler (Lanczos 2×/4×)** | ✅ local — v0.19 Wave 4, any image |
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 0000000..bfc51ec
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,103 @@
+# Security Policy
+
+## Supported versions
+
+Canvix moves fast, and security fixes land on `main` first. Only the latest
+release line receives security patches — self-hosting is one `git pull` (or
+one re-deploy) away from current.
+
+| Version | Supported |
+| ------- | ------------------ |
+| 0.22.x | ✅ current `main` |
+| older | ❌ upgrade first |
+
+## Reporting a vulnerability
+
+**Do not report security vulnerabilities through public GitHub issues,
+discussions, or pull requests.**
+
+Instead, email the maintainer privately:
+
+
+Please put `[security]` in the subject line. Include as much of the following
+as you can:
+
+- the affected component (API route, editor, plugin system, MCP endpoint,
+ export pipeline, admin console, …)
+- the exact Canvix version or commit SHA you tested against
+- step-by-step reproduction, or a minimal proof of concept
+- impact assessment — what an attacker gains and under what preconditions
+- any mitigations you already checked for
+
+### What to expect
+
+Canvix is maintained by a single maintainer, so timelines are honest rather
+than corporate:
+
+- **Acknowledgement** — within 72 hours of the report
+- **Triage + severity rating** — within 7 days
+- **Fix** — critical issues are prioritized immediately; the aim is a patch
+ release within 14 days for anything exploitable on a default deployment
+- **Coordinated disclosure** — we ask for up to 90 days before public
+ disclosure, and will negotiate an earlier joint announcement for anything
+ already exploited in the wild. Credit is given in the changelog unless you
+ prefer to stay anonymous.
+
+### Safe harbor
+
+Good-faith security research that respects the rules below is welcomed and
+will not be met with legal action:
+
+- no denial-of-service, spam, or brute force against live instances
+- no social engineering, no exfiltration of other users' data
+- test only against instances you own or have explicit permission to test
+- stop and report immediately if you stumble onto real user data
+
+## Scope
+
+**In scope:** the application code in this repository — the Next.js app, API
+routes, editor, collaboration/SSE layer, plugin manifest validation and
+bundled-plugin pipeline, MCP server, export pipelines, admin console, and the
+default deployment configurations documented in `README.md`.
+
+**Out of scope:**
+
+- vulnerabilities in third-party AI/stock providers reached through a
+ configured provider (report those to the provider)
+- self-hoster misconfiguration — weak admin credentials, publicly exposed
+ `.env`, missing TLS, disabled rate limiting
+- instances clearly modified from this source tree
+- volume-based attacks (DoS) against public deployments
+- reports from automated scanners that have not been manually validated
+
+## Hardening already in place (context for reporters)
+
+These are documented for efficiency — a report that bypasses one of these
+layers is especially interesting to us:
+
+- **Security headers + CSP baseline** on every route class (`nosniff`,
+ strict referrer policy, `SAMEORIGIN` framing, HSTS, locked-down
+ `Permissions-Policy`), asserted by an e2e spec in CI
+- **Rate limits** on every AI route, per IP, with usage recorded in the
+ `AIUsage` table
+- **Secrets never reach the browser** — provider credentials resolve
+ server-side only; `/api/ai/capabilities` exposes booleans, never keys
+- **Validated collaboration events** — type-checked, size-capped (256 KB),
+ malformed events are dropped, never crashed on
+- **Sanitized SVG export** — XML-escaped text, whitelisted path data,
+ `data:`/`https:`-only image hrefs, no script or event-handler content
+- **MCP endpoint hardening** — disabled until a token is set, Bearer auth
+ with timing-safe comparison, DNS-rebinding guard, SSRF-guarded image
+ fetches with size/time caps, per-tool argument clamping
+- **Plugin sandbox boundary (v0.13+)** — first-party plugin manifests are
+ validated against a strict schema, engine ranges are semver-checked
+ against the host, and plugin bundles are sha256-pinned at build time;
+ the fetcher refuses anything not in the manifest
+- **SSRF guards** on all server-side URL fetches (private hosts denied,
+ payload and time caps)
+
+## Preferred languages
+
+English is preferred for reports; plain, direct descriptions beat formal
+prose.
diff --git a/funding.json b/funding.json
new file mode 100644
index 0000000..56694c2
--- /dev/null
+++ b/funding.json
@@ -0,0 +1,80 @@
+{
+ "$schema": "https://fundingjson.org/schema/v1.1.0.json",
+ "version": "v1.1.0",
+ "entity": {
+ "type": "individual",
+ "role": "maintainer",
+ "name": "Ashiq Hussain Mir",
+ "email": "[email protected]",
+ "description": "Solo maintainer of Canvix. Final-year student building the free, open-source design tool full-time around classes, and looking for a development runway to keep that pace through v1.0.",
+ "webpageUrl": {
+ "url": "https://github.com/mir-ashiq"
+ }
+ },
+ "projects": [
+ {
+ "guid": "canvix",
+ "name": "Canvix",
+ "description": "Free & open-source graphic design tool — a community-built Canva alternative. A browser-based drag-and-drop editor with a 366-template library, real-time collaboration, local exports (PNG, JPG, SVG, PDF, PPTX, GIF, video) and a modular AI layer split into text, vision, image and video capability slots that plug into any provider. MIT-licensed; every feature free forever, no watermarks, no paywalls.",
+ "webpageUrl": {
+ "url": "https://github.com/mir-ashiq/canvix"
+ },
+ "repositoryUrl": {
+ "url": "https://github.com/mir-ashiq/canvix"
+ },
+ "licenses": [
+ "spdx:MIT"
+ ],
+ "tags": [
+ "design",
+ "graphics",
+ "web-design",
+ "web-development",
+ "artificial-intelligence",
+ "productivity"
+ ]
+ }
+ ],
+ "funding": {
+ "channels": [
+ {
+ "guid": "to-be-confirmed",
+ "type": "other",
+ "address": "To be confirmed with the funder",
+ "description": "Placeholder payment channel. The concrete rail (bank transfer or payment provider) will be finalized together with the funding organization before any disbursement, and this manifest will be updated in the open."
+ }
+ ],
+ "plans": [
+ {
+ "guid": "final-year-tuition",
+ "status": "active",
+ "name": "Final-year tuition — full-time development runway",
+ "description": "Milestone 1 of 3 (USD 4,000). Covers final-year tuition so the maintainer can keep building Canvix at full-time pace instead of trading development hours for part-time work. Deliverable: sustained weekly release cadence through the academic year.",
+ "amount": 4000,
+ "currency": "USD",
+ "frequency": "one-time",
+ "channels": ["to-be-confirmed"]
+ },
+ {
+ "guid": "local-hardware-upgrade",
+ "status": "active",
+ "name": "Local hardware upgrade — faster build & test loops",
+ "description": "Milestone 2 of 3 (USD 2,000). RAM and CPU upgrade for the local dev machine. Direct effect: faster compiles and test runs — the 1,400+ unit tests and the Playwright e2e suite gate every release, so shorter loops mean shorter release cycles and faster security fixes.",
+ "amount": 2000,
+ "currency": "USD",
+ "frequency": "one-time",
+ "channels": ["to-be-confirmed"]
+ },
+ {
+ "guid": "v1-living-expenses",
+ "status": "active",
+ "name": "Living expenses — ship Canvix v1.0",
+ "description": "Milestone 3 of 3 (USD 1,000). Living-expense support for the final push to v1.0: API stabilization, documentation, and the first stable, semver-committed release.",
+ "amount": 1000,
+ "currency": "USD",
+ "frequency": "one-time",
+ "channels": ["to-be-confirmed"]
+ }
+ ]
+ }
+}