5ef55ff8dd1ceb14de8c4aa70da33cce4c0537cf
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)
- Create and activate a virtual environment
python3 -m venv backend/.venv
source backend/.venv/bin/activate # macOS / Linux
- Install Python dependencies
pip install -r backend/requirements.txt
- 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)
- 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
- Carlos Gutierrez cgutierrez44833@ucumberlands.edu
Languages
TypeScript
54.7%
SCSS
23%
JavaScript
10.6%
Python
9.7%
HTML
2%