MCPSERV.CLUB
Flare

Flare

Self-Hosted

Lightning-fast, self-hosted file sharing with screenshot integration

Active(90)
72stars
0views
Updated 9 days ago

Overview

Discover what makes Flare powerful

Flare is a lightweight, full‑stack file sharing service that can be self‑hosted behind any HTTP proxy or CDN. From a developer’s perspective, it behaves like a *single‑page API gateway* for file uploads, enriched with an administrative panel and a user portal. Files are accepted via a REST endpoint (`/api/upload`) that accepts multipart form data or raw binary streams, then persisted to a pluggable storage layer. The front‑end is a React application built with Next.js, leveraging server‑side rendering for SEO and fast initial loads. The entire codebase is open source under the MIT license, allowing in‑house modifications or forking without licensing constraints.

Front‑end

API layer

Authentication & Authorization

Storage

Overview

Flare is a lightweight, full‑stack file sharing service that can be self‑hosted behind any HTTP proxy or CDN. From a developer’s perspective, it behaves like a single‑page API gateway for file uploads, enriched with an administrative panel and a user portal. Files are accepted via a REST endpoint (/api/upload) that accepts multipart form data or raw binary streams, then persisted to a pluggable storage layer. The front‑end is a React application built with Next.js, leveraging server‑side rendering for SEO and fast initial loads. The entire codebase is open source under the MIT license, allowing in‑house modifications or forking without licensing constraints.

Architecture

  • Front‑end: Next.js 13 + React 18, using the App Router for data fetching (/api/* routes). UI components are sourced from shadcn/ui, giving a low‑boilerplate design system that can be overridden with CSS variables or custom theme files.
  • API layer: Node.js (V18+) running inside the same Next.js process. All upload handling, authentication, and admin actions are exposed via /api/* endpoints protected by NextAuth.js.
  • Authentication & Authorization: Session‑based JWTs issued by NextAuth, supporting OAuth providers or email/password. Role‑based access control (admin, user, guest) is enforced via middleware that inspects the session claim.
  • Storage: Abstracted behind a storage interface; built‑in adapters for local filesystem (/uploads) and S3-compatible services (MinIO, AWS S3, DigitalOcean Spaces). The adapter can be swapped by changing a single environment variable (STORAGE_ADAPTER).
  • Database: PostgreSQL (≥13) accessed through Prisma ORM. The schema stores users, files, metadata, and audit logs. Prisma migrations are auto‑generated from the model file and can be applied via npx prisma migrate deploy.
  • Background Jobs: OCR extraction and thumbnail generation run in a separate worker process using BullMQ (Redis‑backed). The job queue is optional; if Redis is not configured, OCR will be performed synchronously with a timeout.
  • Containerization: A single Dockerfile exposes both the web and worker processes; a multi‑stage build ensures minimal runtime size. The docker-compose.yml example ships with PostgreSQL, Redis, and MinIO services for quick local testing.

Core Capabilities

  • Upload API: POST /api/upload accepts multipart/form-data or raw binary. Returns JSON with file URL, size, MIME type, and optional OCR text.
  • Metadata API: GET /api/files/:id retrieves file metadata; supports query parameters for filtering by date, MIME type, or OCR content.
  • User & Role API: CRUD endpoints for users (/api/users) and role assignments (/api/roles).
  • URL Shortener: POST /api/shorten creates a custom alias; redirects via /s/:alias. Click analytics are stored in the database.
  • Pastebin API: POST /api/paste accepts plain text or code blocks; syntax highlighting is powered by PrismJS on the client side.
  • Webhook Support: Admins can configure outbound webhooks that fire on upload, delete, or user registration events. Payload is JSON and can be signed with a secret header.

Deployment & Infrastructure

Flare requires three external services: PostgreSQL, Redis (optional but recommended for OCR jobs), and an S3‑compatible object store or a writable filesystem. The Docker image is production‑ready; it can run behind Nginx, Traefik, or any reverse proxy that supports HTTP/2 and WebSockets (for NextAuth session polling). Horizontal scaling is straightforward: multiple web replicas share the same database and storage; Redis ensures job queue consistency. For large‑scale deployments, consider a Kubernetes Helm chart that provisions the database, Redis, and Flare pods with autoscaling rules.

Integration & Extensibility

  • Plugins: Flare exposes a simple plugin API via the plugins folder. Developers can write Node modules that hook into upload events (onUpload, onDelete) and register custom routes.
  • Custom CSS/HTML: The admin panel allows injection of arbitrary CSS and HTML snippets into the header/footer, enabling branding without code changes.
  • Third‑Party Clients: The README lists ready‑made scripts for ShareX, Flameshot, and KDE Spectacle. These scripts simply POST to the upload endpoint with a bearer token derived from the user’s session, making Flare an ideal backend for any screenshot tool.
  • Webhooks & Automation: By configuring a webhook, Flare can trigger CI pipelines, Slack notifications, or GitHub Actions whenever new files are uploaded.
  • SDK: While not bundled, the API follows REST conventions and can be consumed by any HTTP client; a lightweight TypeScript SDK is available in the packages/sdk directory for internal use.

Developer Experience

Flare’s documentation is concise yet comprehensive, covering environment variables, database migrations, and deployment scenarios. The codebase follows ESLint/Prettier standards and uses TypeScript for type safety across both server and client. Community support is active on Discord, where developers can ask questions or propose feature requests. The project’s issue tracker favors rapid response times and clear guidelines for pull requests, making contribution straightforward.

Use Cases

  • Enterprise On‑Prem File Exchange: Deploy Flare behind a corporate VPN; use S

Open SourceReady to get started?

Join the community and start self-hosting Flare today

Weekly Views

Loading...
Support Us
Most Popular

Infrastructure Supporter

$5/month

Keep our servers running and help us maintain the best directory for developers

Repository Health

Loading health data...

Information

Category
other
License
MIT
Stars
72
Technical Specs
Pricing
Open Source
Database
PostgreSQL
Docker
Official
Supported OS
LinuxDocker
Author
FlintSH
FlintSH
Last Updated
9 days ago