Skip to content
svnketPublic

About

Self-hosted file upload platform built for developers

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Blobbies

Blobbies is a self-hosted file upload platform built for developers. Create a project, generate an API key, and upload files through a small SDK without building storage infrastructure yourself.

The repository contains the complete stack: a React dashboard, an Express API, a TypeScript SDK, and a vanilla JavaScript upload example.

Why Blobbies?

  • Simple integration — initialize one client and call upload().
  • Projects included — keep files organized by application or environment.
  • Secure uploads — API keys are hashed, upload URLs are short-lived, and completed uploads are protected against replacement.
  • Object storage powered by RustFS — S3-compatible storage without a managed cloud dependency.
  • Complete dashboard — manage projects, files, API keys, sessions, and themes.
  • Local-first — PostgreSQL, Redis, and RustFS run with Docker Compose.

Features

  • Email/password authentication with Better Auth
  • Project creation, editing, deletion, search, sorting, and bookmarks
  • API key creation, one-time secret reveal, and revocation
  • Single and concurrent file uploads
  • Presigned uploads directly to RustFS
  • File search, sorting, downloads, and deletion
  • IPv6-safe and per-user API rate limits
  • Responsive shadcn-based dashboard
  • Graceful API shutdown and health checks

Stack

Workspace Technology
apps/api Node.js, Express 5, Better Auth, Prisma, PostgreSQL, RustFS, Zod
apps/client React 19, TypeScript, Vite, shadcn, TanStack Query, Zustand
apps/sdk TypeScript, Fetch API, ESM and CommonJS builds
apps/example Node.js, Express, EJS, Multer, vanilla JavaScript
Infrastructure Docker Compose, PostgreSQL, Redis, RustFS

Repository Structure

blobbies/
├── apps/
│   ├── api/       Express API and Prisma schema
│   ├── client/    React dashboard
│   ├── sdk/       Local Blobbies SDK
│   └── example/   Server-rendered upload example
├── docker-compose.yaml
├── package.json
├── pnpm-lock.yaml
└── pnpm-workspace.yaml

Requirements

  • Node.js 22+
  • pnpm 10.15+
  • Docker with Docker Compose

Quick Start

1. Clone and install

git clone https://github.com/svnket/blobbies.git
cd blobbies
pnpm install

2. Start local infrastructure

docker compose up -d

This starts:

Service Address
PostgreSQL localhost:5432
Redis localhost:6379
RustFS S3 API http://localhost:9000
RustFS Console http://localhost:9001

The local RustFS Console login is admin / password123.

3. Configure environment files

cp apps/api/.env.example apps/api/.env
cp apps/client/.env.example apps/client/.env

Generate a Better Auth secret:

openssl rand -base64 32

Copy the generated value into BETTER_AUTH_SECRET in apps/api/.env. The checked-in RustFS credentials are for local development only and must be changed in production.

4. Apply database migrations

pnpm --filter @blobbies/api prisma:migrate

5. Start the workspace

pnpm dev

Open the applications:

Application URL
Dashboard http://localhost:5173
API http://localhost:3000
API health http://localhost:3000/health
API readiness http://localhost:3000/ready
Upload example http://localhost:4000
RustFS Console http://localhost:9001

First Run

  1. Create an account in the dashboard.
  2. Create a project.
  3. Open API Keys and create a key.
  4. Copy the key immediately; it is shown only once.
  5. Add the API key and project ID to apps/example/.env:
BLOBBIES_API_URL=http://localhost:3000
BLOBBIES_API_KEY=blb_live_your_key
BLOBBIES_PROJECT_ID=your_project_id
  1. Open http://localhost:4000 and upload a file.

SDK Usage

The SDK is linked locally as @blobbies/sdk. The example builds it automatically before starting.

import { Blobbies } from "@blobbies/sdk";

const blobbies = new Blobbies({
  apiKey: process.env.BLOBBIES_API_KEY!,
  baseUrl: "http://localhost:3000",
});

const file = await blobbies.upload(process.env.BLOBBIES_PROJECT_ID!, upload);

Useful SDK methods:

await blobbies.listProjects();
await blobbies.createProject({ name: "My application" });
await blobbies.listFiles(projectId);
await blobbies.getFileDownloadUrl(projectId, fileId);
await blobbies.deleteFile(projectId, fileId);
await blobbies.uploadMany(projectId, files, { concurrency: 3 });

API Overview

All project and file operations accept either a dashboard session or an API key.

Method Endpoint Purpose
GET /api/v1/projects List and filter projects
POST /api/v1/projects Create a project
PATCH /api/v1/projects/:projectId Update a project
DELETE /api/v1/projects/:projectId Delete a project and its files
POST /api/v1/projects/:projectId/bookmark Toggle a project bookmark
GET /api/v1/projects/:projectId/files List uploaded files
POST /api/v1/projects/:projectId/uploads Create an upload session
POST /api/v1/projects/:projectId/uploads/:uploadId/complete Complete an upload
GET /api/v1/projects/:projectId/files/:fileId/url Create a download URL
DELETE /api/v1/projects/:projectId/files/:fileId Delete a file
GET /api/v1/api-keys List API keys
POST /api/v1/api-keys Create an API key
DELETE /api/v1/api-keys/:apiKeyId Revoke an API key

Common Commands

Command Description
pnpm dev Start all applications
pnpm build Build the API, dashboard, and SDK
pnpm typecheck Run all TypeScript checks
pnpm lint Run client linting
pnpm --filter @blobbies/api dev Start only the API
pnpm --filter @blobbies/client dev Start only the dashboard
pnpm --filter @blobbies/example dev Start only the upload example
pnpm --filter @blobbies/example check Check example JavaScript syntax

Production Notes

  • Replace every development credential and Better Auth secret.
  • Set NODE_ENV=production, secure cookies, trusted origins, and TRUST_PROXY deliberately.
  • Use TLS for the dashboard, API, and RustFS endpoints.
  • Keep API keys on the server; never expose them in browser code.
  • Back up PostgreSQL and the RustFS data volume.
  • Run one or more API instances behind a trusted reverse proxy.

Contributing

Issues and pull requests are welcome at svnket/blobbies.

About

Self-hosted file upload platform built for developers

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages