app
Added many features
components
feat: Implement dark/light theme toggle, user share management APIs and UI, and extend share expiry to 24 hours.
lib
fix: minio public client
prisma
Added many features
public
Initial commit from Create Next App
.dockerignore
added docker for railway
.gitignore
feat: Introduce core application features including a new UI component library, comprehensive theming, Prisma ORM, API routes for upload, sharing, and cleanup, MinIO integration, and Docker setup.
bun.lock
feat: Integrate MinIO server directly into the Docker image and migrate object storage operations from AWS S3 SDK to the native MinIO client.
dev.db
feat: Introduce core application features including a new UI component library, comprehensive theming, Prisma ORM, API routes for upload, sharing, and cleanup, MinIO integration, and Docker setup.
docker-compose.yml
change the theme
Dockerfile
fixed: minio env and remove local minio
eslint.config.mjs
Initial commit from Create Next App
next.config.ts
Initial commit from Create Next App
package.json
feat: Integrate MinIO server directly into the Docker image and migrate object storage operations from AWS S3 SDK to the native MinIO client.
postcss.config.mjs
Initial commit from Create Next App
prisma.config.ts
feat: Introduce core application features including a new UI component library, comprehensive theming, Prisma ORM, API routes for upload, sharing, and cleanup, MinIO integration, and Docker setup.
README.md
feat: Integrate MinIO server directly into the Docker image and migrate object storage operations from AWS S3 SDK to the native MinIO client.
tsconfig.json
Initial commit from Create Next App

MyFiles – Secure File Sharing

A minimal, self-hosted file sharing application built with Next.js, MinIO, and Prisma.

Features

  • Passkey-protected shares – each upload generates a unique passkey
  • Short URLs – compact /s/<id> links for easy sharing
  • 12-hour expiration – shares auto-expire after 12 hours
  • 100 MB per share – batch upload limit per share
  • 1 GB global cap – total storage across all users
  • 100 max concurrent users – prevents abuse

Tech Stack

LayerTechnology
FrameworkNext.js 16 (App Router)
LanguageTypeScript (strict)
StylingTailwind CSS v4 + CSS variables
DatabaseSQLite via Prisma ORM
StorageMinIO (S3-compatible)
RuntimeBun

Project Structure

myfiles/
├── app/
│   ├── api/
│   │   ├── upload/route.ts          # POST – upload files
│   │   ├── share/[id]/route.ts      # GET metadata, POST verify passkey
│   │   └── cron/cleanup/route.ts    # DELETE expired shares
│   ├── s/[id]/page.tsx              # Download page (passkey input)
│   ├── page.tsx                     # Upload page
│   ├── layout.tsx                   # Root layout
│   └── globals.css                  # CSS variable design tokens
├── components/
│   └── ui/index.tsx                 # Stepper, Slider, Toggle, SelectMenu
├── lib/
│   ├── minio.ts                     # MinIO client singleton
│   └── prisma.ts                    # Prisma client singleton
├── prisma/
│   └── schema.prisma                # Database schema
├── docker-compose.yml               # MinIO service
├── .env                             # Environment variables
└── package.json

Quick Start

Prerequisites

1. Start MinIO

docker-compose up -d

MinIO Console: http://localhost:9001 (user: myfilesadmin, password: myfilespassword123)

2. Install dependencies

bun install

3. Set up the database

bunx prisma db push
bunx prisma generate

4. Run the dev server

bun run dev

Open http://localhost:3000.

5. Clean up expired shares (manual trigger)

curl -X DELETE http://localhost:3000/api/cron/cleanup

Environment Variables

VariableDefaultDescription
DATABASE_URLfile:./dev.dbSQLite database path
MINIO_ENDPOINTlocalhostMinIO server host (leave as localhost for Railway)
MINIO_PORT9000MinIO API port (leave as 9000 for Railway)
MINIO_USE_SSLfalseUse HTTPS (leave as false for Railway)
MINIO_ACCESS_KEYmyfilesadminMinIO root user
MINIO_SECRET_KEYmyfilespassword123MinIO root password
MINIO_BUCKET_NAMEmyfiles-bucketBucket name for file storage