- Hello, sorry its not a grant idea but i dont find other topic on this forum
Hey everyone,
I do a little project last night and wanted to share it with the community to get some feedback. It’s called Sia Public Share, and the idea was to build an alternative to services like Imgur or WeTransfer, powered by the Sia decentralized storage network.
Before sharing the details, I also have a quick question for the Sia Foundation or community moderators regarding naming: is using “Sia” in the project name acceptable, or should I rebrand to avoid trademark issues?
Here is a quick breakdown of what I built, how it works, and the technical hurdles I ran into while coding it.
What is Sia Public Share?
Sia Public Share is a simple web dApp that lets anyone host small files or images on Sia without needing a crypto wallet, local node, or complex setup. It cost 0€ because supabase and netlify free plans
Key Features:
-
File Uploads: Upload files up to 5 MB (capped due to serverless execution limits), sliced, encrypted, and distributed across 30 Sia hosts worldwide.
-
Direct Image Embedding: Direct image links and ready-to-use HTML
<img>tags for embedding images into external websites, blogs, or forums. -
View Counter & Voting: Real-time view tracking upon access, plus an IP-restricted voting system (one vote per IP per 24 hours).
-
Host Map & Geolocation: A live network breakdown showing the physical location (country, city, ISP, IP) of the hosts storing your file fragments.
-
Real Network Pruning: An admin deletion panel that purges records from the database and actually reclaims the unreferenced slabs on the Sia network.
Technical Architecture
-
Frontend & API: Next.js 15 (App Router, TypeScript, Tailwind CSS, Lucide icons).
-
Serverless Proxy: Netlify Functions (acting as the bridge to handle streaming and API keys).
-
Storage Integration:
@siafoundation/sia-storageSDK connected to thesia.storageindexer. -
Database: Supabase (PostgreSQL) for metadata, votes, and view tracking.
The Technical Hurdles I Solved
Building this on top of a serverless stack overnight brought a few fun engineering challenges:
-
Serverless Limits: Netlify Functions have a 6 MB payload cap and a 10-second execution timeout. I set a strict 5 MB file limit and structured the upload route to stream data directly through
@siafoundation/sia-storagebefore pinning withsdk.pinObject(). -
Soft Deletes vs. Real Pruning: At first, deleting a file only cleared the database entry, leaving the slabs pinned on Sia hosts. I updated the deletion route to call
await sdk.deleteObject(siaObjectId)followed byawait sdk.pruneSlabs(), which actually frees up host space. -
Direct Image Embedding: By default, downloads force a
Content-Disposition: attachmentheader. I added amode=viewparameter to the API that inspects the file extension, sets the properContent-Type(e.g.image/png,image/webp), and serves it withinlinedisposition so images render directly in the browser. -
Host Geolocation: Getting the physical location of the 30
ed25519host keys was tricky. Queryingip-api.comin parallel hit rate limits (429 errors), and Siascan endpoints returned 404s. I solved this by leveraging the open-source HostScore project’s public API (api.hostscore.info/v1/hosts/host?host=), which indexes the network and returns the host IP, city, country, and ISP in a single request. THX MIKE
Branding / Trademark Question
The app is currently named “Sia Public Share”.
-
Is using “Sia” in the app name okay for community projects? Because i dont apply for an official grant
-
I think i must a mandatory disclaimer in the footer (e.g. “Sia Public Share is an independent community project and is not affiliated with the Sia Foundation”)
-
If this conflicts with branding guidelines, I’m more than happy to rename it (e.g., SlabShare).
Try It Out
Live demo: https://sia-public-share.netlify.app
Let me know what you think or if you spot any bugs !
And a french version for my frogs friends
Salut à tous,
J’ai codé un petit projet la nuit dernière et je voulais le partager avec la communauté pour avoir vos retours. Le projet s’appelle « Sia Public Share » — l’idée était de créer une alternative à des services comme Imgur ou WeTransfer, propulsée en arrière-plan par le réseau de stockage décentralisé Sia.
Avant d’entrer dans les détails, j’ai aussi une question concernant le nom : est-ce que l’utilisation du mot « Sia » dans le nom du projet pose un problème de marque, ou devrais-je le renommer pour éviter tout conflit ?
Voici un résumé de ce que j’ai conçu, comment ça fonctionne et les défis techniques rencontrés pendant le dev.
C’est quoi Sia Public Share ?
Sia Public Share est une dApp web qui permet à n’importe qui d’héberger de petits fichiers ou des images sur Sia sans avoir besoin de portefeuille crypto, de nœud local ou de configuration complexe.
Fonctionnalités clés :
-
Upload de fichiers : Envoi par glisser-déposer (limité à 5 Mo pour des contraintes d’exécution serverless), découpé, chiffré et distribué sur 30 hôtes Sia à travers le monde.
-
Intégration directe d’images : Génération de liens directs et de balises HTML
<img>prêtes à l’emploi pour insérer des images sur un site web, un blog ou un forum. -
Compteur de vues & votes : Suivi des vues en temps réel lors de l’accès à l’image, plus un système de vote positif/négatif par IP (un vote par IP toutes les 24 heures).
-
Carte & Géolocalisation des hôtes : Un tableau détaillé qui affiche la localisation physique exacte (pays, ville, FAI, IP) des nœuds qui stockent les morceaux du fichier.
-
Vraie suppression réseau : Un panneau d’administration qui efface les métadonnées en base de données et déclenche la vraie libération des fragments (slabs) sur le réseau Sia.
Architecture technique
-
Frontend & API : Next.js 15 (App Router, TypeScript, Tailwind CSS, icônes Lucide).
-
Proxy Serverless : Netlify Functions (faisant le pont pour gérer les flux et masquer les clés).
-
Intégration Stockage : SDK
@siafoundation/sia-storageconnecté à l’indexeursia.storage. -
Base de données : Supabase (PostgreSQL) pour les métadonnées, les vues et les votes.
Les galères techniques résolues
Développer ça sur une architecture serverless en une nuit a amené quelques défis intéressants :
-
Limites du Serverless : Les fonctions Netlify imposent un payload max de 6 Mo et un timeout de 10 secondes. J’ai fixé la limite à 5 Mo et structuré la route d’envoi pour transmettre le flux directement à
@siafoundation/sia-storageavant d’épingler l’objet (sdk.pinObject()). -
Suppression logique vs Purge réelle : Au début, supprimer un fichier nettoyait uniquement la base de données Supabase, mais les morceaux restaient épinglés sur les hôtes Sia. J’ai mis à jour la route de suppression pour appeler
await sdk.deleteObject(siaObjectId)suivi deawait sdk.pruneSlabs(), ce qui libère réellement l’espace chez les hôtes. -
Affichage direct des images : Par défaut, le SDK force le téléchargement (
Content-Disposition: attachment). J’ai ajouté un paramètremode=viewà l’API : elle analyse l’extension du fichier, applique le bonContent-Type(ex :image/png,image/webp) et renvoie le flux eninlinepour que l’image s’affiche directement dans le navigateur ou sur un site externe. -
Géolocalisation des hôtes : Résoudre la localisation des 30 clés d’hôtes
ed25519n’a pas été simple. Interrogerip-api.comen parallèle provoquait des blocages anti-spam (erreurs 429), et l’API Siascan renvoyait des 404. J’ai résolu le problème en utilisant l’API publique du projet open-source HostScore (api.hostscore.info/v1/hosts/host?host=), qui indexe le réseau et renvoie l’IP, la ville, le pays et le FAI en une seule requête propre.
Question sur la marque Sia
L’application s’appelle actuellement « Sia Public Share ».
-
L’utilisation du nom « Sia » est-elle autorisée pour les projets communautaires ?
-
Dois-je ajouter une mention légale spécifique en bas de page (ex : « Sia Public Share est un projet indépendant et n’est pas affilié à la Sia Foundation ») ?
-
Si le nom pose problème, je le changerai sans souci (par exemple en SlabShare).
Tester l’application
Démo en ligne : https://sia-public-share.netlify.app
N’hésitez pas à me donner vos avis ou à me remonter des bugs !