π±π» 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.

β¨ Features
π Modern Upload Experience
- Real-time Progress Tracking: Watch your uploads with live progress bars, speed monitoring, and time estimates
- Drag & Drop Interface: Intuitive file selection with modern UI/UX design
- Multiple File Support: Upload multiple files simultaneously with batch processing
- Mobile Optimized: Responsive design that works perfectly on phones and tablets
π Security & Privacy
- Local Network Only: Files never leave your network - no cloud storage involved
- Direct Transfer: Peer-to-peer file sharing between your devices
- Secure Connection: Built-in security measures for safe file transfers
- Universal Access: Works on any device with a web browser
- QR Code Connection: Quick setup via QR code scanning
- No App Installation: Pure web-based solution
π File Management
- File Explorer: Browse and download files from your PC remotely
- File Type Detection: Intelligent file type recognition with icons
- Large File Support: Handle files of any size with optimized transfer
π οΈ Quick Start
Prerequisites
Installation
-
Clone the repository
git clone https://github.com/satvikg7/twarit.git
cd twarit
-
Install dependencies
-
Build and run
Or manually:
go run cmd/twarit/twarit.go
-
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
- Navigate to the Send Files section
- Drag and drop files or click to browse
- Monitor real-time upload progress
- Files are automatically saved to the
Received
folder
Browsing Files
- Use the Browse Files section
- Navigate through your PCβs file system
- Download files directly to your device
- 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)
- Framework: Native Go HTTP server with Gorilla WebSocket
- File Handling: Multipart form processing with progress tracking
- APIs: RESTful endpoints with real-time WebSocket updates
Frontend (Vanilla JS)
- No Dependencies: Pure HTML, CSS, and JavaScript
- Modern ES6+: Classes, async/await, and modern web APIs
- Responsive Design: CSS Grid and Flexbox layouts
- Progressive Enhancement: Works without JavaScript for basic functionality
Key Technologies
- WebSocket: Real-time upload progress updates
- XMLHttpRequest: File upload with progress monitoring
- FormData API: Modern file handling
- CSS Grid/Flexbox: Responsive layouts
- QR Code Generation: Easy device connection
π Development
Adding New Features
- Backend Changes: Add handlers in
internal/handler/
- Frontend Updates: Modify files in
src/
- Routing: Update
internal/router/router.go
Building for Production
This creates optimized binaries for multiple platforms.
π€ Contributing
Contributions are welcome! Hereβs how to get started:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
)
- Commit your changes (
git commit -m 'Add amazing feature'
)
- Push to the branch (
git push origin feature/amazing-feature
)
- Open a Pull Request
Development Guidelines
- Follow Go best practices and conventions
- Write clean, commented code
- Test thoroughly on multiple devices
- Ensure responsive design compatibility
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
- Built with β€οΈ by SatvikG7
- Inspired by the need for simple, secure file sharing
- Thanks to the Go and web development communities
Star β this repository if you find it helpful!