twarit

πŸ“±πŸ’» Twarit - Simple File Sharing

Twarit is a lightweight, secure file sharing application that enables seamless file transfers between your PC and mobile devices over your local network.

Go License Platform

✨ Features

πŸš€ Modern Upload Experience

πŸ”’ Security & Privacy

🌐 Cross-Platform Compatibility

πŸ“ File Management

πŸ› οΈ Quick Start

Prerequisites

Installation

  1. Clone the repository

     git clone https://github.com/satvikg7/twarit.git
     cd twarit
    
  2. Install dependencies

     go mod download
    
  3. Build and run

     task && ./twarit.exe
    

    Or manually:

     go run cmd/twarit/twarit.go
    
  4. Connect your devices

    • Scan the QR code displayed in the terminal with your mobile device
    • Or visit the displayed URL on any device on the same network

πŸ“± Usage

Sending Files

  1. Navigate to the Send Files section
  2. Drag and drop files or click to browse
  3. Monitor real-time upload progress
  4. Files are automatically saved to the Received folder

Browsing Files

  1. Use the Browse Files section
  2. Navigate through your PC’s file system
  3. Download files directly to your device
  4. Files open in new tabs for immediate viewing

πŸ—οΈ Project Structure

twarit/
β”œβ”€β”€ cmd/twarit/           # Main application entry point
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ handler/          # HTTP request handlers
β”‚   β”œβ”€β”€ router/           # Route definitions
β”‚   └── server/           # Server configuration
β”œβ”€β”€ pkg/qr/               # QR code generation
β”œβ”€β”€ src/                  # Frontend assets
β”‚   β”œβ”€β”€ index.html        # Homepage
β”‚   β”œβ”€β”€ send.html         # Upload interface
β”‚   β”œβ”€β”€ explore.html      # File browser
β”‚   β”œβ”€β”€ main.css          # Homepage styles
β”‚   β”œβ”€β”€ send.css          # Upload page styles
β”‚   └── upload.js         # Upload functionality
└── Received/             # Uploaded files destination

πŸ”§ Technical Details

Backend (Go)

Frontend (Vanilla JS)

Key Technologies

πŸš€ Development

Adding New Features

  1. Backend Changes: Add handlers in internal/handler/
  2. Frontend Updates: Modify files in src/
  3. Routing: Update internal/router/router.go

Building for Production

task build

This creates optimized binaries for multiple platforms.

🀝 Contributing

Contributions are welcome! Here’s how to get started:

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

Development Guidelines

πŸ“ License

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

πŸ™ Acknowledgments


Star ⭐ this repository if you find it helpful!