Skip to content
fizzexualPublic

About

Self-hosted cloud drive on Next.js and PostgreSQL: upload, organize and share files, WebDAV mount, 2FA, per-user quotas and an admin panel in one Docker service. A lighter Nextcloud alternative. 🌱

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

25 Commits

Folders and files

Repository files navigation

πŸ“¦ Stackfile 🌱

Self-hosted file storage, reimagined.

A modern, dark, self-hostable cloud drive β€” upload, organize, and share your files from your own server. Nextcloud-inspired, rebuilt from scratch on a 2026 stack, and designed to run as a single service you can actually own.

status Next.js TypeScript PostgreSQL better-auth License

Quick start Β· Self-hosting Β· Architecture Β· Roadmap

About

Stackfile is a self-hosted cloud drive: a single Next.js service backed by PostgreSQL that stores your files on your own disk and lets you browse, share and mount them over WebDAV. It is for individuals and small teams who want their own file storage without running a full Nextcloud install. The core phases (files, sharing, admin, 2FA/OAuth, search, WebDAV) are built; passkeys, versioning and content search are still on the roadmap, and there are no tagged releases yet.


✨ Features

Everything below is built and working today:

πŸ—„οΈ Files

  • Drag-and-drop upload with live progress (streamed straight to disk)
  • Download, folders (create / rename), breadcrumb navigation, list & grid views
  • Trash β€” soft-delete β†’ restore β†’ delete-forever (with blob cleanup)
  • Favorites, a file details panel, and type-aware icons
  • Search across your files & folders by name
  • Mount as a network drive via WebDAV (Finder / Explorer / mobile) β€” secured with a per-user app password

πŸ”— Sharing

  • Public share links with optional password (scrypt-hashed) and expiry
  • Password-gated public download pages; create / list / revoke from a file's details

πŸ‘€ Accounts & security

  • Email + password auth (better-auth), 7-day sessions
  • Two-factor authentication (TOTP) with QR setup + backup codes β€” login is challenged and the session stays locked until the code is verified
  • OAuth (Google / GitHub) β€” activates automatically when credentials are set
  • Settings page: profile, change password, 2FA, connected accounts

πŸ›‘οΈ Multi-user & admin

  • The first registered user becomes the instance admin
  • Admin panel β€” instance stats + user management (promote/demote, delete)
  • Per-user storage quotas, enforced on upload, with a sidebar usage bar

πŸ“Š Audit

  • Activity log β€” uploads, folder ops, shares, trash / restore / delete, favorites

πŸ–ΌοΈ A look at it

Stackfile is a dark, three-pane file manager β€” sidebar Β· file list Β· details β€” on a near-black #010003 canvas with a purple β†’ magenta β†’ coral brand gradient. Clone it and run locally (below) to explore; the demo seeds a few files.

🧱 Tech stack

Layer Choice
Framework Next.js 16 (App Router, React 19) β€” full-stack, one service
Language TypeScript 6, end to end
Styling Tailwind CSS v4, Inter + Azeret Mono
Database PostgreSQL 17 + Drizzle ORM (type-safe, snake_case)
Auth better-auth β€” password, 2FA (TOTP), OAuth, sessions
Storage Pluggable StorageProvider β€” local disk today, S3-ready
Infra Docker Compose (Postgres + Redis + migrate + app) + GitHub Actions CI

Built as a modular monolith: one deployable service, cleanly split internally (auth Β· files Β· sharing Β· admin Β· activity). See ARCHITECTURE.md.

πŸš€ Quick start

pnpm install
cp .env.example .env                   # then set BETTER_AUTH_SECRET
docker compose up -d postgres redis    # Postgres :5544, Redis :6379
pnpm db:migrate
pnpm dev                               # β†’ http://localhost:4000

The first account you create becomes the admin.

🐳 Self-hosting

cp .env.example .env                   # set a strong BETTER_AUTH_SECRET
docker compose up -d --build           # Postgres + Redis + migrations + app

Serves on http://localhost:4000; uploaded files persist in the storagedata volume.

βš™οΈ Configuration

All config is via environment variables (see .env.example):

Variable Description Default
DATABASE_URL PostgreSQL connection string β€”
BETTER_AUTH_SECRET Auth signing secret (openssl rand -base64 32) β€”
STORAGE_LOCAL_PATH Which disk / folder files live in ./storage-data
STORAGE_MAX_UPLOAD_BYTES Max single-upload size 5 GiB
GITHUB_CLIENT_ID / _SECRET Enable GitHub OAuth β€”
GOOGLE_CLIENT_ID / _SECRET Enable Google OAuth β€”

Choose where files live: point STORAGE_LOCAL_PATH at any disk or folder (D:/StackfileData, /mnt/bigdisk/stackfile, …).

πŸ“ Project structure

src/
  app/
    (auth)/          sign in / sign up
    (app)/           files Β· search Β· activity Β· trash Β· admin Β· settings
    s/[token]/       public share pages
    api/             upload Β· download Β· auth Β· public share download
  lib/
    auth/  db/  storage/  files/  sharing/  admin/  activity/  env.ts
drizzle/             generated SQL migrations
docker-compose.yml   postgres Β· redis Β· migrate Β· app

πŸ—ΊοΈ Roadmap

Phase What Status
P0 Foundation β€” scaffold, config, storage, schema, Docker, CI βœ…
P1 Auth β€” email/password + sessions βœ…
P2 Files β€” upload/download/folders/trash/favorites βœ…
P3 Sharing β€” public links (password + expiry) βœ…
P4 Admin β€” panel + per-user quotas βœ…
P5 Advanced auth β€” TOTP 2FA, OAuth, settings βœ…
P6 Search + activity log βœ…
Flex WebDAV β€” mount as a network drive βœ…
β€” passkeys, organizations, versioning, realtime, content search πŸ”œ

πŸ“„ License

MIT Β© Fizzexual

About

Self-hosted cloud drive on Next.js and PostgreSQL: upload, organize and share files, WebDAV mount, 2FA, per-user quotas and an admin panel in one Docker service. A lighter Nextcloud alternative. 🌱

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages