fluxlink 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fluxlink-0.1.0/.gitignore +52 -0
- fluxlink-0.1.0/PKG-INFO +285 -0
- fluxlink-0.1.0/README.md +244 -0
- fluxlink-0.1.0/pyproject.toml +71 -0
- fluxlink-0.1.0/src/chennalink/__init__.py +8 -0
- fluxlink-0.1.0/src/chennalink/__main__.py +94 -0
- fluxlink-0.1.0/src/chennalink/app.py +419 -0
- fluxlink-0.1.0/src/chennalink/models/__init__.py +0 -0
- fluxlink-0.1.0/src/chennalink/models/code_file.py +13 -0
- fluxlink-0.1.0/src/chennalink/models/session.py +12 -0
- fluxlink-0.1.0/src/chennalink/screens/__init__.py +0 -0
- fluxlink-0.1.0/src/chennalink/screens/chat.py +503 -0
- fluxlink-0.1.0/src/chennalink/screens/code_viewer.py +81 -0
- fluxlink-0.1.0/src/chennalink/screens/connect_session.py +74 -0
- fluxlink-0.1.0/src/chennalink/screens/create_session.py +78 -0
- fluxlink-0.1.0/src/chennalink/screens/help.py +86 -0
- fluxlink-0.1.0/src/chennalink/screens/history.py +293 -0
- fluxlink-0.1.0/src/chennalink/screens/receive.py +36 -0
- fluxlink-0.1.0/src/chennalink/screens/send.py +270 -0
- fluxlink-0.1.0/src/chennalink/screens/session.py +85 -0
- fluxlink-0.1.0/src/chennalink/screens/waiting.py +57 -0
- fluxlink-0.1.0/src/chennalink/screens/welcome.py +19 -0
- fluxlink-0.1.0/src/chennalink/server.py +176 -0
- fluxlink-0.1.0/src/chennalink/services/__init__.py +0 -0
- fluxlink-0.1.0/src/chennalink/services/clipboard.py +12 -0
- fluxlink-0.1.0/src/chennalink/services/local_storage.py +99 -0
- fluxlink-0.1.0/src/chennalink/utils/__init__.py +0 -0
- fluxlink-0.1.0/src/chennalink/widgets/__init__.py +0 -0
- fluxlink-0.1.0/src/chennalink/widgets/code_card.py +114 -0
- fluxlink-0.1.0/src/chennalink/widgets/code_editor.py +67 -0
- fluxlink-0.1.0/src/chennalink/widgets/file_queue.py +80 -0
- fluxlink-0.1.0/src/chennalink/widgets/header.py +55 -0
- fluxlink-0.1.0/src/chennalink/widgets/status_bar.py +53 -0
- fluxlink-0.1.0/src/fluxlink/__init__.py +8 -0
- fluxlink-0.1.0/src/fluxlink/__main__.py +5 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
env/
|
|
8
|
+
.venv/
|
|
9
|
+
build/
|
|
10
|
+
develop-eggs/
|
|
11
|
+
dist/
|
|
12
|
+
downloads/
|
|
13
|
+
eggs/
|
|
14
|
+
.eggs/
|
|
15
|
+
lib/
|
|
16
|
+
lib64/
|
|
17
|
+
parts/
|
|
18
|
+
sdist/
|
|
19
|
+
var/
|
|
20
|
+
wheels/
|
|
21
|
+
*.egg-info/
|
|
22
|
+
.installed.cfg
|
|
23
|
+
*.egg
|
|
24
|
+
|
|
25
|
+
# Secrets & Environment Variables
|
|
26
|
+
.env
|
|
27
|
+
.env.local
|
|
28
|
+
.env.*.local
|
|
29
|
+
*.pem
|
|
30
|
+
*.key
|
|
31
|
+
|
|
32
|
+
# Database & Local Storage
|
|
33
|
+
*.db
|
|
34
|
+
*.sqlite3
|
|
35
|
+
backend/chennalink.db
|
|
36
|
+
backend/storage_local/
|
|
37
|
+
|
|
38
|
+
# Testing & Artifacts
|
|
39
|
+
.pytest_cache/
|
|
40
|
+
.coverage
|
|
41
|
+
htmlcov/
|
|
42
|
+
.mypy_cache/
|
|
43
|
+
.ruff_cache/
|
|
44
|
+
*.log
|
|
45
|
+
|
|
46
|
+
# OS metadata
|
|
47
|
+
.DS_Store
|
|
48
|
+
Thumbs.db
|
|
49
|
+
|
|
50
|
+
# Vercel
|
|
51
|
+
.vercel/
|
|
52
|
+
|
fluxlink-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: fluxlink
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: FluxLink: Real-time lossless source-code and file transfer bridge CLI
|
|
5
|
+
Project-URL: Homepage, https://fluxlink.chennareddy.in
|
|
6
|
+
Project-URL: Repository, https://github.com/ychennakesavareddy/FluxLink
|
|
7
|
+
Author-email: Chenna Kesava Reddy <yenuguchenna6una66@gmail.com>
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: code-transfer,developer-tools,file-transfer,fluxlink,p2p,realtime,textual,tui
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Communications :: File Sharing
|
|
20
|
+
Classifier: Topic :: Utilities
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Requires-Dist: httpx>=0.25.0
|
|
23
|
+
Requires-Dist: pydantic>=2.0.0
|
|
24
|
+
Requires-Dist: pyperclip>=1.8.2
|
|
25
|
+
Requires-Dist: rich>=13.7.0
|
|
26
|
+
Requires-Dist: textual>=0.50.0
|
|
27
|
+
Requires-Dist: websockets>=12.0
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: build; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest; extra == 'dev'
|
|
31
|
+
Requires-Dist: pytest-asyncio; extra == 'dev'
|
|
32
|
+
Requires-Dist: twine; extra == 'dev'
|
|
33
|
+
Provides-Extra: server
|
|
34
|
+
Requires-Dist: fastapi>=0.100.0; extra == 'server'
|
|
35
|
+
Requires-Dist: psycopg-pool>=3.1.0; extra == 'server'
|
|
36
|
+
Requires-Dist: psycopg[binary]>=3.1.0; extra == 'server'
|
|
37
|
+
Requires-Dist: pydantic-settings>=2.0.0; extra == 'server'
|
|
38
|
+
Requires-Dist: supabase>=2.0.0; extra == 'server'
|
|
39
|
+
Requires-Dist: uvicorn>=0.23.0; extra == 'server'
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
|
|
42
|
+
# FluxLink ⚡
|
|
43
|
+
|
|
44
|
+
FluxLink is a high-speed developer tool and real-time collaboration bridge designed for instant, byte-exact, lossless source-code and file transfers across devices (Web and Terminal/CLI).
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 1. System Architecture & Domains
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
┌─────────────────────────────────┐
|
|
52
|
+
│ Cloudflare DNS (GoDaddy) │
|
|
53
|
+
└────────────────┬────────────────┘
|
|
54
|
+
│
|
|
55
|
+
┌──────────────────────────┴──────────────────────────┐
|
|
56
|
+
▼ ▼
|
|
57
|
+
┌───────────────────────────────┐ ┌───────────────────────────────────────┐
|
|
58
|
+
│ Frontend Web UI │ │ Backend ASGI & WebSockets │
|
|
59
|
+
│ https://fluxlink.chennareddy.in│ │ https://fluxlinkbackend.chennareddy.in│
|
|
60
|
+
│ (Cloudflare Pages / Edge) │ │ (AWS EC2 — Amazon Linux 2023) │
|
|
61
|
+
└───────────────┬───────────────┘ └───────────────────┬───────────────────┘
|
|
62
|
+
│ │
|
|
63
|
+
│ REST API & WebSockets (WSS) │
|
|
64
|
+
└─────────────────────────┬───────────────────────┘
|
|
65
|
+
│
|
|
66
|
+
┌───────────────────────┴───────────────────────┐
|
|
67
|
+
▼ ▼
|
|
68
|
+
┌───────────────────────────────────┐ ┌───────────────────────────────────┐
|
|
69
|
+
│ Terminal CLI Client │ │ Authoritative Cloud │
|
|
70
|
+
│ (Kali Linux / Windows / macOS) │ │ Supabase Infrastructure │
|
|
71
|
+
│ fluxlink / chennalink │ │ PostgreSQL (Sessions & History) │
|
|
72
|
+
│ Python + Textual TUI │ │ Private Storage (chennalink-files│
|
|
73
|
+
└───────────────────────────────────┘ └───────────────────────────────────┘
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
- **Frontend Domain:** `https://fluxlink.chennareddy.in`
|
|
77
|
+
- **Backend Domain:** `https://fluxlinkbackend.chennareddy.in`
|
|
78
|
+
- **WebSocket Gateway:** `wss://fluxlinkbackend.chennareddy.in/ws/{session_code}/{device_id}`
|
|
79
|
+
- **Health Endpoints:** `https://fluxlinkbackend.chennareddy.in/health` and `/api/health`
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## 2. Technologies Used
|
|
84
|
+
|
|
85
|
+
- **Backend:** Python 3.12, FastAPI, Uvicorn, Gunicorn, WebSockets, Pydantic v2.
|
|
86
|
+
- **Database & Storage:** Supabase PostgreSQL (`psycopg 3` connection pooling) + Supabase Private Storage (`chennalink-files`).
|
|
87
|
+
- **Terminal CLI:** Python Textual, Rich, Pyperclip.
|
|
88
|
+
- **Frontend:** Vanilla HTML5, modern CSS3, native WebSockets, responsive mobile & desktop layout.
|
|
89
|
+
- **Infrastructure & Proxy:** AWS EC2 (Amazon Linux 2023), Nginx (Reverse Proxy & WebSocket upgrade), Let's Encrypt (Certbot SSL), Cloudflare DNS.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 3. Local Development Setup
|
|
94
|
+
|
|
95
|
+
### 3.1 Prerequisites
|
|
96
|
+
- Python 3.12+
|
|
97
|
+
- Git
|
|
98
|
+
|
|
99
|
+
### 3.2 Installation
|
|
100
|
+
```bash
|
|
101
|
+
# Clone the repository
|
|
102
|
+
git clone https://github.com/ychennakesavareddy/FluxLink.git
|
|
103
|
+
cd FluxLink
|
|
104
|
+
|
|
105
|
+
# Create and activate virtual environment
|
|
106
|
+
python -m venv .venv
|
|
107
|
+
|
|
108
|
+
# On Linux/macOS:
|
|
109
|
+
source .venv/bin/activate
|
|
110
|
+
# On Windows PowerShell:
|
|
111
|
+
.\.venv\Scripts\Activate.ps1
|
|
112
|
+
|
|
113
|
+
# Install in editable mode
|
|
114
|
+
pip install -e .
|
|
115
|
+
pip install uvicorn[standard] pytest pytest-asyncio
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### 3.3 Configuration
|
|
119
|
+
Copy the configuration template:
|
|
120
|
+
```bash
|
|
121
|
+
cp .env.example .env
|
|
122
|
+
```
|
|
123
|
+
Fill in your Supabase project credentials in `.env`:
|
|
124
|
+
- `DATABASE_URL`: Your Supabase PostgreSQL connection URI.
|
|
125
|
+
- `SUPABASE_URL`: Your Supabase API URL.
|
|
126
|
+
- `SUPABASE_SERVICE_ROLE_KEY`: Your Supabase Service Role Key.
|
|
127
|
+
- `SUPABASE_STORAGE_BUCKET`: `chennalink-files`
|
|
128
|
+
|
|
129
|
+
### 3.4 Running Locally
|
|
130
|
+
|
|
131
|
+
**Start Backend:**
|
|
132
|
+
```bash
|
|
133
|
+
python -m uvicorn backend.main:app --host 127.0.0.1 --port 8000 --reload
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Start Terminal CLI:**
|
|
137
|
+
```bash
|
|
138
|
+
# Launch interactive TUI connected to local server
|
|
139
|
+
FLUXLINK_ENV=development fluxlink
|
|
140
|
+
# Or using the backend flag
|
|
141
|
+
fluxlink --backend http://127.0.0.1:8000
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**Open Web Interface:**
|
|
145
|
+
Navigate to `http://127.0.0.1:8000/web` in your browser.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## 4. FluxLink CLI Guide (Kali Linux / Terminal)
|
|
150
|
+
|
|
151
|
+
The CLI provides a full keyboard-driven terminal UI (TUI) for sending and receiving code without breaking indentation or file fidelity.
|
|
152
|
+
|
|
153
|
+
### Commands
|
|
154
|
+
|
|
155
|
+
| Command | Action |
|
|
156
|
+
| :--- | :--- |
|
|
157
|
+
| `fluxlink` | Launch interactive TUI connected to production backend |
|
|
158
|
+
| `fluxlink send <path>` | Launch TUI and automatically preload `<path>` for sending |
|
|
159
|
+
| `fluxlink receive` | Jump directly into incoming transfer queue |
|
|
160
|
+
| `fluxlink history` | Jump directly into transfer history and inspector |
|
|
161
|
+
| `fluxlink session` | View active session code, connected devices, and status |
|
|
162
|
+
| `fluxlink --backend <url>` | Override backend URL (e.g. `http://127.0.0.1:8000`) |
|
|
163
|
+
| `fluxlink help` | Print command line cheatsheet |
|
|
164
|
+
|
|
165
|
+
### Keyboard Shortcuts in TUI
|
|
166
|
+
|
|
167
|
+
- `Ctrl + T`: WhatsApp-style Real-Time Chat Timeline
|
|
168
|
+
- `Ctrl + 1`: Send File (open file by path or paste code)
|
|
169
|
+
- `Ctrl + 2`: Receive Queue (browse incoming files & download)
|
|
170
|
+
- `Ctrl + 3`: History Screen (inspect past transfers & exact bytes)
|
|
171
|
+
- `Ctrl + 4`: Session Screen (view session code & participant roster)
|
|
172
|
+
- `Ctrl + H`: Help & Shortcuts Screen
|
|
173
|
+
- `Ctrl + Q`: Quit Application
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## 5. AWS EC2 Backend Deployment (Amazon Linux 2023)
|
|
178
|
+
|
|
179
|
+
### 5.1 EC2 Security Group Configuration
|
|
180
|
+
|
|
181
|
+
In AWS Console > EC2 > Security Groups, configure:
|
|
182
|
+
|
|
183
|
+
| Protocol | Port | Source | Purpose |
|
|
184
|
+
| :--- | :--- | :--- | :--- |
|
|
185
|
+
| **SSH** | 22 | `YOUR_IP/32` | Administrative access (restricted to your IP) |
|
|
186
|
+
| **HTTP** | 80 | `0.0.0.0/0` | Public HTTP-to-HTTPS redirect & Certbot challenges |
|
|
187
|
+
| **HTTPS** | 443 | `0.0.0.0/0` | Secure public API and WebSocket connections |
|
|
188
|
+
|
|
189
|
+
> **Note:** Port 8000 should **not** be open to the internet. It binds only to `127.0.0.1` and is proxied through Nginx on port 443.
|
|
190
|
+
|
|
191
|
+
### 5.2 Elastic IP Allocation
|
|
192
|
+
Allocate an AWS Elastic IP and associate it with your EC2 instance. This prevents the public IP from changing upon instance reboot.
|
|
193
|
+
|
|
194
|
+
### 5.3 Automated Server Setup
|
|
195
|
+
SSH into your EC2 instance from Kali Linux:
|
|
196
|
+
```bash
|
|
197
|
+
ssh -i /path/to/key.pem ec2-user@<YOUR_ELASTIC_IP>
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Run the automated deployment script located in `deploy/deploy_ec2.sh`:
|
|
201
|
+
```bash
|
|
202
|
+
# Clone repository
|
|
203
|
+
sudo mkdir -p /opt/fluxlink
|
|
204
|
+
sudo chown -R ec2-user:ec2-user /opt/fluxlink
|
|
205
|
+
git clone https://github.com/ychennakesavareddy/FluxLink.git /opt/fluxlink
|
|
206
|
+
cd /opt/fluxlink
|
|
207
|
+
|
|
208
|
+
# Run automated deployment
|
|
209
|
+
chmod +x deploy/deploy_ec2.sh
|
|
210
|
+
./deploy/deploy_ec2.sh
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### 5.4 Configure Production `.env`
|
|
214
|
+
Edit `/opt/fluxlink/.env` on the server and add your Supabase credentials:
|
|
215
|
+
```bash
|
|
216
|
+
nano /opt/fluxlink/.env
|
|
217
|
+
```
|
|
218
|
+
Restart the service:
|
|
219
|
+
```bash
|
|
220
|
+
sudo systemctl restart fluxlinkbackend
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### 5.5 Obtain SSL Certificate with Certbot
|
|
224
|
+
Once DNS is pointed:
|
|
225
|
+
```bash
|
|
226
|
+
sudo certbot --nginx -d fluxlinkbackend.chennareddy.in
|
|
227
|
+
sudo systemctl restart nginx
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## 6. Frontend Deployment (Cloudflare Pages)
|
|
233
|
+
|
|
234
|
+
Because your domain `chennareddy.in` is already managed through Cloudflare DNS, **Cloudflare Pages** is the recommended zero-maintenance hosting solution for the frontend:
|
|
235
|
+
|
|
236
|
+
1. In the **Cloudflare Dashboard**, navigate to **Workers & Pages** > **Create application** > **Pages** > **Connect to Git**.
|
|
237
|
+
2. Select repository: `ychennakesavareddy/FluxLink`.
|
|
238
|
+
3. Build configuration:
|
|
239
|
+
- Framework preset: `None`
|
|
240
|
+
- Build command: *(leave empty)*
|
|
241
|
+
- Build output directory: `web`
|
|
242
|
+
4. Deploy site.
|
|
243
|
+
5. In your Pages project settings, go to **Custom Domains** > **Set up a custom domain**:
|
|
244
|
+
- Enter: `fluxlink.chennareddy.in`
|
|
245
|
+
- Cloudflare will automatically route the CNAME and provision universal SSL.
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## 7. Cloudflare DNS Configuration
|
|
250
|
+
|
|
251
|
+
In your Cloudflare DNS management for `chennareddy.in`, configure:
|
|
252
|
+
|
|
253
|
+
| Type | Name | Content / Target | Proxy status |
|
|
254
|
+
| :--- | :--- | :--- | :--- |
|
|
255
|
+
| **A** | `fluxlinkbackend` | `<YOUR_EC2_ELASTIC_IP>` | DNS only (Grey Cloud) during Certbot, then Proxied (Orange Cloud) |
|
|
256
|
+
| **CNAME** | `fluxlink` | `<YOUR_CLOUDFLARE_PAGES_DOMAIN>` (e.g. `fluxlink.pages.dev`) | Proxied (Orange Cloud) |
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## 8. Testing & Verification
|
|
261
|
+
|
|
262
|
+
Run the test suite:
|
|
263
|
+
```bash
|
|
264
|
+
# Run all unit, UI, and production enforcement tests
|
|
265
|
+
pytest -k "not live" -v
|
|
266
|
+
|
|
267
|
+
# Run live Supabase integration tests (requires live .env)
|
|
268
|
+
pytest tests/test_live_supabase_integration.py -v
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Health Check Verification
|
|
272
|
+
```bash
|
|
273
|
+
curl https://fluxlinkbackend.chennareddy.in/health
|
|
274
|
+
```
|
|
275
|
+
Expected response:
|
|
276
|
+
```json
|
|
277
|
+
{
|
|
278
|
+
"status": "healthy",
|
|
279
|
+
"service": "fluxlink",
|
|
280
|
+
"database": "PostgresRepository",
|
|
281
|
+
"database_backend": "postgres",
|
|
282
|
+
"storage_backend": "supabase",
|
|
283
|
+
"storage_bucket": "chennalink-files"
|
|
284
|
+
}
|
|
285
|
+
```
|
fluxlink-0.1.0/README.md
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# FluxLink ⚡
|
|
2
|
+
|
|
3
|
+
FluxLink is a high-speed developer tool and real-time collaboration bridge designed for instant, byte-exact, lossless source-code and file transfers across devices (Web and Terminal/CLI).
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. System Architecture & Domains
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
┌─────────────────────────────────┐
|
|
11
|
+
│ Cloudflare DNS (GoDaddy) │
|
|
12
|
+
└────────────────┬────────────────┘
|
|
13
|
+
│
|
|
14
|
+
┌──────────────────────────┴──────────────────────────┐
|
|
15
|
+
▼ ▼
|
|
16
|
+
┌───────────────────────────────┐ ┌───────────────────────────────────────┐
|
|
17
|
+
│ Frontend Web UI │ │ Backend ASGI & WebSockets │
|
|
18
|
+
│ https://fluxlink.chennareddy.in│ │ https://fluxlinkbackend.chennareddy.in│
|
|
19
|
+
│ (Cloudflare Pages / Edge) │ │ (AWS EC2 — Amazon Linux 2023) │
|
|
20
|
+
└───────────────┬───────────────┘ └───────────────────┬───────────────────┘
|
|
21
|
+
│ │
|
|
22
|
+
│ REST API & WebSockets (WSS) │
|
|
23
|
+
└─────────────────────────┬───────────────────────┘
|
|
24
|
+
│
|
|
25
|
+
┌───────────────────────┴───────────────────────┐
|
|
26
|
+
▼ ▼
|
|
27
|
+
┌───────────────────────────────────┐ ┌───────────────────────────────────┐
|
|
28
|
+
│ Terminal CLI Client │ │ Authoritative Cloud │
|
|
29
|
+
│ (Kali Linux / Windows / macOS) │ │ Supabase Infrastructure │
|
|
30
|
+
│ fluxlink / chennalink │ │ PostgreSQL (Sessions & History) │
|
|
31
|
+
│ Python + Textual TUI │ │ Private Storage (chennalink-files│
|
|
32
|
+
└───────────────────────────────────┘ └───────────────────────────────────┘
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
- **Frontend Domain:** `https://fluxlink.chennareddy.in`
|
|
36
|
+
- **Backend Domain:** `https://fluxlinkbackend.chennareddy.in`
|
|
37
|
+
- **WebSocket Gateway:** `wss://fluxlinkbackend.chennareddy.in/ws/{session_code}/{device_id}`
|
|
38
|
+
- **Health Endpoints:** `https://fluxlinkbackend.chennareddy.in/health` and `/api/health`
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 2. Technologies Used
|
|
43
|
+
|
|
44
|
+
- **Backend:** Python 3.12, FastAPI, Uvicorn, Gunicorn, WebSockets, Pydantic v2.
|
|
45
|
+
- **Database & Storage:** Supabase PostgreSQL (`psycopg 3` connection pooling) + Supabase Private Storage (`chennalink-files`).
|
|
46
|
+
- **Terminal CLI:** Python Textual, Rich, Pyperclip.
|
|
47
|
+
- **Frontend:** Vanilla HTML5, modern CSS3, native WebSockets, responsive mobile & desktop layout.
|
|
48
|
+
- **Infrastructure & Proxy:** AWS EC2 (Amazon Linux 2023), Nginx (Reverse Proxy & WebSocket upgrade), Let's Encrypt (Certbot SSL), Cloudflare DNS.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## 3. Local Development Setup
|
|
53
|
+
|
|
54
|
+
### 3.1 Prerequisites
|
|
55
|
+
- Python 3.12+
|
|
56
|
+
- Git
|
|
57
|
+
|
|
58
|
+
### 3.2 Installation
|
|
59
|
+
```bash
|
|
60
|
+
# Clone the repository
|
|
61
|
+
git clone https://github.com/ychennakesavareddy/FluxLink.git
|
|
62
|
+
cd FluxLink
|
|
63
|
+
|
|
64
|
+
# Create and activate virtual environment
|
|
65
|
+
python -m venv .venv
|
|
66
|
+
|
|
67
|
+
# On Linux/macOS:
|
|
68
|
+
source .venv/bin/activate
|
|
69
|
+
# On Windows PowerShell:
|
|
70
|
+
.\.venv\Scripts\Activate.ps1
|
|
71
|
+
|
|
72
|
+
# Install in editable mode
|
|
73
|
+
pip install -e .
|
|
74
|
+
pip install uvicorn[standard] pytest pytest-asyncio
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 3.3 Configuration
|
|
78
|
+
Copy the configuration template:
|
|
79
|
+
```bash
|
|
80
|
+
cp .env.example .env
|
|
81
|
+
```
|
|
82
|
+
Fill in your Supabase project credentials in `.env`:
|
|
83
|
+
- `DATABASE_URL`: Your Supabase PostgreSQL connection URI.
|
|
84
|
+
- `SUPABASE_URL`: Your Supabase API URL.
|
|
85
|
+
- `SUPABASE_SERVICE_ROLE_KEY`: Your Supabase Service Role Key.
|
|
86
|
+
- `SUPABASE_STORAGE_BUCKET`: `chennalink-files`
|
|
87
|
+
|
|
88
|
+
### 3.4 Running Locally
|
|
89
|
+
|
|
90
|
+
**Start Backend:**
|
|
91
|
+
```bash
|
|
92
|
+
python -m uvicorn backend.main:app --host 127.0.0.1 --port 8000 --reload
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Start Terminal CLI:**
|
|
96
|
+
```bash
|
|
97
|
+
# Launch interactive TUI connected to local server
|
|
98
|
+
FLUXLINK_ENV=development fluxlink
|
|
99
|
+
# Or using the backend flag
|
|
100
|
+
fluxlink --backend http://127.0.0.1:8000
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Open Web Interface:**
|
|
104
|
+
Navigate to `http://127.0.0.1:8000/web` in your browser.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## 4. FluxLink CLI Guide (Kali Linux / Terminal)
|
|
109
|
+
|
|
110
|
+
The CLI provides a full keyboard-driven terminal UI (TUI) for sending and receiving code without breaking indentation or file fidelity.
|
|
111
|
+
|
|
112
|
+
### Commands
|
|
113
|
+
|
|
114
|
+
| Command | Action |
|
|
115
|
+
| :--- | :--- |
|
|
116
|
+
| `fluxlink` | Launch interactive TUI connected to production backend |
|
|
117
|
+
| `fluxlink send <path>` | Launch TUI and automatically preload `<path>` for sending |
|
|
118
|
+
| `fluxlink receive` | Jump directly into incoming transfer queue |
|
|
119
|
+
| `fluxlink history` | Jump directly into transfer history and inspector |
|
|
120
|
+
| `fluxlink session` | View active session code, connected devices, and status |
|
|
121
|
+
| `fluxlink --backend <url>` | Override backend URL (e.g. `http://127.0.0.1:8000`) |
|
|
122
|
+
| `fluxlink help` | Print command line cheatsheet |
|
|
123
|
+
|
|
124
|
+
### Keyboard Shortcuts in TUI
|
|
125
|
+
|
|
126
|
+
- `Ctrl + T`: WhatsApp-style Real-Time Chat Timeline
|
|
127
|
+
- `Ctrl + 1`: Send File (open file by path or paste code)
|
|
128
|
+
- `Ctrl + 2`: Receive Queue (browse incoming files & download)
|
|
129
|
+
- `Ctrl + 3`: History Screen (inspect past transfers & exact bytes)
|
|
130
|
+
- `Ctrl + 4`: Session Screen (view session code & participant roster)
|
|
131
|
+
- `Ctrl + H`: Help & Shortcuts Screen
|
|
132
|
+
- `Ctrl + Q`: Quit Application
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## 5. AWS EC2 Backend Deployment (Amazon Linux 2023)
|
|
137
|
+
|
|
138
|
+
### 5.1 EC2 Security Group Configuration
|
|
139
|
+
|
|
140
|
+
In AWS Console > EC2 > Security Groups, configure:
|
|
141
|
+
|
|
142
|
+
| Protocol | Port | Source | Purpose |
|
|
143
|
+
| :--- | :--- | :--- | :--- |
|
|
144
|
+
| **SSH** | 22 | `YOUR_IP/32` | Administrative access (restricted to your IP) |
|
|
145
|
+
| **HTTP** | 80 | `0.0.0.0/0` | Public HTTP-to-HTTPS redirect & Certbot challenges |
|
|
146
|
+
| **HTTPS** | 443 | `0.0.0.0/0` | Secure public API and WebSocket connections |
|
|
147
|
+
|
|
148
|
+
> **Note:** Port 8000 should **not** be open to the internet. It binds only to `127.0.0.1` and is proxied through Nginx on port 443.
|
|
149
|
+
|
|
150
|
+
### 5.2 Elastic IP Allocation
|
|
151
|
+
Allocate an AWS Elastic IP and associate it with your EC2 instance. This prevents the public IP from changing upon instance reboot.
|
|
152
|
+
|
|
153
|
+
### 5.3 Automated Server Setup
|
|
154
|
+
SSH into your EC2 instance from Kali Linux:
|
|
155
|
+
```bash
|
|
156
|
+
ssh -i /path/to/key.pem ec2-user@<YOUR_ELASTIC_IP>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Run the automated deployment script located in `deploy/deploy_ec2.sh`:
|
|
160
|
+
```bash
|
|
161
|
+
# Clone repository
|
|
162
|
+
sudo mkdir -p /opt/fluxlink
|
|
163
|
+
sudo chown -R ec2-user:ec2-user /opt/fluxlink
|
|
164
|
+
git clone https://github.com/ychennakesavareddy/FluxLink.git /opt/fluxlink
|
|
165
|
+
cd /opt/fluxlink
|
|
166
|
+
|
|
167
|
+
# Run automated deployment
|
|
168
|
+
chmod +x deploy/deploy_ec2.sh
|
|
169
|
+
./deploy/deploy_ec2.sh
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### 5.4 Configure Production `.env`
|
|
173
|
+
Edit `/opt/fluxlink/.env` on the server and add your Supabase credentials:
|
|
174
|
+
```bash
|
|
175
|
+
nano /opt/fluxlink/.env
|
|
176
|
+
```
|
|
177
|
+
Restart the service:
|
|
178
|
+
```bash
|
|
179
|
+
sudo systemctl restart fluxlinkbackend
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### 5.5 Obtain SSL Certificate with Certbot
|
|
183
|
+
Once DNS is pointed:
|
|
184
|
+
```bash
|
|
185
|
+
sudo certbot --nginx -d fluxlinkbackend.chennareddy.in
|
|
186
|
+
sudo systemctl restart nginx
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## 6. Frontend Deployment (Cloudflare Pages)
|
|
192
|
+
|
|
193
|
+
Because your domain `chennareddy.in` is already managed through Cloudflare DNS, **Cloudflare Pages** is the recommended zero-maintenance hosting solution for the frontend:
|
|
194
|
+
|
|
195
|
+
1. In the **Cloudflare Dashboard**, navigate to **Workers & Pages** > **Create application** > **Pages** > **Connect to Git**.
|
|
196
|
+
2. Select repository: `ychennakesavareddy/FluxLink`.
|
|
197
|
+
3. Build configuration:
|
|
198
|
+
- Framework preset: `None`
|
|
199
|
+
- Build command: *(leave empty)*
|
|
200
|
+
- Build output directory: `web`
|
|
201
|
+
4. Deploy site.
|
|
202
|
+
5. In your Pages project settings, go to **Custom Domains** > **Set up a custom domain**:
|
|
203
|
+
- Enter: `fluxlink.chennareddy.in`
|
|
204
|
+
- Cloudflare will automatically route the CNAME and provision universal SSL.
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## 7. Cloudflare DNS Configuration
|
|
209
|
+
|
|
210
|
+
In your Cloudflare DNS management for `chennareddy.in`, configure:
|
|
211
|
+
|
|
212
|
+
| Type | Name | Content / Target | Proxy status |
|
|
213
|
+
| :--- | :--- | :--- | :--- |
|
|
214
|
+
| **A** | `fluxlinkbackend` | `<YOUR_EC2_ELASTIC_IP>` | DNS only (Grey Cloud) during Certbot, then Proxied (Orange Cloud) |
|
|
215
|
+
| **CNAME** | `fluxlink` | `<YOUR_CLOUDFLARE_PAGES_DOMAIN>` (e.g. `fluxlink.pages.dev`) | Proxied (Orange Cloud) |
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## 8. Testing & Verification
|
|
220
|
+
|
|
221
|
+
Run the test suite:
|
|
222
|
+
```bash
|
|
223
|
+
# Run all unit, UI, and production enforcement tests
|
|
224
|
+
pytest -k "not live" -v
|
|
225
|
+
|
|
226
|
+
# Run live Supabase integration tests (requires live .env)
|
|
227
|
+
pytest tests/test_live_supabase_integration.py -v
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Health Check Verification
|
|
231
|
+
```bash
|
|
232
|
+
curl https://fluxlinkbackend.chennareddy.in/health
|
|
233
|
+
```
|
|
234
|
+
Expected response:
|
|
235
|
+
```json
|
|
236
|
+
{
|
|
237
|
+
"status": "healthy",
|
|
238
|
+
"service": "fluxlink",
|
|
239
|
+
"database": "PostgresRepository",
|
|
240
|
+
"database_backend": "postgres",
|
|
241
|
+
"storage_backend": "supabase",
|
|
242
|
+
"storage_bucket": "chennalink-files"
|
|
243
|
+
}
|
|
244
|
+
```
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "fluxlink"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "FluxLink: Real-time lossless source-code and file transfer bridge CLI"
|
|
9
|
+
authors = [{ name = "Chenna Kesava Reddy", email = "yenuguchenna6una66@gmail.com" }]
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
|
+
keywords = ["fluxlink", "p2p", "file-transfer", "code-transfer", "tui", "textual", "developer-tools", "realtime"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Environment :: Console",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Operating System :: OS Independent",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.10",
|
|
22
|
+
"Programming Language :: Python :: 3.11",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
"Topic :: Communications :: File Sharing",
|
|
25
|
+
"Topic :: Utilities",
|
|
26
|
+
]
|
|
27
|
+
dependencies = [
|
|
28
|
+
"textual>=0.50.0",
|
|
29
|
+
"rich>=13.7.0",
|
|
30
|
+
"pyperclip>=1.8.2",
|
|
31
|
+
"pydantic>=2.0.0",
|
|
32
|
+
"httpx>=0.25.0",
|
|
33
|
+
"websockets>=12.0"
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
[project.optional-dependencies]
|
|
37
|
+
server = [
|
|
38
|
+
"fastapi>=0.100.0",
|
|
39
|
+
"uvicorn>=0.23.0",
|
|
40
|
+
"pydantic-settings>=2.0.0",
|
|
41
|
+
"supabase>=2.0.0",
|
|
42
|
+
"psycopg[binary]>=3.1.0",
|
|
43
|
+
"psycopg-pool>=3.1.0"
|
|
44
|
+
]
|
|
45
|
+
dev = [
|
|
46
|
+
"pytest",
|
|
47
|
+
"pytest-asyncio",
|
|
48
|
+
"build",
|
|
49
|
+
"twine"
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
[project.urls]
|
|
53
|
+
Homepage = "https://fluxlink.chennareddy.in"
|
|
54
|
+
Repository = "https://github.com/ychennakesavareddy/FluxLink"
|
|
55
|
+
|
|
56
|
+
[project.scripts]
|
|
57
|
+
fluxlink = "fluxlink.__main__:cli"
|
|
58
|
+
chennalink = "chennalink.__main__:cli"
|
|
59
|
+
|
|
60
|
+
[tool.hatch.build.targets.wheel]
|
|
61
|
+
packages = ["src/chennalink", "src/fluxlink"]
|
|
62
|
+
|
|
63
|
+
[tool.hatch.build.targets.sdist]
|
|
64
|
+
include = [
|
|
65
|
+
"/src",
|
|
66
|
+
"/README.md",
|
|
67
|
+
"/pyproject.toml"
|
|
68
|
+
]
|
|
69
|
+
|
|
70
|
+
[tool.pytest.ini_options]
|
|
71
|
+
testpaths = ["tests"]
|