2026-03-15 09:47:03 -04:00
2026-03-14 12:38:52 -04:00
2026-03-15 09:47:03 -04:00
2026-03-15 09:47:03 -04:00

QR Code App

This repository contains a simple QR-code backend (FastAPI) and a React + Vite frontend.

Prerequisites

  • Python 3.10+ (for backend)
  • Node.js (18+) and npm (for frontend)

Backend (FastAPI)

  1. Create and activate a virtual environment
python3 -m venv backend/.venv
source backend/.venv/bin/activate   # macOS / Linux
  1. Install Python dependencies
pip install -r backend/requirements.txt
  1. Run the backend (development)
uvicorn app.main:app --host 0.0.0.0 --port 5001 --reload

# option B (uses the included runner)
python backend/main.py

The backend listens on port 5001 by default and exposes the QR generator at:

POST http://localhost:5001/api/qrcode/generate

Payload JSON shape: { "text": "string", "size": number } Response: image/png (binary image bytes)

Frontend (React + Vite)

  1. Install dependencies and run dev server
cd frontend
npm install
npm run dev

Vite's dev server typically serves at http://localhost:5173. The frontend is configured to call the backend at http://localhost:5001 (see frontend/src/api/qrcode.ts). Ensure the backend is running before using the UI.

Notes

  • CORS is enabled in the backend for local development.
  • If you change backend port, update the host constant in frontend/src/api/qrcode.ts.

Author

Description
No description provided
Readme MIT 120 KiB
Languages
TypeScript 54.7%
SCSS 23%
JavaScript 10.6%
Python 9.7%
HTML 2%