-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
53 lines (51 loc) · 18.6 KB
/
Copy pathindex.html
File metadata and controls
53 lines (51 loc) · 18.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html><html lang="en" class="astro-j7pv25f6"> <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>instancez — A lightweight, self-hosted backend</title><meta name="description" content="A lightweight, self-hosted backend. Define your schema in one YAML file and get a full Postgres-backed API with auth, RLS, functions, and storage. Compatible with supabase-js."><link rel="icon" href="/favicon.svg" type="image/svg+xml"><link rel="alternate" type="text/plain" title="llms.txt" href="/llms.txt"><link rel="stylesheet" href="/_astro/index.BdrxSEzD.css">
<link rel="stylesheet" href="/_astro/index.CTlvODm8.css"><script type="module" src="/_astro/page.B1D-nYk3.js"></script></head> <body class="astro-j7pv25f6"> <header class="topbar astro-j7pv25f6"> <a href="/" class="brand astro-j7pv25f6"> <img src="/_astro/logo.QAEItoHz.svg" alt="instancez" class="astro-j7pv25f6"> <b class="astro-j7pv25f6">instancez</b> <span class="tag astro-j7pv25f6">v0.0.3</span> </a> <nav class="topnav astro-j7pv25f6"> <a href="/quick-start/" class="astro-j7pv25f6">Quick Start</a> <a href="/build/schema/" class="astro-j7pv25f6">Build</a> <a href="/deploy/docker/" class="astro-j7pv25f6">Deploy</a> <a href="/api-reference/cli/" class="astro-j7pv25f6">Reference</a> </nav> <div class="topactions astro-j7pv25f6"> <details class="hp-menu astro-j7pv25f6"> <summary class="kbtn ghost astro-j7pv25f6" aria-label="Copy the docs or open them in an AI"> <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="astro-j7pv25f6"> <rect width="14" height="14" x="8" y="8" rx="2" ry="2" class="astro-j7pv25f6"></rect> <path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" class="astro-j7pv25f6"></path> </svg>
Copy / Ask AI
<svg class="chev astro-j7pv25f6" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="m6 9 6 6 6-6" class="astro-j7pv25f6"></path> </svg> </summary> <div class="menu astro-j7pv25f6" role="menu"> <button type="button" class="menu-item astro-j7pv25f6" data-copy="/llms-full.txt" data-label="Copy all docs as Markdown" role="menuitem">
Copy all docs as Markdown
</button> <a class="menu-item astro-j7pv25f6" href="https://chatgpt.com/?q=Read%20the%20full%20instancez%20documentation%20at%20https%3A%2F%2Finstancez.github.io%2Fllms-full.txt%20and%20help%20me%20use%20instancez." target="_blank" rel="noreferrer" role="menuitem">
Open in ChatGPT
</a> <a class="menu-item astro-j7pv25f6" href="https://claude.ai/new?q=Read%20the%20full%20instancez%20documentation%20at%20https%3A%2F%2Finstancez.github.io%2Fllms-full.txt%20and%20help%20me%20use%20instancez." target="_blank" rel="noreferrer" role="menuitem">
Open in Claude
</a> </div> </details> <a href="https://github.com/instancez/instancez" class="kbtn ghost astro-j7pv25f6">GitHub <span class="key astro-j7pv25f6">G</span></a> <a href="/quick-start/" class="kbtn solid astro-j7pv25f6">Quick Start <span class="key astro-j7pv25f6">S</span></a> </div> </header> <div class="shell astro-j7pv25f6"> <main class="canvas astro-j7pv25f6"> <section class="hero astro-j7pv25f6" id="overview"> <h1 class="headline astro-j7pv25f6">A <span class="mark astro-j7pv25f6">lightweight</span> backend,<br class="astro-j7pv25f6">in one YAML file.</h1> <p class="lede astro-j7pv25f6">Define your schema in one YAML file and get a full Postgres-backed API with auth, RLS, functions, and storage. Self-host it as a single binary, point your existing <code style="font-family:var(--mono);color:#ddd" class="astro-j7pv25f6">supabase-js</code> code at it, and you are running in minutes.</p> <div class="hero-actions astro-j7pv25f6"> <a href="/quick-start/" class="kbtn solid astro-j7pv25f6">Quick Start <span class="key astro-j7pv25f6">S</span></a> <a href="https://github.com/instancez/instancez" class="kbtn ghost astro-j7pv25f6">View on GitHub <span class="key astro-j7pv25f6">G</span></a> </div> <div class="install-label astro-j7pv25f6">Install</div> <div class="install-tabs astro-j7pv25f6"> <button class="install-tab active astro-j7pv25f6" data-os="mac">macOS</button> <button class="install-tab astro-j7pv25f6" data-os="linux">Linux</button> <button class="install-tab astro-j7pv25f6" data-os="windows">Windows</button> </div> <div class="install-cmd active astro-j7pv25f6" id="cmd-mac"> <div class="install-block astro-j7pv25f6"><span class="prompt astro-j7pv25f6">$</span><span class="cmd astro-j7pv25f6">curl -fsSL https://get.instancez.ai | sh</span><button class="copy-btn astro-j7pv25f6" type="button" aria-label="Copy command"><svg class="ic-copy astro-j7pv25f6" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2" class="astro-j7pv25f6"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" class="astro-j7pv25f6"></path></svg><svg class="ic-check astro-j7pv25f6" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12" class="astro-j7pv25f6"></polyline></svg></button></div> </div> <div class="install-cmd astro-j7pv25f6" id="cmd-linux"> <div class="install-block astro-j7pv25f6"><span class="prompt astro-j7pv25f6">$</span><span class="cmd astro-j7pv25f6">curl -fsSL https://get.instancez.ai | sh</span><button class="copy-btn astro-j7pv25f6" type="button" aria-label="Copy command"><svg class="ic-copy astro-j7pv25f6" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2" class="astro-j7pv25f6"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" class="astro-j7pv25f6"></path></svg><svg class="ic-check astro-j7pv25f6" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12" class="astro-j7pv25f6"></polyline></svg></button></div> </div> <div class="install-cmd astro-j7pv25f6" id="cmd-windows"> <div class="install-block astro-j7pv25f6"><span class="prompt astro-j7pv25f6">PS></span><span class="cmd astro-j7pv25f6">irm https://get.instancez.ai/windows | iex</span><button class="copy-btn astro-j7pv25f6" type="button" aria-label="Copy command"><svg class="ic-copy astro-j7pv25f6" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2" class="astro-j7pv25f6"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" class="astro-j7pv25f6"></path></svg><svg class="ic-check astro-j7pv25f6" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12" class="astro-j7pv25f6"></polyline></svg></button></div> </div> </section> <section class="section astro-j7pv25f6" id="example"> <div class="section-eyebrow astro-j7pv25f6">How it looks</div> <h2 class="astro-j7pv25f6">Write YAML. Ship a backend system.</h2> <p class="sub astro-j7pv25f6">One file holds your schema and its RLS policies. instancez handles the migration and serves the API.</p> <div class="demo-split astro-j7pv25f6"> <div class="code-card astro-j7pv25f6"> <div class="code-head astro-j7pv25f6"> <span class="dot astro-j7pv25f6" style="background:#ff5f57"></span> <span class="dot astro-j7pv25f6" style="background:#febc2e"></span> <span class="dot astro-j7pv25f6" style="background:#28c840"></span>
instancez.yaml
</div> <pre class="astro-j7pv25f6"><span class="yk astro-j7pv25f6">tables</span><span class="p astro-j7pv25f6">:</span>
<span class="yk astro-j7pv25f6">posts</span><span class="p astro-j7pv25f6">:</span>
<span class="yk astro-j7pv25f6">fields</span><span class="p astro-j7pv25f6">:</span>
<span class="p astro-j7pv25f6">-</span> <span class="yk astro-j7pv25f6">name</span><span class="p astro-j7pv25f6">:</span> <span class="yv astro-j7pv25f6">id</span>
<span class="yk astro-j7pv25f6">type</span><span class="p astro-j7pv25f6">:</span> <span class="yv astro-j7pv25f6">bigserial</span>
<span class="yk astro-j7pv25f6">primary_key</span><span class="p astro-j7pv25f6">:</span> <span class="yb astro-j7pv25f6">true</span>
<span class="p astro-j7pv25f6">-</span> <span class="yk astro-j7pv25f6">name</span><span class="p astro-j7pv25f6">:</span> <span class="yv astro-j7pv25f6">title</span>
<span class="yk astro-j7pv25f6">type</span><span class="p astro-j7pv25f6">:</span> <span class="yv astro-j7pv25f6">text</span>
<span class="yk astro-j7pv25f6">required</span><span class="p astro-j7pv25f6">:</span> <span class="yb astro-j7pv25f6">true</span>
<span class="p astro-j7pv25f6">-</span> <span class="yk astro-j7pv25f6">name</span><span class="p astro-j7pv25f6">:</span> <span class="yv astro-j7pv25f6">user_id</span>
<span class="yk astro-j7pv25f6">type</span><span class="p astro-j7pv25f6">:</span> <span class="yv astro-j7pv25f6">uuid</span>
<span class="yk astro-j7pv25f6">foreign_key</span><span class="p astro-j7pv25f6">:</span>
<span class="yk astro-j7pv25f6">references</span><span class="p astro-j7pv25f6">:</span> <span class="yv astro-j7pv25f6">auth.users.id</span>
<span class="yk astro-j7pv25f6">rls</span><span class="p astro-j7pv25f6">:</span>
<span class="p astro-j7pv25f6">-</span> <span class="yk astro-j7pv25f6">operations</span><span class="p astro-j7pv25f6">:</span> [<span class="yv astro-j7pv25f6">select</span>]
<span class="yk astro-j7pv25f6">using</span><span class="p astro-j7pv25f6">:</span> <span class="s astro-j7pv25f6">"true"</span>
<span class="p astro-j7pv25f6">-</span> <span class="yk astro-j7pv25f6">operations</span><span class="p astro-j7pv25f6">:</span> [<span class="yv astro-j7pv25f6">insert</span>]
<span class="yk astro-j7pv25f6">with_check</span><span class="p astro-j7pv25f6">:</span> <span class="s astro-j7pv25f6">"auth.uid() = user_id"</span>
<span class="p astro-j7pv25f6">-</span> <span class="yk astro-j7pv25f6">operations</span><span class="p astro-j7pv25f6">:</span> [<span class="yv astro-j7pv25f6">update</span>]
<span class="yk astro-j7pv25f6">using</span><span class="p astro-j7pv25f6">:</span> <span class="s astro-j7pv25f6">"auth.uid() = user_id"</span>
<span class="yk astro-j7pv25f6">with_check</span><span class="p astro-j7pv25f6">:</span> <span class="s astro-j7pv25f6">"auth.uid() = user_id"</span>
<span class="p astro-j7pv25f6">-</span> <span class="yk astro-j7pv25f6">operations</span><span class="p astro-j7pv25f6">:</span> [<span class="yv astro-j7pv25f6">delete</span>]
<span class="yk astro-j7pv25f6">using</span><span class="p astro-j7pv25f6">:</span> <span class="s astro-j7pv25f6">"auth.uid() = user_id"</span></pre> </div> <div class="code-card astro-j7pv25f6"> <div class="code-head astro-j7pv25f6"> <span class="dot astro-j7pv25f6" style="background:#ff5f57"></span> <span class="dot astro-j7pv25f6" style="background:#febc2e"></span> <span class="dot astro-j7pv25f6" style="background:#28c840"></span>
app.ts
</div> <pre class="astro-j7pv25f6"><span class="cm astro-j7pv25f6">// @supabase/supabase-js, unchanged</span>
<span class="k astro-j7pv25f6">const</span> <span class="plain astro-j7pv25f6">supabase</span> <span class="p astro-j7pv25f6">=</span> <span class="fn astro-j7pv25f6">createClient</span><span class="p astro-j7pv25f6">(</span>
<span class="s astro-j7pv25f6">'http://localhost:8080'</span><span class="p astro-j7pv25f6">,</span>
<span class="s astro-j7pv25f6">'your-anon-key'</span>
<span class="p astro-j7pv25f6">)</span>
<span class="cm astro-j7pv25f6">// query</span>
<span class="k astro-j7pv25f6">const</span> <span class="p astro-j7pv25f6"></span> <span class="plain astro-j7pv25f6">data</span> <span class="p astro-j7pv25f6"></span> <span class="p astro-j7pv25f6">=</span> <span class="k astro-j7pv25f6">await</span> <span class="plain astro-j7pv25f6">supabase</span>
<span class="p astro-j7pv25f6">.</span><span class="fn astro-j7pv25f6">from</span><span class="p astro-j7pv25f6">(</span><span class="s astro-j7pv25f6">'posts'</span><span class="p astro-j7pv25f6">)</span>
<span class="p astro-j7pv25f6">.</span><span class="fn astro-j7pv25f6">select</span><span class="p astro-j7pv25f6">(</span><span class="s astro-j7pv25f6">'id, title'</span><span class="p astro-j7pv25f6">)</span>
<span class="p astro-j7pv25f6">.</span><span class="fn astro-j7pv25f6">order</span><span class="p astro-j7pv25f6">(</span><span class="s astro-j7pv25f6">'id'</span><span class="p astro-j7pv25f6">,</span> <span class="p astro-j7pv25f6"></span> <span class="plain astro-j7pv25f6">ascending</span><span class="p astro-j7pv25f6">:</span> <span class="k astro-j7pv25f6">false</span> <span class="p astro-j7pv25f6"></span>)
<span class="cm astro-j7pv25f6">// insert: RLS checks user_id for you</span>
<span class="k astro-j7pv25f6">const</span> <span class="p astro-j7pv25f6"></span> <span class="plain astro-j7pv25f6">data</span> <span class="p astro-j7pv25f6"></span> <span class="p astro-j7pv25f6">=</span> <span class="k astro-j7pv25f6">await</span> <span class="plain astro-j7pv25f6">supabase</span>
<span class="p astro-j7pv25f6">.</span><span class="fn astro-j7pv25f6">from</span><span class="p astro-j7pv25f6">(</span><span class="s astro-j7pv25f6">'posts'</span><span class="p astro-j7pv25f6">)</span>
<span class="p astro-j7pv25f6">.</span><span class="fn astro-j7pv25f6">insert</span><span class="p astro-j7pv25f6">(</span> <span class="plain astro-j7pv25f6">title</span><span class="p astro-j7pv25f6">:</span> <span class="s astro-j7pv25f6">'Hello world'</span> <span class="p astro-j7pv25f6"></span>)
<span class="p astro-j7pv25f6">.</span><span class="fn astro-j7pv25f6">select</span><span class="p astro-j7pv25f6">()</span>
<span class="p astro-j7pv25f6">.</span><span class="fn astro-j7pv25f6">single</span><span class="p astro-j7pv25f6">()</span></pre> </div> </div> </section> <section class="section astro-j7pv25f6" id="features"> <div class="section-eyebrow astro-j7pv25f6">What you get</div> <h2 class="astro-j7pv25f6">Everything you need. Nothing extra.</h2> <p class="sub astro-j7pv25f6">Wire-compatible with <code style="font-family:var(--mono);background:#151515;padding:2px 6px;border-radius:4px;color:#ddd;border:1px solid #242424" class="astro-j7pv25f6">@supabase/supabase-js</code>. Drop it in. Your client code stays the same.</p> <div class="features-grid astro-j7pv25f6"> <div class="feature astro-j7pv25f6"> <div class="ic astro-j7pv25f6">SCHEMA</div> <h3 class="astro-j7pv25f6">YAML-driven schema</h3> <p class="astro-j7pv25f6">Declare tables, fields, types, and RLS policies in <code class="astro-j7pv25f6">instancez.yaml</code>. In dev mode, saving the file applies migrations for you.</p> </div> <div class="feature astro-j7pv25f6"> <div class="ic astro-j7pv25f6">AUTH</div> <h3 class="astro-j7pv25f6">Auth that works</h3> <p class="astro-j7pv25f6">Password, magic link, OTP, OAuth (Google, GitHub), anonymous sign-in, and TOTP MFA, all wired straight into Postgres RLS.</p> </div> <div class="feature astro-j7pv25f6"> <div class="ic astro-j7pv25f6">API</div> <h3 class="astro-j7pv25f6">PostgREST-compatible</h3> <p class="astro-j7pv25f6">Filtering, embeds, aggregates, pagination, and RPC. The same query surface your supabase-js code already speaks.</p> </div> <div class="feature astro-j7pv25f6"> <div class="ic astro-j7pv25f6">FUNCTIONS</div> <h3 class="astro-j7pv25f6">Code functions</h3> <p class="astro-j7pv25f6">JavaScript ESM handlers at <code class="astro-j7pv25f6">/functions/v1/<name></code>. Each one gets <code class="astro-j7pv25f6">ctx.supabase</code>, secrets, and structured logging.</p> </div> <div class="feature astro-j7pv25f6"> <div class="ic astro-j7pv25f6">STORAGE</div> <h3 class="astro-j7pv25f6">Storage</h3> <p class="astro-j7pv25f6">Upload and download with local or S3 backends. Bucket policies run through RLS, the same model as your tables.</p> </div> <div class="feature astro-j7pv25f6"> <div class="ic astro-j7pv25f6">DEPLOY</div> <h3 class="astro-j7pv25f6">Deploy anywhere</h3> <p class="astro-j7pv25f6">One binary. Docker, AWS Lambda, or bare metal: one command to run, one YAML file to configure.</p> </div> </div> </section> <section class="cta astro-j7pv25f6" id="start"> <h2 class="astro-j7pv25f6">Ready to <span class="mark astro-j7pv25f6">build</span>?</h2> <p class="astro-j7pv25f6">One command to install. One YAML file to start.</p> <div class="hero-actions astro-j7pv25f6"> <a href="/quick-start/" class="kbtn solid astro-j7pv25f6">Get started <span class="key astro-j7pv25f6">S</span></a> <a href="/install/" class="kbtn ghost astro-j7pv25f6">All install options</a> </div> </section> <footer class="astro-j7pv25f6"> <span class="astro-j7pv25f6">instancez · open source · MIT license</span> <a href="https://github.com/instancez/instancez" class="astro-j7pv25f6">github.com/instancez/instancez</a> </footer> </main> </div> <script type="module">const i=document.querySelectorAll(".install-tab"),s=document.querySelectorAll(".install-cmd");function n(t){i.forEach(e=>e.classList.toggle("active",e.dataset.os===t)),s.forEach(e=>e.classList.toggle("active",e.id===`cmd-${t}`))}i.forEach(t=>t.addEventListener("click",()=>n(t.dataset.os)));const c=navigator.userAgent;/Windows/i.test(c)?n("windows"):/Linux/i.test(c)?n("linux"):n("mac");document.querySelectorAll(".copy-btn").forEach(t=>{t.addEventListener("click",async()=>{const e=t.parentElement?.querySelector(".cmd")?.textContent?.trim()??"";if(e)try{await navigator.clipboard.writeText(e),t.classList.add("copied"),setTimeout(()=>t.classList.remove("copied"),1500)}catch{}})});const a=document.querySelector(".hp-menu");a&&(document.addEventListener("click",t=>{a.open&&!a.contains(t.target)&&(a.open=!1)}),document.addEventListener("keydown",t=>{t.key==="Escape"&&(a.open=!1)}),a.querySelectorAll(".menu-item[data-copy]").forEach(t=>{t.addEventListener("click",async()=>{const e=t.dataset.label;try{const o=await fetch(t.dataset.copy);if(!o.ok)throw new Error(String(o.status));await navigator.clipboard.writeText(await o.text()),t.textContent="Copied!"}catch{t.textContent="Copy failed"}setTimeout(()=>{t.textContent=e,a.open=!1},1200)})}));document.addEventListener("keydown",t=>{if(t.metaKey||t.ctrlKey||t.altKey)return;const e=t.target;e&&/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)||(t.key.toLowerCase()==="s"&&(window.location.href=document.querySelector(".kbtn.solid").href),t.key.toLowerCase()==="g"&&(window.location.href="https://github.com/instancez/instancez"))});</script> </body> </html>