Skip to content

TuroYT/snowshare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

694 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

SnowShare Logo

SnowShare

SnowShare is a modern, secure file and link sharing platform built with Next.js, Prisma, and NextAuth.
It provides a clean, user-friendly interface for sharing URLs, text snippets, and files with customizable options for expiration, privacy, and access.

Features ✨

LinkShare πŸ”—

  • Share any URL with a customizable shortened link
  • Set expiration times (1 day to solar explosion) ⏳
  • Option for no expiration (authenticated users)
  • Custom slugs for personalized links
  • Password protection for enhanced security πŸ”’
  • Instant QR code generation for shared links πŸ“±

PasteShare πŸ“‹

  • Share code snippets and text with syntax highlighting 🎨
  • Support for multiple programming languages
  • Expiration options and password protection πŸ”’
  • Ideal for sharing code samples, configuration files, or any text content

FileShare πŸ“

  • Secure file uploads with size limits
  • Automatic file type detection
  • Download tracking πŸ“₯
  • Same expiration and protection features

User Management πŸ‘₯

  • User registration and authentication via NextAuth πŸ”‘

  • Frontend: Next.js 16, React 19.1, TailwindCSS 4

  • Authentication: NextAuth.js with bcrypt password hashing

  • Special Features: QR code generation, custom URL slugs

Getting Started πŸš€

  • Node.js 24+ and npm/yarn
  • PostgreSQL database

Prerequisites βœ…

  • Node.js 24+ and npm/yarn

  • PostgreSQL database

  • Node.js 24+ and npm/yarn

  • PostgreSQL database

Installation πŸ› οΈ

  1. Clone the repository

    git clone https://github.com/TuroYT/snowshare
    cd snowshare
    
  2. Install dependencies

    npm install
    
  3. Set up environment variables Create a .env file in the root directory with the following variables:

    # Database
    DATABASE_URL="postgresql://username:password@localhost:5432/snowshare"
    
    # NextAuth
    NEXTAUTH_URL="http://localhost:3000"
    NEXTAUTH_SECRET="your-secret-key"
    
    # Auth (allow or disallow user signups)
    ALLOW_SIGNUP=true
    

Docker

Quick start (Docker Hub)

The easiest way to run SnowShare β€” no build needed, PostgreSQL included.

Option A β€” docker-compose (recommended)

  1. Create a docker-compose.yml:
version: "3.9"

services:
  db:
    image: postgres:16-alpine
    restart: unless-stopped
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: snowshare
    volumes:
      - db-data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 5s
      timeout: 5s
      retries: 10

  app:
    image: turodev/snowshare:latest
    restart: unless-stopped
    depends_on:
      db:
        condition: service_healthy
    environment:
      DATABASE_URL: postgres://postgres:postgres@db:5432/snowshare
      NEXTAUTH_URL: http://localhost:3000 # Change to your public URL
      NEXTAUTH_SECRET: changeme-replace-with-random-secret # Change this!
      ALLOW_SIGNUP: "true"
    ports:
      - "3000:3000"
    volumes:
      - uploads:/app/uploads

volumes:
  db-data:
  uploads:
  1. Start the stack:
docker compose up -d

Option B β€” docker run

Start PostgreSQL first:

docker run -d \
  --name snowshare-db \
  --network snowshare-net \
  -e POSTGRES_USER=postgres \
  -e POSTGRES_PASSWORD=postgres \
  -e POSTGRES_DB=snowshare \
  -v snowshare-db:/var/lib/postgresql/data \
  postgres:16-alpine

Then start SnowShare:

docker network create snowshare-net

docker run -d \
  --name snowshare \
  --network snowshare-net \
  -p 3000:3000 \
  -e DATABASE_URL="postgres://postgres:postgres@snowshare-db:5432/snowshare" \
  -e NEXTAUTH_URL="http://localhost:3000" \
  -e NEXTAUTH_SECRET="$(openssl rand -base64 32)" \
  -e ALLOW_SIGNUP="true" \
  -v snowshare-uploads:/app/uploads \
  turodev/snowshare:latest

The app will be available at http://localhost:3000.

Note: Change NEXTAUTH_URL to your public domain and use a strong NEXTAUTH_SECRET (generate one with openssl rand -base64 32).

Available tags: latest, 1.3.9, 1.3

Build from source

docker compose up -d --build
  1. Initialize the database

    npx prisma migrate dev
    
  2. Start the development server

    npm run dev
    
  3. Open http://localhost:3000 with your browser to see the result.

Project Structure πŸ—‚οΈ

/
β”œβ”€β”€ prisma/                # Prisma schema and migrations
β”œβ”€β”€ public/                # Static assets
└── src/
    β”œβ”€β”€ app/               # Next.js App Router structure
    β”‚   β”œβ”€β”€ api/           # API routes
    β”‚   β”œβ”€β”€ auth/          # Authentication pages
    β”‚   β”œβ”€β”€ protected/     # Protected slugs and shares
    β”‚   └── s/             # Short link redirects
    β”œβ”€β”€ components/        # React components
    β”œβ”€β”€ hooks/             # Custom React hooks
    └── lib/               # Utility functions and shared code

πŸ™ Acknowledgments

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License βš–οΈ

This project is licensed under the MIT License - see the LICENSE file for details.

Privacy & Analytics πŸ”’

SnowShare uses Plausible Analytics for privacy-friendly, cookie-free usage statistics. Plausible is:

  • GDPR compliant β€” No personal data collected
  • Cookie-free β€” No consent banner needed
  • Open source β€” Transparent and auditable

No personally identifiable information is collected. Analytics help us understand usage patterns to improve the project.

To disable telemetry, add to your .env:

TELEMETRY=false

To use your own Plausible instance:

PLAUSIBLE_DOMAIN=your-domain.com
PLAUSIBLE_HOST=https://your-plausible-instance.com

Star History

Star History Chart

Acknowledgments / Credits πŸ™Œ

About

A modern, secure file and link sharing platform built with Next.js, Prisma, and NextAuth. Share URLs, code snippets, and files with customizable expiration, privacy, and QR codes.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors