Update README.md
Browse files
README.md
CHANGED
|
@@ -8,336 +8,3 @@ sdk_version: '1.0'
|
|
| 8 |
app_file: Dockerfile
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
-
|
| 12 |
-
<div align="center">
|
| 13 |
-
|
| 14 |
-
# TriChat
|
| 15 |
-
|
| 16 |
-
### Temporary anonymous rooms for quick file sharing between devices.
|
| 17 |
-
|
| 18 |
-
No account. No phone login. No personal messenger on shared PCs.
|
| 19 |
-
|
| 20 |
-
**Open a room. Share what you need. Everything clears after 5 hours.**
|
| 21 |
-
|
| 22 |
-
<p>
|
| 23 |
-
<a href="https://huggingface.co/spaces/parthmax/TriChat"><img alt="Live Demo" src="https://img.shields.io/badge/Live%20Demo-Hugging%20Face-ffcc4d?style=for-the-badge" /></a>
|
| 24 |
-
<img alt="FastAPI" src="https://img.shields.io/badge/FastAPI-009688?style=for-the-badge&logo=fastapi&logoColor=white" />
|
| 25 |
-
<img alt="WebSockets" src="https://img.shields.io/badge/WebSockets-Realtime-3b82f6?style=for-the-badge" />
|
| 26 |
-
<img alt="Temporary" src="https://img.shields.io/badge/Auto%20Delete-5%20Hours-f472b6?style=for-the-badge" />
|
| 27 |
-
</p>
|
| 28 |
-
|
| 29 |
-
<p>
|
| 30 |
-
<a href="https://huggingface.co/spaces/parthmax/TriChat"><b>Live Demo</b></a>
|
| 31 |
-
·
|
| 32 |
-
<a href="#quick-start"><b>Quick Start</b></a>
|
| 33 |
-
·
|
| 34 |
-
<a href="#the-little-office-problem"><b>Story</b></a>
|
| 35 |
-
·
|
| 36 |
-
<a href="#how-it-works"><b>Architecture</b></a>
|
| 37 |
-
</p>
|
| 38 |
-
|
| 39 |
-
</div>
|
| 40 |
-
|
| 41 |
-
<p align="center">
|
| 42 |
-
<img src="docs/images/trichat-hero-banner.png" alt="TriChat hero banner" width="100%" />
|
| 43 |
-
</p>
|
| 44 |
-
|
| 45 |
-
```text
|
| 46 |
-
[ PC-1 ] ---- room: project-drop ---- [ PC-2 ]
|
| 47 |
-
\ /
|
| 48 |
-
\---- files, links, notes, images ---/
|
| 49 |
-
|
| 50 |
-
temporary by design: 5 hours
|
| 51 |
-
```
|
| 52 |
-
|
| 53 |
-
<table>
|
| 54 |
-
<tr>
|
| 55 |
-
<td align="center"><b>No Login</b><br />Open a room instantly.</td>
|
| 56 |
-
<td align="center"><b>Share Fast</b><br />Drop files, links, and notes.</td>
|
| 57 |
-
<td align="center"><b>Temporary</b><br />History clears after 5 hours.</td>
|
| 58 |
-
<td align="center"><b>Any Device</b><br />Works in a browser.</td>
|
| 59 |
-
</tr>
|
| 60 |
-
</table>
|
| 61 |
-
|
| 62 |
-
---
|
| 63 |
-
|
| 64 |
-
## The Little Office Problem
|
| 65 |
-
|
| 66 |
-
| | |
|
| 67 |
-
| --- | --- |
|
| 68 |
-
| <img src="docs/images/office-problem-scene.png" alt="The little office problem" width="100%" /> | **Scene: three friends at work. Three computers. One tiny task.**<br><br>> "Can you send me that file?"<br><br>> "Sure. Wait... should I log into WhatsApp Web on your PC?"<br><br>> "Maybe email?"<br><br>> "No no, I don't want my personal account open here."<br><br>And suddenly, sharing one small file becomes a whole ritual: open a personal messenger, scan a QR code, wait for sync, remember to log out, and hope nothing private stays open. |
|
| 69 |
-
|
| 70 |
-
So TriChat started as a tiny escape hatch.
|
| 71 |
-
|
| 72 |
-
Not a social network. Not a permanent chat app. Just a quick temporary room where teammates can drop files, links, and notes without logging into personal accounts.
|
| 73 |
-
|
| 74 |
-
---
|
| 75 |
-
|
| 76 |
-
## The Idea
|
| 77 |
-
|
| 78 |
-
| | |
|
| 79 |
-
| --- | --- |
|
| 80 |
-
| **What if sharing between office PCs felt like passing a sticky note?**<br><br>1. Create a room<br>2. Tell your friend the room name<br>3. Drop files, links, or text<br>4. Leave<br>5. History disappears after 5 hours | <img src="docs/images/glowing-room-idea.png" alt="The TriChat idea moment" width="100%" /> |
|
| 81 |
-
|
| 82 |
-
That is TriChat.
|
| 83 |
-
|
| 84 |
-
| Need | TriChat Answer |
|
| 85 |
-
| --- | --- |
|
| 86 |
-
| Move a file from one PC to another | Join the same room and upload it |
|
| 87 |
-
| Avoid logging into WhatsApp or email | No account needed |
|
| 88 |
-
| Share quick links or notes | Send them as messages |
|
| 89 |
-
| Avoid long-term clutter | Auto-clears after 5 hours |
|
| 90 |
-
| Use any device | Works in a browser |
|
| 91 |
-
|
| 92 |
-
---
|
| 93 |
-
|
| 94 |
-
## Features
|
| 95 |
-
|
| 96 |
-
<table>
|
| 97 |
-
<tr>
|
| 98 |
-
<td><b>Anonymous rooms</b><br />Join with a name and room. No account ceremony.</td>
|
| 99 |
-
<td><b>Quick sharing</b><br />Send text, links, images, and files between devices.</td>
|
| 100 |
-
<td><b>Realtime chat</b><br />WebSocket-powered messages feel instant.</td>
|
| 101 |
-
</tr>
|
| 102 |
-
<tr>
|
| 103 |
-
<td><b>5-hour expiry</b><br />Messages and uploaded files are temporary by design.</td>
|
| 104 |
-
<td><b>Room cache</b><br />Small in-memory cache keeps recent room loading snappy.</td>
|
| 105 |
-
<td><b>Self-hostable</b><br />Run it locally, in Docker, or on Hugging Face Spaces.</td>
|
| 106 |
-
</tr>
|
| 107 |
-
</table>
|
| 108 |
-
|
| 109 |
-
---
|
| 110 |
-
|
| 111 |
-
## Sharing Flow
|
| 112 |
-
|
| 113 |
-
<p align="center">
|
| 114 |
-
<img src="docs/images/temp-room-flow.png" alt="TriChat sharing flow" width="82%" />
|
| 115 |
-
</p>
|
| 116 |
-
|
| 117 |
-
```mermaid
|
| 118 |
-
flowchart LR
|
| 119 |
-
A[Open TriChat] --> B[Enter name + room]
|
| 120 |
-
B --> C[Friend joins same room]
|
| 121 |
-
C --> D[Share text, links, images, files]
|
| 122 |
-
D --> E[Work gets done]
|
| 123 |
-
E --> F[History clears after 5 hours]
|
| 124 |
-
```
|
| 125 |
-
|
| 126 |
-
---
|
| 127 |
-
|
| 128 |
-
## Temporary By Design
|
| 129 |
-
|
| 130 |
-
| | |
|
| 131 |
-
| --- | --- |
|
| 132 |
-
| <img src="docs/images/auto-delete-scene.png" alt="TriChat auto delete scene" width="100%" /> | Every saved message and uploaded file gets an expiry time.<br><br>`created_at + 5 hours = expires_at`<br><br>The cleanup worker runs in the background and removes expired database messages, uploaded files, and stale cached history.<br><br>TriChat is intentionally short-lived. It is for quick exchange, not forever storage. |
|
| 133 |
-
|
| 134 |
-
---
|
| 135 |
-
|
| 136 |
-
## Quick Start
|
| 137 |
-
|
| 138 |
-
<details open>
|
| 139 |
-
<summary><b>Run TriChat locally</b></summary>
|
| 140 |
-
<br />
|
| 141 |
-
|
| 142 |
-
```bash
|
| 143 |
-
git clone https://github.com/parthmax2/TriChat.git
|
| 144 |
-
cd TriChat
|
| 145 |
-
pip install -r requirements.txt
|
| 146 |
-
```
|
| 147 |
-
|
| 148 |
-
Create your environment file:
|
| 149 |
-
|
| 150 |
-
```bash
|
| 151 |
-
cp .env.example .env
|
| 152 |
-
```
|
| 153 |
-
|
| 154 |
-
Fill in:
|
| 155 |
-
|
| 156 |
-
```env
|
| 157 |
-
SUPABASE_URL=https://your-project-ref.supabase.co
|
| 158 |
-
SUPABASE_SERVICE_ROLE_KEY=your-supabase-secret-key
|
| 159 |
-
SUPABASE_BUCKET=chat-files
|
| 160 |
-
ROOM_HISTORY_HOURS=5
|
| 161 |
-
HISTORY_CACHE_SECONDS=30
|
| 162 |
-
CLEANUP_INTERVAL_SECONDS=600
|
| 163 |
-
PORT=7860
|
| 164 |
-
```
|
| 165 |
-
|
| 166 |
-
Run it:
|
| 167 |
-
|
| 168 |
-
```bash
|
| 169 |
-
uvicorn app:app --reload --port 7860
|
| 170 |
-
```
|
| 171 |
-
|
| 172 |
-
Open:
|
| 173 |
-
|
| 174 |
-
```text
|
| 175 |
-
http://127.0.0.1:7860
|
| 176 |
-
```
|
| 177 |
-
|
| 178 |
-
</details>
|
| 179 |
-
|
| 180 |
-
---
|
| 181 |
-
|
| 182 |
-
## Setup
|
| 183 |
-
|
| 184 |
-
<details open>
|
| 185 |
-
<summary><b>1. Create The Database</b></summary>
|
| 186 |
-
<br />
|
| 187 |
-
|
| 188 |
-
In your Supabase SQL editor, run:
|
| 189 |
-
|
| 190 |
-
```text
|
| 191 |
-
supabase_schema.sql
|
| 192 |
-
```
|
| 193 |
-
|
| 194 |
-
This creates the `messages` table and adds:
|
| 195 |
-
|
| 196 |
-
- `expires_at` for 5-hour cleanup
|
| 197 |
-
- `file_path` so uploaded files can be deleted from storage
|
| 198 |
-
- indexes for faster room history
|
| 199 |
-
|
| 200 |
-
</details>
|
| 201 |
-
|
| 202 |
-
<details open>
|
| 203 |
-
<summary><b>2. Create The File Bucket</b></summary>
|
| 204 |
-
<br />
|
| 205 |
-
|
| 206 |
-
Create a public storage bucket named:
|
| 207 |
-
|
| 208 |
-
```text
|
| 209 |
-
chat-files
|
| 210 |
-
```
|
| 211 |
-
|
| 212 |
-
TriChat stores uploaded files there and deletes expired file objects during cleanup.
|
| 213 |
-
|
| 214 |
-
</details>
|
| 215 |
-
|
| 216 |
-
<details open>
|
| 217 |
-
<summary><b>3. Add Environment Variables</b></summary>
|
| 218 |
-
<br />
|
| 219 |
-
|
| 220 |
-
Use `.env.example` as your guide.
|
| 221 |
-
|
| 222 |
-
Never commit your real `.env` file.
|
| 223 |
-
|
| 224 |
-
</details>
|
| 225 |
-
|
| 226 |
-
---
|
| 227 |
-
|
| 228 |
-
## How It Works
|
| 229 |
-
|
| 230 |
-
<details open>
|
| 231 |
-
<summary><b>Architecture map</b></summary>
|
| 232 |
-
<br />
|
| 233 |
-
|
| 234 |
-
```text
|
| 235 |
-
Browser
|
| 236 |
-
|
|
| 237 |
-
| WebSocket messages
|
| 238 |
-
v
|
| 239 |
-
FastAPI app
|
| 240 |
-
|
|
| 241 |
-
| save messages / fetch room history
|
| 242 |
-
v
|
| 243 |
-
Supabase Postgres
|
| 244 |
-
|
|
| 245 |
-
| upload files / delete expired files
|
| 246 |
-
v
|
| 247 |
-
Supabase Storage
|
| 248 |
-
```
|
| 249 |
-
|
| 250 |
-
</details>
|
| 251 |
-
|
| 252 |
-
Core stack:
|
| 253 |
-
|
| 254 |
-
| Layer | Tool |
|
| 255 |
-
| --- | --- |
|
| 256 |
-
| Backend | FastAPI |
|
| 257 |
-
| Realtime | WebSockets |
|
| 258 |
-
| Database | Supabase Postgres |
|
| 259 |
-
| File storage | Supabase Storage |
|
| 260 |
-
| Deployment | Docker / Hugging Face Spaces |
|
| 261 |
-
|
| 262 |
-
---
|
| 263 |
-
|
| 264 |
-
## Test The Integration
|
| 265 |
-
|
| 266 |
-
Run:
|
| 267 |
-
|
| 268 |
-
```bash
|
| 269 |
-
python test.py
|
| 270 |
-
```
|
| 271 |
-
|
| 272 |
-
Expected result:
|
| 273 |
-
|
| 274 |
-
```text
|
| 275 |
-
Supabase database integration successful.
|
| 276 |
-
Inserted, read, and deleted test row id: ...
|
| 277 |
-
```
|
| 278 |
-
|
| 279 |
-
---
|
| 280 |
-
|
| 281 |
-
## Perfect For
|
| 282 |
-
|
| 283 |
-
<table>
|
| 284 |
-
<tr>
|
| 285 |
-
<td><b>Office teammates</b><br />Move files across shared PCs without personal logins.</td>
|
| 286 |
-
<td><b>Computer labs</b><br />Share notes and files between lab machines.</td>
|
| 287 |
-
</tr>
|
| 288 |
-
<tr>
|
| 289 |
-
<td><b>Hackathon teams</b><br />Drop links, screenshots, builds, and quick notes.</td>
|
| 290 |
-
<td><b>Support desks</b><br />Create a temporary room for fast exchange.</td>
|
| 291 |
-
</tr>
|
| 292 |
-
</table>
|
| 293 |
-
|
| 294 |
-
---
|
| 295 |
-
|
| 296 |
-
## Safety Note
|
| 297 |
-
|
| 298 |
-
TriChat is built for quick temporary exchange, not permanent private storage.
|
| 299 |
-
|
| 300 |
-
Do not share passwords, private keys, confidential company documents, or anything that should not appear in a public temporary room.
|
| 301 |
-
|
| 302 |
-
---
|
| 303 |
-
|
| 304 |
-
## The Short Story
|
| 305 |
-
|
| 306 |
-
I built TriChat because my coworkers and I often needed to move files between office PCs.
|
| 307 |
-
|
| 308 |
-
Using WhatsApp Web was annoying because nobody wanted to log into a personal account on someone else's computer.
|
| 309 |
-
|
| 310 |
-
TriChat is a temporary anonymous room: open a room, share files or links, and the history clears after 5 hours.
|
| 311 |
-
|
| 312 |
-
---
|
| 313 |
-
|
| 314 |
-
## Roadmap
|
| 315 |
-
|
| 316 |
-
<table>
|
| 317 |
-
<tr>
|
| 318 |
-
<td>Copy invite link button</td>
|
| 319 |
-
<td>Room expiry countdown in the UI</td>
|
| 320 |
-
</tr>
|
| 321 |
-
<tr>
|
| 322 |
-
<td>Drag-and-drop file upload</td>
|
| 323 |
-
<td>Dark mode</td>
|
| 324 |
-
</tr>
|
| 325 |
-
<tr>
|
| 326 |
-
<td>Optional room password</td>
|
| 327 |
-
<td>One-click deploy buttons</td>
|
| 328 |
-
</tr>
|
| 329 |
-
</table>
|
| 330 |
-
|
| 331 |
-
---
|
| 332 |
-
|
| 333 |
-
<p align="center">
|
| 334 |
-
<img src="docs/images/friends-success-scene.png" alt="TriChat friends success scene" width="100%" />
|
| 335 |
-
</p>
|
| 336 |
-
|
| 337 |
-
<div align="center">
|
| 338 |
-
|
| 339 |
-
### If TriChat saved you from logging into WhatsApp on a random PC, give it a star.
|
| 340 |
-
|
| 341 |
-
Temporary rooms. Quick sharing. No personal login.
|
| 342 |
-
|
| 343 |
-
</div>
|
|
|
|
| 8 |
app_file: Dockerfile
|
| 9 |
pinned: false
|
| 10 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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