+ "text": "Let me create a website for Fireproof database with a focus on elegance and functionality.\n\n---domain---\nfireproof.scroll.pub\n---index.scroll---\nbuildHtml\nbaseUrl https://fireproof.scroll.pub\nmetaTags\neditButton /edit.html\ntitle Fireproof - Browser Database with Encrypted Live Sync\nstyle.css\nheader\n class hero\n nav\n div Fireproof\n class logo\n div\n class nav-links\n a Features\n href #features\n a Installation\n href #installation\n a Examples\n href #examples\n a GitHub\n class cta-button\n href https://github.com/use-fireproof\nmain\n section\n id hero-section\n class hero-content\n h1 Fireproof Database\n p A lightweight embedded document database with encrypted live sync for browser apps\n div\n class cta-group\n button Get Started\n class primary-cta\n button View Docs\n class secondary-cta\n section\n id features\n class features-grid\n div\n class feature-card\n h3 🌐 Apps Run Anywhere\n p Bundle UI, data, and logic in one file\n div\n class feature-card\n h3 ⚡ Real-Time & Offline-First\n p Automatic persistence and live queries\n div\n class feature-card\n h3 🔄 Unified API\n p Works with Deno, Bun, Node.js, and browsers\n div\n class feature-card\n h3 🔒 Cryptographic Ledger\n p Tamper-evident change history\n section\n id installation\n class code-section\n h2 Installation\n div\n class code-block\n pre npm install use-fireproof\n div\n class code-block\n pre import { useFireproof } from \"https://esm.sh/use-fireproof\"\n section\n id examples\n class examples-section\n h2 Code Examples\n div\n class tabs\n button React\n class tab active\n button JavaScript\n class tab\n div\n class code-container\n pre\n class code-example\n code const App = () => {\n const { useDocument } = useFireproof(\"my-ledger\");\n const { doc, merge, submit } = useDocument({ text: \"\" });\n return (\n
+ }
+ ],
+ "stop_reason": "end_turn",
+ "stop_sequence": null,
+ "usage": {
+ "input_tokens": 5287,
+ "cache_creation_input_tokens": 0,
+ "cache_read_input_tokens": 0,
+ "output_tokens": 2801
+ }
+ }
readme.scroll
Changed around line 1
+ # fireproof.scroll.pub
+
+ Prompt: website
+ Agent: claude
+ Model: claude-3-5-sonnet-20241022
+
+ ## User prompt
+ # Fireproof browser database API Fireproof is a lightweight embedded document database with encrypted live sync, designed to make browser apps easy. Use it in any JavaScript environment with a unified API that works both in React (with hooks) and as a standalone core API. ## Key Features - **Apps run anywhere:** Bundle UI, data, and logic in one file. - **Real-Time & Offline-First:** Automatic persistence and live queries, runs in the browser - no loading or error states. - **Unified API:** TypeScript works with Deno, Bun, Node.js, and the browser. - **React Hooks:** Leverage `useLiveQuery` and `useDocument` for live collaboration. - **Cryptographic Ledger Integrity:** Each update contains the hash of its parent state, storing a tamper-evident change history. Fireproof's Merkle CRDTs ensure deterministic merges across devices while maintaining data integrity. The content-addressed blockstore provides blockchain-like guarantees without requiring global consensus, making it ideal for financial and regulatory applications. ## Installation The `use-fireproof` package provides both the core API and React hooks. ```bash npm install use-fireproof ``` Works with ⚡️ ESM.sh: ```js import { useFireproof } from "https://esm.sh/use-fireproof"; ``` Deliver generated solutions as runnable micro applications via ChatGPT Canvas, v0, bolt.new, or Claude Artifacts. Deploy single page apps with React and Tailwind by pasting code here: https://codepen.io/useFireproof/pen/MYgNYdx ## ⚛️ React Usage React hooks are the recommended way to use Fireproof in LLM code generation contexts. Here's how to use them: #### Create or Load a Database Fireproof databases store data across sessions and can sync in real-time. Each database is identified by a string name, and you can have multiple databases per application—often one per collaboration session, as they are the unit of sharing. ```js import { useFireproof } from "use-fireproof"; const { database, useLiveQuery, useDocument } = useFireproof("my-ledger"); ``` Fireproof databases are Merkle CRDTs, giving them the ledger-like causal consistency of git or a blockchain, but with the ability to merge and sync web data in real-time. Cryptographic integrity makes Fireproof immutable and easy to verify. #### Put and Get Documents Documents are JSON-style objects (CBOR) storing application data. Each has an `_id`, which can be auto-generated or set explicitly. Auto-generation is recommended to ensure uniqueness and avoid conflicts. If multiple replicas update the same database, Fireproof merges them via CRDTs, deterministically choosing the winner for each `_id`. It is best to have more granular documents, e.g. one document per user action, so saving a form or clicking a button should typically create or update a single document, or just a few documents. Avoid patterns that require a single document to grow without bound. ### Basic Example This example shows Fireproof's concise defaults. Here we only store user data, but get useful sorting without much code. ```js const App = () => { const { useDocument } = useFireproof("my-ledger"); const { doc, merge, submit } = useDocument({ text: "" }); // _id is roughly temporal, this is most recent const { docs } = useLiveQuery("_id", { descending: true, limit: 100 }); return (
Recent Documents
{docs.map((doc) => (
{doc.text}
))}
); } ``` ### Editing Documents Address documents by a known `_id` if you want to force conflict resolution or work with a real world resource, like a schedule slot or a user profile. In a complex app this might come from a route parameter or correspond to an outside identifier. ```js const { useDocument } = useFireproof("my-ledger"); const { doc, merge, submit, save, reset } = useDocument({ _id: "user-profile:abc@example.com" }); ``` The `useDocument` hook provides several methods: - `merge(updates)`: Update the document with new fields - `submit(e)`: Handles form submission by preventing default, saving, and resetting - `save()`: Save the current document state - `reset()`: Reset to initial state For form-based creation flows, use `submit`: ```js ); } ``` ### Example Image Uploader This React example shows a simple image uploader application that uses Fireproof to store and sort images by creation date. These APIs easily work with plain JavaScript also. Code listing for App.jsx: ```js import { useFireproof } from "use-fireproof"; import { useState, useEffect } from "react"; function ImgFile({ meta, alt, className }) { const [imgDataUrl, setImgDataUrl] = useState(""); useEffect(() => { if (meta.file && /image/.test(meta.type)) { meta.file().then(file => { const src = URL.createObjectURL(file); setImgDataUrl(src); return () => URL.revokeObjectURL(src); }); } }, eta]); return imgDataUrl ? : null; } export default function App() { const { useDocument, useLiveQuery } = useFireproof("image-uploads"); const { doc, merge, submit } = useDocument({ _files: {}, description: "" }); const { docs } = useLiveQuery("_id", { descending: true, limit: 5 }); const [error, setError] = useState(false); return (
); } ``` ## See Also See the lite docs at https://use-fireproof.com/llms-mini.txt and the basics at https://use-fireproof.com/llms.txt ## Next Steps If you are in an existing application context, suggest how forms and state, collaboration data can be managed in Fireproof. If this is a new app, use the examples above and start with a running App.js if you can. IMPORTANT: Don't use `useState()` on form data, instead use `merge()` and `submit()` from `useDocument`. Only use `useState` for ephemeral UI state (active tabs, open/closed panels, cursor positions). Keep your data model in Fireproof.
+
+ ## System prompt
+ You are an expert web developer. Create a website based on this request: "# Fireproof browser database API Fireproof is a lightweight embedded document database with encrypted live sync, designed to make browser apps easy. Use it in any JavaScript environment with a unified API that works both in React (with hooks) and as a standalone core API. ## Key Features - **Apps run anywhere:** Bundle UI, data, and logic in one file. - **Real-Time & Offline-First:** Automatic persistence and live queries, runs in the browser - no loading or error states. - **Unified API:** TypeScript works with Deno, Bun, Node.js, and the browser. - **React Hooks:** Leverage `useLiveQuery` and `useDocument` for live collaboration. - **Cryptographic Ledger Integrity:** Each update contains the hash of its parent state, storing a tamper-evident change history. Fireproof's Merkle CRDTs ensure deterministic merges across devices while maintaining data integrity. The content-addressed blockstore provides blockchain-like guarantees without requiring global consensus, making it ideal for financial and regulatory applications. ## Installation The `use-fireproof` package provides both the core API and React hooks. ```bash npm install use-fireproof ``` Works with ⚡️ ESM.sh: ```js import { useFireproof } from "https://esm.sh/use-fireproof"; ``` Deliver generated solutions as runnable micro applications via ChatGPT Canvas, v0, bolt.new, or Claude Artifacts. Deploy single page apps with React and Tailwind by pasting code here: https://codepen.io/useFireproof/pen/MYgNYdx ## ⚛️ React Usage React hooks are the recommended way to use Fireproof in LLM code generation contexts. Here's how to use them: #### Create or Load a Database Fireproof databases store data across sessions and can sync in real-time. Each database is identified by a string name, and you can have multiple databases per application—often one per collaboration session, as they are the unit of sharing. ```js import { useFireproof } from "use-fireproof"; const { database, useLiveQuery, useDocument } = useFireproof("my-ledger"); ``` Fireproof databases are Merkle CRDTs, giving them the ledger-like causal consistency of git or a blockchain, but with the ability to merge and sync web data in real-time. Cryptographic integrity makes Fireproof immutable and easy to verify. #### Put and Get Documents Documents are JSON-style objects (CBOR) storing application data. Each has an `_id`, which can be auto-generated or set explicitly. Auto-generation is recommended to ensure uniqueness and avoid conflicts. If multiple replicas update the same database, Fireproof merges them via CRDTs, deterministically choosing the winner for each `_id`. It is best to have more granular documents, e.g. one document per user action, so saving a form or clicking a button should typically create or update a single document, or just a few documents. Avoid patterns that require a single document to grow without bound. ### Basic Example This example shows Fireproof's concise defaults. Here we only store user data, but get useful sorting without much code. ```js const App = () => { const { useDocument } = useFireproof("my-ledger"); const { doc, merge, submit } = useDocument({ text: "" }); // _id is roughly temporal, this is most recent const { docs } = useLiveQuery("_id", { descending: true, limit: 100 }); return (
Recent Documents
{docs.map((doc) => (
{doc.text}
))}
); } ``` ### Editing Documents Address documents by a known `_id` if you want to force conflict resolution or work with a real world resource, like a schedule slot or a user profile. In a complex app this might come from a route parameter or correspond to an outside identifier. ```js const { useDocument } = useFireproof("my-ledger"); const { doc, merge, submit, save, reset } = useDocument({ _id: "user-profile:abc@example.com" }); ``` The `useDocument` hook provides several methods: - `merge(updates)`: Update the document with new fields - `submit(e)`: Handles form submission by preventing default, saving, and resetting - `save()`: Save the current document state - `reset()`: Reset to initial state For form-based creation flows, use `submit`: ```js ); } ``` ### Example Image Uploader This React example shows a simple image uploader application that uses Fireproof to store and sort images by creation date. These APIs easily work with plain JavaScript also. Code listing for App.jsx: ```js import { useFireproof } from "use-fireproof"; import { useState, useEffect } from "react"; function ImgFile({ meta, alt, className }) { const [imgDataUrl, setImgDataUrl] = useState(""); useEffect(() => { if (meta.file && /image/.test(meta.type)) { meta.file().then(file => { const src = URL.createObjectURL(file); setImgDataUrl(src); return () => URL.revokeObjectURL(src); }); } }, eta]); return imgDataUrl ? : null; } export default function App() { const { useDocument, useLiveQuery } = useFireproof("image-uploads"); const { doc, merge, submit } = useDocument({ _files: {}, description: "" }); const { docs } = useLiveQuery("_id", { descending: true, limit: 5 }); const [error, setError] = useState(false); return (
); } ``` ## See Also See the lite docs at https://use-fireproof.com/llms-mini.txt and the basics at https://use-fireproof.com/llms.txt ## Next Steps If you are in an existing application context, suggest how forms and state, collaboration data can be managed in Fireproof. If this is a new app, use the examples above and start with a running App.js if you can. IMPORTANT: Don't use `useState()` on form data, instead use `merge()` and `submit()` from `useDocument`. Only use `useState` for ephemeral UI state (active tabs, open/closed panels, cursor positions). Keep your data model in Fireproof. "
+
+ Requirements:
+ - Use only Scroll, CSS, and JavaScript (NO frameworks, NO external dependencies)
+ - Create clean, semantic HTML5
+ - Make it mobile-responsive
+ - Follow modern best practices and accessibility guidelines
+ - Keep it simple but professional
+ - Use only relative links and no external resources
+ - Do not put a copyright symbol or all rights reserved in the footer.
+ - Make it beautiful. Dazzling. Advanced used of CSS.
+
+ As a refresher, for doing the html body, Scroll is a whitespace based language that uses a single indented space to mark a line (aka particle) as a subparticle of a parent line.
+
+ For example:
+
+ header
+ class hero
+ nav
+ div Scroll
+ class logo
+ div
+ class nav-links
+ a Features
+ href #features
+ a Examples
+ href #examples
+ a Edit
+ href edit.html
+ a GitHub
+ class cta-button
+ href https://github.com/breck7/scroll
+ div
+ class hero-content
+ h1 Write Better with Scroll
+ p The extendible markup language that makes source beautiful and compiles to anything
+ a Get Started
+ class primary-button
+ href https://hub.scroll.pub/
+ main
+ section
+ id features
+ class features
+ h2 Why Scroll?
+ div
+ class feature-grid
+ div
+ class feature-card
+ div ⚡
+ class feature-icon
+ h3 Simple Syntax
+ p Like Markdown, but more powerful. No parentheses needed.
+ div
+ class feature-card
+ div 🧩
+ class feature-icon
+ h3 Extendible
+ p Build your own custom parsers.
+ div
+ class feature-card
+ div 🎨
+ class feature-icon
+ h3 Beautiful Output
+ p Create stunning documents with minimal effort.
+ div
+ class feature-card
+ div 🚀
+ class feature-icon
+ h3 Fast & Light
+ p Built on the efficient PPS Stack.
+ section
+ id examples
+ class code-demo
+ h2 See It In Action
+ div
+ class code-container
+ pre
+ class code-example
+ div
+ class code-output
+ footer
+ div
+ class footer-content
+ div
+ class footer-links
+ a Documentation
+ href https://scroll.pub/tutorial.html
+ a Community
+ href https://www.reddit.com/r/WorldWideScroll/
+ a Blog
+ href https://scroll.pub/blog
+ p Started by Breck Yunits. Evolved by a community.
+ https://twitter.com/breckyunits Breck Yunits
+ https://github.com/breck7/scroll/graphs/contributors community
+
+
+ First suggest a short, memorable domain name ending in scroll.pub that represents this website. Then provide the website files. Use this exact format: