Skip to content

P8labs/tsbin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tsbin

Simple encrypted text and file sharing service built with SvelteKit and Appwrite.

Features

  • End-to-end encryption using Web Crypto API (AES-256-GCM)
  • Share encrypted text or files
  • Auto-expiry (24 hours default, 7 days max)
  • Server-side rendering with SvelteKit
  • Minimal retro UI with Tailwind CSS
  • Appwrite backend for storage

Tech Stack

  • Frontend: SvelteKit 2.x + Svelte 5
  • Styling: Tailwind CSS 4.x
  • Backend: Appwrite (BaaS)
  • Encryption: Web Crypto API (AES-256-GCM, PBKDF2)
  • Deployment: Vercel

Quick Start

cd app
pnpm install
cp .env.example .env
# Edit .env with your Appwrite credentials
pnpm dev

Visit http://localhost:5173

Project Structure

tsbin/
├── app/              # SvelteKit application (current)
│   ├── src/lib/
│   │   ├── crypto.ts              # Encryption utilities
│   │   ├── utils.ts               # Helpers
│   │   └── services/              # Business logic layer
│   │       ├── appwrite.ts        # Appwrite client
│   │       ├── trashService.ts    # DB operations
│   │       ├── uploadService.ts   # Upload logic
│   │       └── decryptService.ts  # Decrypt logic
│   └── src/routes/
│       ├── +page.svelte           # Upload page
│       └── t/[slug]/              # Decrypt page
├── _app/             # Legacy Astro app
└── functions/        # Appwrite functions

Architecture

Separation of Concerns

The application follows a clean architecture with three layers:

  1. Services Layer (src/lib/services/): Pure business logic, no UI dependencies
  2. Utilities Layer (src/lib/): Reusable crypto and helper functions
  3. UI Layer (src/routes/): Svelte components that use services

Data Flow

Upload:

  1. User input gets validated
  2. Content encrypted with Web Crypto API
  3. Stored in Appwrite
  4. URL generated

Decrypt:

  1. Server loads encrypted data
  2. Client renders UI
  3. User enters passcode
  4. Content verified and decrypted
  5. Content displayed

Setup

See SETUP.md for step-by-step Appwrite configuration guide.

Quick Start

cd app
pnpm install
cp .env.example .env
# Edit .env with your Appwrite credentials
# Follow SETUP.md to configure Appwrite
pnpm dev

Environment Variables

PUBLIC_APPWRITE_ENDPOINT=https://cloud.appwrite.io/v1
PUBLIC_APPWRITE_PROJECT_ID=your-project-id
PUBLIC_DATABASE_ID=tsbin
PUBLIC_COLLECTION_ID=trash
PUBLIC_STORAGE_BUCKET_ID=trash-files
tsbin/
├── app/                      # Astro application
│   ├── src/
│   │   ├── lib/             # Utilities
│   │   │   ├── appwrite.ts  # Appwrite client
│   │   │   ├── crypto.ts    # Web Crypto utilities
│   │   │   └── utils.ts     # Helpers
│   │   ├── pages/
│   │   │   ├── index.astro  # Upload page
│   │   │   └── t/
│   │   │       └── [slug].astro  # View/decrypt page
│   │   └── layouts/
│   │       └── Layout.astro # Base layout
│   └── package.json
├── functions/               # Appwrite functions
└── package.json

Deployment

Vercel

Deploy to Vercel and set environment variables in th

  • All encryption happens client-side
  • Passcodes never sent to server
  • Keys derived with PBKDF2 (100,000 iterations)
  • AES-256-GCM authenticated encryption
  • Auto-expiry prevents long-term data exposure

About

A temp bin for free

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published