2025-05-08 20:20:26 -04:00
2025-05-08 20:20:26 -04:00
2025-05-08 20:20:26 -04:00
2025-05-08 20:20:26 -04:00
2025-05-08 20:20:26 -04:00
2025-05-08 20:20:26 -04:00

Flask AR API Demo

This project is a simple Flask API for demonstrating AR content retrieval for barcode scanning applications. It simulates the Knox Capture API for AR overlays and includes endpoints for managing product attributes, including text and image URLs.

Features

  • Login Endpoint (/login)

    • Simulates a simple login with a 200 response (no authentication required for demo purposes).
  • Content Fields Endpoint (/arcontentfields)

    • Returns a list of available attributes (e.g., item ID, price, image URI).
  • **AR Info Endpoint (/arinfo)

    • Returns product details for a given barcode, including image URLs.
  • **Static Image Server (/images/<filename>)

    • Serves image files from the static/images/ directory.

Setup

  1. Clone the Repository:
git clone <repository_url>
cd <repository_folder>
  1. Create the Static Directory:
mkdir -p static/images
  1. Add Sample Images:
  • Place sample product images in the static/images/ directory.
  • Ensure the filenames match the item IDs used in the app (e.g., 123456.png, 789012.png).
  1. Install Dependencies:
pip install flask
  1. Run the Server:
python app.py
  1. Test the Endpoints:
  • Login: GET http://localhost:5555/login
  • Content Fields: GET http://localhost:5555/arcontentfields
  • AR Info (Example): GET http://localhost:5555/arinfo?barcode=123456
  • Image File (Example): GET http://localhost:5555/images/123456.png

Future Enhancements

  • Add a basic admin UI for adding and managing products.
  • Store product data in a JSON file for persistence.
  • Add image upload capabilities through the admin UI.
Description
No description provided
Readme 179 KiB
Languages
Python 51.2%
HTML 48.4%
Dockerfile 0.4%