Skip to content

yellareddymaheshreddy/tvault

Repository files navigation

πŸ” T-Vault β€” Temporary Text & URL Sharing (No Login Required)

MIT License Next.js TypeScript Redis

T-Vault is a minimalist Next.js web app that enables quick, no-login sharing of text and URLs via unique keys. Perfect for passing code snippets, notes, or short links between devicesβ€”especially useful in exam scenarios or when you need fast cross-device access. All data is stored in Redis Cloud and automatically expires after 24 hours.

πŸ”— Live Demo: https://tvault.mahs.me
πŸ“¦ Repository: github.com/yellareddymaheshreddy/tvault
πŸ“– API Docs: API.md


✨ Features

  • Text Vault: Save and retrieve plain text snippets with a custom key
  • URL Shortener: Generate short links with optional custom aliases and QR codes
  • No Authentication: Zero signup, no passwords, no tracking
  • Auto-Expiration: All data deleted after ~24 hours
  • Keyboard Shortcuts: Power-user friendly (Ctrl+K, Ctrl+S, Ctrl+R, etc.)
  • Accessible & Responsive: Works on any device, optimized for mobile and desktop

πŸ“± Ecosystem & Tools

TVault is available wherever you work. Choose the interface that fits your workflow:

Platform 🌐 Web App πŸ’» CLI Tool πŸ“± Mobile App
Best For Quick sharing (No install) Developers & Terminal usage On-the-go access
Interface Next.js Website Command Line React Native (Expo)
Install None npm i -g tvault-cli Download / Clone
Link Launch Web View CLI Repo View App Repo

πŸ–₯️ CLI Tool

The official command-line interface for TVault.

Installation:

npm i -g tvault-cli

Usage:

tvault shorten <url>   # Shorten a URL
tvault store "hello"   # Store text securely
tvault get <key>       # Retrieve data

View full CLI documentation

πŸ“± Mobile App

The official React Native client (Expo) for Android and iOS.

  • Features: Anonymous storage, Auto-expiry, QR Code support.
  • Tech Stack: React Native, Expo, NativeWind.

View Mobile App Repository


πŸš€ Getting Started

Prerequisites

  • Node.js (v18 or newer recommended)
  • Redis Cloud account (free tier works great) or local Redis instance

Installation

  1. Clone the repository:

    git clone https://github.com/yellareddymaheshreddy/tvault.git
    cd tvault
  2. Install dependencies:

    npm install
    # or
    pnpm install
    # or
    yarn install
  3. Configure Redis: Create a .env.local file at the project root:

    REDIS_URL=redis://default:yourpassword@your-redis-host:port

    Replace with your Redis Cloud connection string or local Redis URL.

  4. Run the development server:

    npm run dev

    Open http://localhost:3000 in your browser.

  5. Build for production:

    npm run build
    npm run start

πŸ“‚ Project Structure

tvault/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ page.tsx            # Main landing page (text vault + URL shortener)
β”‚   β”œβ”€β”€ layout.tsx          # Site-wide layout with nav and footer
β”‚   β”œβ”€β”€ privacy/page.tsx    # Privacy policy
β”‚   β”œβ”€β”€ terms/page.tsx      # Terms of service
β”‚   β”œβ”€β”€ settings/page.tsx   # About & settings page
β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”œβ”€β”€ text/route.ts   # POST & GET endpoints for text vault
β”‚   β”‚   β”œβ”€β”€ shorten/route.ts # POST endpoint to shorten URLs
β”‚   β”‚   └── t/[id]/route.ts # Retrieve text via /api/t/:id
β”‚   └── u/[id]/route.ts     # Redirect to original URL via /u/:id
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ ui/                 # Reusable UI components (Button, Card, etc.)
β”‚   β”œβ”€β”€ copy-button.tsx     # One-click copy to clipboard
β”‚   └── keyboard-shortcuts.tsx # Modal with keyboard shortcuts
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ redis.ts            # Redis client setup
β”‚   └── utils.ts            # Utility functions (cn, etc.)
└── public/
    β”œβ”€β”€ robots.txt
    └── sitemap.xml

πŸ”Œ API Reference

Text Vault

Store text:

curl -X POST http://localhost:3000/api/text \
  -H "Content-Type: application/json" \
  -d '{"key":"mykey","text":"Hello World"}'

Retrieve text:

curl http://localhost:3000/api/text?key=mykey
# or via the short alias:
curl http://localhost:3000/api/t/mykey

URL Shortener

Shorten a URL:

curl -X POST http://localhost:3000/api/shorten \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/very/long/path","key":"short"}'

Returns {"code":"short"} if custom key provided, or auto-generated code.

Access the short URL:

http://localhost:3000/u/short

Redirects to the original URL.


⌨️ Keyboard Shortcuts

Press Ctrl+? (or Ctrl+/) to view all shortcuts:

Shortcut Action
Ctrl+K Focus storage key input
Ctrl+S Save text
Ctrl+R Retrieve text
Ctrl+L Shorten URL
Ctrl+1 Switch to Text Vault tab
Ctrl+2 Switch to URL Shortener tab
Esc Close dialogs

πŸ›‘οΈ Privacy & Terms

  • Privacy Policy: /privacy β€” Details how data is stored and auto-deleted.
  • Terms of Service: /terms β€” Guidelines for acceptable use.

⚠️ Important: Data is stored in plain text on Redis Cloud. Do not store passwords, personal information, or anything sensitive.


🀝 Contributing

Contributions are welcome! Feel free to:

  • Open an issue for bugs or feature requests
  • Submit a pull request with improvements or fixes
  • Share feedback and ideas

πŸ“œ License

This project is open-source and available under the MIT License.


πŸ’¬ Contact & Support


Built with Next.js, Redis, and shadcn/ui. Designed for speed and simplicity.

About

A fast, free, and open-source temporary text storage and URL shortener built with Next.js and Redis. Share text or links instantly, no sign-up required.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Contributors