parthmax commited on
Commit
872bfc6
Β·
1 Parent(s): 8d84ce9

added changes to readme

Browse files
Files changed (1) hide show
  1. README.md +244 -3
README.md CHANGED
@@ -9,9 +9,250 @@ app_file: Dockerfile
9
  pinned: false
10
  ---
11
 
12
- # Dynamic QR Redirector
13
 
14
- A FastAPI-based web app that generates **dynamic QR codes** with redirection support.
15
- Users can scan a single QR code and be redirected to updated links without needing to reprint or regenerate the QR.
16
 
 
17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  pinned: false
10
  ---
11
 
12
+ # Dynamic-QR: QR Code Management System
13
 
14
+ <div align="center">
 
15
 
16
+ ![Dynamic QR Logo](https://img.shields.io/badge/Dynamic--QR-green?style=for-the-badge&logo=qr-code&logoColor=white)
17
 
18
+ [![Python](https://img.shields.io/badge/Python-3.10+-blue.svg)](https://python.org)
19
+ [![FastAPI](https://img.shields.io/badge/FastAPI-0.104+-green.svg)](https://fastapi.tiangolo.com)
20
+ [![HuggingFace](https://img.shields.io/badge/πŸ€—%20HuggingFace-Spaces-yellow.svg)](https://huggingface.co/spaces/parthmax/dynamic-qr)
21
+ [![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
22
+
23
+ *A powerful, FastAPI-based system for generating, updating, and tracking **dynamic QR codes** with enterprise-ready APIs.*
24
+
25
+ [πŸš€ Live Demo](https://huggingface.co/spaces/parthmax/dynamic-qr) β€’ [πŸ“– Documentation](#documentation) β€’ [πŸ› οΈ Installation](#installation) β€’ [πŸ“Š API Reference](#api-reference)
26
+
27
+ </div>
28
+
29
+ ---
30
+
31
+ ## 🌟 Overview
32
+
33
+ Dynamic-QR provides a **centralized system for creating and managing QR codes** that can be updated anytime without re-printing.
34
+ It includes scan tracking, redirection logic, and a simple **web dashboard + API interface** for enterprise use cases.
35
+
36
+ ---
37
+
38
+ ## ✨ Key Features
39
+
40
+ ### πŸ”— **Dynamic QR Management**
41
+ - Create unique QR codes with short IDs
42
+ - Update QR destination anytime without changing the QR image
43
+ - Delete or deactivate codes when needed
44
+
45
+ ### πŸ“Š **Analytics & Tracking**
46
+ - Track scan counts in real time
47
+ - Log last scan timestamp
48
+ - Manage activity status (`active/inactive`)
49
+
50
+ ### πŸ–₯️ **Dashboard & APIs**
51
+ - Jinja2-powered dashboard to view all QR codes
52
+ - REST APIs for integration with other systems
53
+ - QR image generation endpoint for direct embedding
54
+
55
+ ### πŸ›‘οΈ **Enterprise Ready**
56
+ - CORS enabled
57
+ - Health check endpoint
58
+ - Extensible for database or authentication integration
59
+
60
+ ---
61
+
62
+ ## πŸ—οΈ System Architecture
63
+
64
+ ```
65
+
66
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
67
+ β”‚ Web Dashboard │◄───►│ FastAPI Backend β”‚
68
+ β”‚ (Jinja2) β”‚ β”‚ (app.py) β”‚
69
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
70
+ β”‚
71
+ β–Ό
72
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
73
+ β”‚ QR Generator β”‚ β”‚ In-Memory Store β”‚
74
+ β”‚ (qrcode lib) β”‚ β”‚ (Dict, can use DB)β”‚
75
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
76
+
77
+ ````
78
+
79
+ ---
80
+
81
+ ## πŸš€ Quick Start
82
+
83
+ ### Option 1: Try Online (Recommended)
84
+ Visit the live demo: [πŸ€— HuggingFace Spaces](https://huggingface.co/spaces/parthmax/dynamic-qr)
85
+
86
+ ### Option 2: Local Installation
87
+
88
+ #### 1. Clone the Repository
89
+ ```bash
90
+ git clone https://github.com/parthmax2/dynamic-qr.git
91
+ cd dynamic-qr
92
+ ````
93
+
94
+ #### 2. Setup Virtual Environment
95
+
96
+ ```bash
97
+ python -m venv venv
98
+ source venv/bin/activate # Linux/Mac
99
+ # venv\Scripts\activate # Windows
100
+ ```
101
+
102
+ #### 3. Install Dependencies
103
+
104
+ ```bash
105
+ pip install -r requirements.txt
106
+ ```
107
+
108
+ #### 4. Run the Server
109
+
110
+ ```bash
111
+ uvicorn app:app --reload --host 0.0.0.0 --port 8000
112
+ ```
113
+
114
+ πŸ‘‰ Visit [http://127.0.0.1:8000](http://127.0.0.1:8000)
115
+
116
+ ---
117
+
118
+ ## 🎯 Usage
119
+
120
+ ### Web Dashboard
121
+
122
+ 1. Open `/` to view all QR codes
123
+ 2. Create a new QR by entering **title + redirect URL**
124
+ 3. Update existing QR code targets anytime
125
+ 4. Download the QR image and share
126
+
127
+ ### API Examples
128
+
129
+ #### Create QR
130
+
131
+ ```bash
132
+ curl -X POST "http://localhost:8000/create" \
133
+ -F "title=My GitHub" \
134
+ -F "redirect_url=https://github.com/parthmax2"
135
+ ```
136
+
137
+ #### Redirect Scan
138
+
139
+ ```bash
140
+ curl -i "http://localhost:8000/r/{qr_id}"
141
+ ```
142
+
143
+ #### Get QR Image
144
+
145
+ ```bash
146
+ curl -o qr.png "http://localhost:8000/qr/{qr_id}"
147
+ ```
148
+
149
+ #### Get QR Metadata
150
+
151
+ ```bash
152
+ curl "http://localhost:8000/api/qr/{qr_id}"
153
+ ```
154
+
155
+ ---
156
+
157
+ ## πŸ“š API Reference
158
+
159
+ ### Core Endpoints
160
+
161
+ | Method | Endpoint | Description |
162
+ | -------- | ----------------- | -------------------- |
163
+ | `GET` | `/` | Dashboard UI |
164
+ | `POST` | `/create` | Create new QR |
165
+ | `POST` | `/update/{qr_id}` | Update QR code |
166
+ | `GET` | `/r/{qr_id}` | Redirect endpoint |
167
+ | `GET` | `/qr/{qr_id}` | Get QR PNG image |
168
+ | `DELETE` | `/delete/{qr_id}` | Delete QR code |
169
+ | `GET` | `/api/qr/{qr_id}` | Get QR metadata JSON |
170
+ | `GET` | `/health` | Health check |
171
+
172
+ ### Example QR Metadata Response
173
+
174
+ ```json
175
+ {
176
+ "id": "abc12345",
177
+ "title": "My GitHub",
178
+ "redirect_url": "https://github.com/parthmax2",
179
+ "scan_count": 12,
180
+ "created_at": "2025-08-31T10:45:00",
181
+ "last_scanned": "2025-08-31T11:20:00",
182
+ "is_active": true
183
+ }
184
+ ```
185
+
186
+ ---
187
+
188
+ ## βš™οΈ Configuration
189
+
190
+ ### Environment Variables
191
+
192
+ | Variable | Description | Default |
193
+ | ---------- | -------------------------------- | --------------------------------------------------- |
194
+ | `BASE_URL` | Base URL used for QR redirection | `https://huggingface.co/spaces/parthmax/dynamic-qr` |
195
+
196
+ > ⚠️ In production, configure `BASE_URL` to match your deployment domain.
197
+
198
+ ---
199
+
200
+ ## πŸ› οΈ Development
201
+
202
+ ### Project Structure
203
+
204
+ ```
205
+ dynamic-qr/
206
+ β”œβ”€β”€ app.py # Main FastAPI application
207
+ β”œβ”€β”€ templates/ # Jinja2 templates (UI)
208
+ β”‚ └── index.html
209
+ β”œβ”€β”€ static/ # Static assets (CSS, JS)
210
+ β”œβ”€β”€ requirements.txt # Python dependencies
211
+ └── README.md # Documentation
212
+ ```
213
+
214
+
215
+ ---
216
+
217
+ ## πŸ“Š Roadmap
218
+
219
+ * βœ… Dynamic QR CRUD
220
+ * βœ… Scan tracking
221
+ * πŸ”„ Persistent DB integration (SQLite/Postgres)
222
+ * πŸ”„ User authentication
223
+ * πŸ”„ Analytics dashboard with charts
224
+ * πŸ”„ Bulk QR generation & export
225
+
226
+ ---
227
+
228
+ ## πŸ”’ Security
229
+
230
+ * Input validation for URLs
231
+ * Configurable active/inactive state
232
+ * Ready for JWT auth integration
233
+ * Safe QR redirection logic
234
+
235
+ ---
236
+
237
+ ## πŸ“„ License
238
+
239
+ This project is licensed under the **MIT License**.
240
+ See the [LICENSE](LICENSE) file for details.
241
+
242
+ ---
243
+
244
+ ## πŸ‘€ Author
245
+
246
+ **Saksham Pathak** ([@parthmax2](https://github.com/parthmax2))
247
+ Generative AI Engineer | AI Apps & Developer Tools
248
+
249
+ ---
250
+
251
+ <div align="center">
252
+
253
+ **[⭐ Star this repo](https://github.com/parthmax2/dynamic-qr)** if you find it useful!
254
+
255
+ Made with ❀️ by [parthmax](https://github.com/parthmax2)
256
+
257
+ </div>
258
+ ```