Files and pictures for every element of your node
Every element keeps its pictures, videos and documents here, and each file gets an address that never changes. Thumbnails, blurred placeholders, video trimming and site icons come with it, on your own computer.
OpenSource Web4 agent & app starter kitHow a file goes
An element sends a file
It uploads a picture, a video or a document through the database element, up to 200 MB.
The storage keeps it
The file and its record stay in the element's folder on this computer, never in git.
It gets an address
The address points at the database element, so it never changes when the storage moves.
Pages show it
Thumbnails, blurred placeholders and trimmed videos are made from the same file.
Through the Cloudflare tunnel every door answers 404, with a key or without.
Always on
The node never turns this element off: the other elements depend on it. It starts with the node and does not sleep, even when memory is short.
What changes for you
| Without it | With the object storage |
|---|---|
| Every element would keep files its own way | Every element keeps them in one storage with one door |
| A file's link breaks when the server moves | The address stays the same when the storage moves |
| Thumbnails and icons are made by hand | The storage makes thumbnails, placeholders and site icons itself |
| Your files sit on someone else's server | They stay on your computer, inside your node |
Whose file it is
The main agent of the node
Opens every file of every element and sees whose each one is.
Mom's element
Opens only her element's files, private ones too.
Son's element
Opens only his own files.
Your site
Opens its own files and the node's public pictures.
Each element opens the storage with its own key, and another element's file answers 404, the same as a missing one.
Every file has an owner and a visibility. A file uploaded with an element's own key belongs to that element. A page picture stays public; a private file leaves only when its owner asks for it by name, so no page can serve it.
The deep memory keeps every file it is given as a private file of the element it was said through. The main agent opens them all with the node's key.
The storage keeps the doors apart, not the disk: every file lies in this element's folder on your computer, and all elements run as one user of it.
Connect your element
Every element of the node already has the database address and its own key. Upload a picture and keep its address:
const form = new FormData()
form.append('file', new Blob([bytes], { type: 'image/png' }), 'logo.png')
form.append('title', 'Logo')
const r = await fetch(`${process.env.REMOTE_DATA_URL}/media/upload`, {
method: 'POST',
headers: { 'X-Element-Key': process.env.ELEMENT_KEY },
body: form,
})
const { item } = await r.json() // item.url — the permanent address of the fileitem.url is the permanent address of the file. Add visibility=private to the form to keep a file for your element alone. PATCH /media/:id changes its title, and DELETE /media/:id removes the file and its record.
Under the hood
Part
What it does
- The library
- Files and records in the element's folder (data/media.db, storage/, icons/), never in git
- The address
- Points at the database element, so a stored address never changes when the storage moves
- Pictures
- A 200×200 thumbnail and a blurred placeholder for every picture
- Videos
- Trimming by seconds with ffmpeg: a stream copy, or a re-encode when the cut misses a keyframe
- Site icons
- From one picture: a favicon, app icons, a share picture and a manifest
- The lock
- Each element's own key opens its own files and the node's public ones; the node's data key or a privileged session opens all; through the Cloudflare tunnel every door answers 404
Your own builder comes with it
Every element of the node comes with its own Claude Code agent and can get its own Telegram bot. When something in this element should change, write to its bot from your phone, and the agent updates the logic or the design.
The agent works only in its element's folder and never reads the whole node, so each change costs fewer tokens. Your Claude Code subscription pays for it.
- The element's bot is connected in the core, on its «Telegram» page.
- The agent returns a commit; you look at it in «Preview» and accept it or turn it down.
- At the computer, the agent's terminal is in the core, in this element's «Build».
Open source
Built by Fractera for the Lagrix protocol and for any web2 project that needs to keep files. MIT license, the code is at github.com/Fractera/fractera-storage-starter.
Questions and answers
- How large can a file be?
- Up to 200 MB, sent through the data element.
- Will a file's address break if the storage moves?
- No. The address points at the data element, so a saved address stays the same.
- Can a file stay private?
- Yes. Add visibility=private when you upload it: it leaves only when its owner asks for it by name, so no page shows it.
- Can I keep backups?
- Yes. The element is ready for its programmer agent to set up backups on a schedule or by hand: tell the element's agent in Telegram or in the terminal. It makes no copies on its own until you ask.