This project is a full-stack QR Code Generator application that allows users to generate QR codes with optional logos. The app consists of a Flask backend for generating QR codes and a React Native frontend for the user interface.
- Generate QR codes from a URL.
- Add an optional logo to the QR code.
- Serve the QR code as a response in hexadecimal format.
- User-friendly interface to input URLs.
- Option to upload a logo for the QR code.
- Display the generated QR code.
- Save the QR code to the device gallery.
- Share the QR code via other apps.
QR-app/
├── backend/ # Flask API
│ ├── app.py # Main Flask application
│ ├── requirements.txt # Backend dependencies
│ └── pyproject.toml # Backend project metadata
└── frontend/ # React Native App
├── App.js # Main React Native component
├── package.json # Frontend dependencies
├── android/ # Android-specific files
├── assets/ # App assets (icons, splash screens, etc.)
└── toastConfig.js # Toast notification configuration
- Flask: Python web framework.
- Flask-CORS: To handle cross-origin requests.
- QRCode: For generating QR codes.
- Pillow: For image processing.
- React Native: Cross-platform mobile app framework.
- Expo: For building and running the app.
- Axios: For making HTTP requests.
- Expo Image Picker: For selecting images from the device.
- Expo Sharing: For sharing files.
- Expo Media Library: For saving files to the device gallery.
-
Navigate to the Backend Directory:
cd backend -
Create a Virtual Environment:
python -m venv venv venv\Scripts\activate # On Windows # OR source venv/bin/activate # On macOS/Linux
-
Install Dependencies:
pip install -r requirements.txt
-
Run the Flask Server:
python app.py
-
Test the API: Use Postman or
curlto test the/generateendpoint:curl -X POST -F "url=https://google.com" -F "logo=@logo.png" http://localhost:5000/generate
-
Navigate to the Frontend Directory:
cd frontend -
Install Dependencies:
npm install
-
Start the Expo Development Server:
npx expo start
-
Run the App:
- Scan the QR code displayed in the terminal using the Expo Go app on your mobile device.
-
Replace Backend URL:
-
Update the backend URL in
App.jswith your local IP address:const response = await axios.post('http://YOUR_LOCAL_IP:5000/generate', formData, ...);
-
Find your local IP address:
- Windows: Run
ipconfigand look for the IPv4 address. - macOS/Linux: Run
ifconfigand look for theinetaddress.
- Windows: Run
-
-
Enter a URL:
- Input the URL you want to generate a QR code for.
-
Add a Logo (Optional):
- Tap the "Insert a Logo" button to select an image from your device.
-
Generate QR Code:
- Tap the "Generate QR Code" button to create the QR code.
-
Save or Share:
- Save the QR code to your gallery or share it via other apps.
-
Connection Refused:
- Ensure both your mobile device and computer are on the same network.
- Disable any firewall or antivirus software temporarily.
-
CORS Errors:
- Ensure
flask-corsis installed and enabled in the backend.
- Ensure
-
Image Upload Fails:
- Verify the image format (PNG/JPG).
- Check the Flask server logs for errors.
-
Expo Go App Not Connecting:
- Ensure your mobile device is on the same network as your computer.
- Restart the Expo development server.
-
Add Features:
- QR code customization (colors, sizes, etc.).
- History of generated QR codes.
-
Deploy Backend:
- Use a cloud platform like Heroku or PythonAnywhere.
- Update the frontend API URL to the deployed backend.
-
Build Release APK/IPA:
- For Android:
npx expo prebuild npx expo run:android
- For iOS:
npx expo run:ios
- For Android:
This project is licensed under the MIT License. Feel free to use and modify it as needed.
