MITPython / FastAPI
CodigoQR-FastApi
An API and a UI to generate QR codes instantly.
You type the text, pick colors and format, and get the QR code as PNG or SVG. It is a lightweight FastAPI microservice with an HTML page that consumes it.
- Stars
- 2
- Forks
- 3
- Language
- Python / FastAPI
- License
- MIT
THE PROBLEM
Generating QR codes with custom colors and in vector format without relying on an outside service.
Who it's for
Developers who need to generate QR codes from their own system, and anyone looking for a short FastAPI example with a UI.
WHAT IT DOES
- A POST /generate_qr endpoint that returns the code image.
- PNG or SVG output, with three SVG modes: basic, fragment, and path.
- Custom fill and background colors, validated as hex.
- An HTML interface with Tailwind that calls the API with fetch.
- Interactive API docs at /docs.
How it's built
- Interface index.html collects text, colors, and format and sends them to the API.
- API main.py validates input with Pydantic and builds the code with the qrcode library.
- Response The image is streamed back as PNG or SVG, without being saved to disk.
Stack
FastAPIPythonPydantic v2TailwindJavaScript
Getting started
pip install fastapi uvicorn qrcode[pil]
uvicorn main:app --reload
Open index.html in the browser with the API running
Need something like this built for you?
We use these same tools in our client projects.
Other open source projects
- SaaS starter django-saas-boilerplate A Django 6 SaaS starter: email login, Stripe subscriptions, a dashboard, CSP, and 67 tests. Ready to deploy.
- AI invoicing InvoiceFlow AI invoicing for the Dominican Republic: OCR, DGII tax alerts (ITBIS, dates, 606 data), invoices over WhatsApp, and 606 exports.
- macOS app ModelNap A menu bar app that puts idle local Ollama models to sleep and gives your Mac its memory back. Signed and notarized.