oura-studio-ios

View All Projects

Oura Studio β€” iOS Application

Oura Studio is a custom, high-performance, native iOS inventory and production management application designed specifically for a self-production handmade accessories business (scrunchies, headbands, etc.), actively used in a real small business to handle daily operational workflows end-to-end β€” from production to sales and reporting.

image

The core mission of this application is to solve the complex problem of accurate HPP (COGS) calculation when raw fabric roll material is nested and cut into multiple finished goods with different size dimensions, alongside managing stock ledger tracking, pricing optimization, and sales recording.


✨ Highlights

πŸ“¦ Shopee Bulk Upload β€” XLSX Export

One-tap export of all active products into a Shopee Seller Centre-compatible .xlsx file. Instead of generating a raw workbook, the app duplicates Shopee’s official master template (Shopee_mass_upload_2026-09-07_basic_template.xlsx) via openpyxl and writes data starting at Row 7 on the Template sheet β€” preserving the verification token and header metadata in Rows 1–6 so the file passes Shopee’s internal parser.

πŸ–¨οΈ Bluetooth Thermal Printer Integration

Native BLE thermal printing for 57mm receipts and 33Γ—15mm QR labels, built on CoreBluetooth (TSPLPrinterService.swift + ReceiptGenerator.swift).


πŸ“Έ Screenshots

Preview Screen & Description
image 01 β€” Home (Dashboard) β€” Main screen greeting the user (Good morning, Aswarhan). Today's Revenue Rp591,001 card with summary 26 transactions Β· 44 items sold Β· 99% margin. Below are Quick Actions (Buy Material, Record Production, Pattern Optimization, Profit Report), Stock Alerts (e.g., muslin salu scrunchie… Out of Stock) and Quick POS Cashier (Record Sale / Scan & Sell). Bottom navigation: Home Β· Production Β· Products Β· Sales Β· More.
image 02 β€” Record Sale (POS Sheet) β€” Record Sale sheet for quick transactions. Sale Info section: optional customer name, Payment: Cash, toggles Paid (on) & Auto Print Receipt. Products Sold section: e.g., Black Velvet Scrunchie Β· L (Available: 1 pcs) with Qty controls, Unit Price Rp18,000, Discount Rp0, Add Product button + QR Scan icon. Summary shows Total Revenue Rp18,000. Cancel / Save buttons in the header.
image 03 β€” Production β€Ί Materials β€” Production tab with 4 sub-tabs: Materials (active), Recipe, Optimization, Production. Search Search materials..., category filters (All/Fabric/Thread/Hardware/Packaging) and fabric family filter (All Types, Generic Cotton, Yamaha Satin...). Fabric list shows weighted-average cost per meter, e.g., Dacron 5mm Β· Rp7,000/m, Red Floral Printed Cotton Β· Rp8,000/m. FAB + to add a new material.
image 04 β€” Products (Finished Goods Catalog) β€” Products header with search & QR/Share actions. Stats cards: Total Products 67, Total Variants 240 var, Total Stock 247 pcs, Out of Stock 107 var, Capital Value Rp4,499,956 & Potential Revenue Rp4,495,081 (132 variants using selling price as cost). Toggle Filter by Stock Entry Date. Product listing e.g., nylon zipper box pouch (SKU POUKOTZIPNYL) with variants M Rp45,001 Β· 1 pcs and L Rp55,000 Β· 4.
image 05 β€” QR Generator β€” QR Generator sheet for label printing. Search Search product or size... and toggle Filter by Stock Entry Date. Options Select All & Select all sizes. Each variant displays a QR code, size (M/L) and stock (Stock: 1 pcs), e.g., group nylon zipper box pouch (M 1 pcs, L 6 pcs) and silver zipper box pouch (M 3 pcs, L 3 pcs). QR codes are used for Scan & Sell / Scan to Stock.
image 06 β€” Shopee Bulk Export β€” Shopee Export sheet for marketplace. Generates a Shopee-template Excel file containing Scrunchie & Pouch product details ready to upload. Summary Products Ready to Export: Scrunchie Category ID: 100146 (1 Product) and Pouch Category ID: 101650 (1 Product). Main button Download Shopee Template at the bottom. Speeds up bulk listing without manual input in Seller Centre.
image 07 β€” Sales (Transaction History) β€” Sales screen with DateRangeField filter (Sep 20 – Sep 20, 2026) and 3 summary cards: Revenue Rp591,001, Sold 44 pcs, Transactions 26 trx. Daily invoice list e.g., INV-000112 Paid Rp28,000 (Cash Β· 2 items Β· 09:10) expandable to show item details (Black Yamaha Satin Scrunchie Β· M 1 pcs Γ— Rp15,000 - Rp2,000). FAB + for new sale & QR icon at top-right.
image 08 β€” More β€Ί Reports & Settings β€” More tab with segmented control Reports (active) / Settings. Available Reports menu: Sales Report (Revenue & profit per period), Product Sales Ranking (best-selling variants), Product Margin Ranking (highest margin), Fabric Waste Analysis (waste percentage per material). This screen is the business analytics hub.
image 09 β€” Sales Report (Detail) β€” Sales Report detail with Time Range Aug 21 – Sep 20, 2026. Summary: Total Revenue Rp2,383,826, Total Profit Rp2,319,536, Transactions 110, Pcs Sold 166 pcs. Export JSON for AI button for further analysis. Per Period table details daily revenue, e.g., 2026-08-23 Rp617,000 (26 transactions), 2026-08-30 Rp495,000 (23 transactions).

πŸ“± Core Features

  1. Home (Dashboard):
    • Daily business performance summary widgets (Revenue, Order Count, Net Profit, Margin Percentage).
    • Today’s transaction list.
    • Automatic low-stock warning/alert system.
  2. Production (Production Hub):
    • Materials: Track remaining fabric roll length in centimeters (remaining_length_cm) and weighted-average cost. Active/archived material status management.
    • Recipes (Pattern Specs): Fabric cut layout specs, hardware requirements, and labor components per product size.
    • Cutting Optimizer: Cutting layout recommendation algorithm (two-phase shelf-packing heuristic) to find minimal waste and maximum profit strategies.
    • Production Batches: Lock and freeze production costs (cost-lock) after confirming a physical cutting batch to add to finished-goods stock.
  3. Products (Finished Goods Catalog):
    • 3-level navigation structure (Product -> Size/Color -> Variant Detail).
    • Top summary statistics (Total Product Types, Total Stock Quantity, Empty Variant Count).
    • Price Advisor: Ideal selling price simulation tool based on target margin percentage, marketplace fees, and promo allocation.
    • Supports Manual HPP (Manual HPP Override) when products are added outside the standard cutting optimization flow.
  4. Sales (Point of Sale):
    • Quick cashier transaction recording with real-time product stock availability validation.
    • Sales date-range filtering using the dynamic DateRangeField component.
    • Quick stock adjustment sheet directly from the POS screen.
  5. QR Code System (QR Code Integration):
    • QR Generator: Create and print A4 PDF sheets containing QR barcodes for dozens of selected product variants at once.
    • QR Scanner: Universal fast barcode scanner (VisionKit) for cashier checkout (Scan to Sell / QR Cart Mode) and warehouse restocking (Scan to Stock).
  6. Shopee Bulk Upload (XLSX Export):
    • One-tap generation of Shopee Mass Upload .xlsx from the official master template β€” preserves verification token, writes from Row 7, auto-maps categories/weights/dimensions, and shares via iOS Share Sheet.
  7. Thermal Printing (Bluetooth BLE):
    • 57mm ESC/POS receipt printing + 33Γ—15mm TSPL QR label printing over BLE with auto-reconnect, chunked writes, busy-window guard, auto-print toggle, and PDF fallback β€” powered by TSPLPrinterService / ReceiptGenerator.

πŸ›  Technology Stack & Architecture


πŸ’» How to Run the App

  1. Open oura studio frontend.xcodeproj in Xcode (Xcode 15+ recommended, iOS 16.5+).
  2. Backend URL is no longer hardcoded β€” it is injected via XCConfig β†’ Info.plist β†’ AppConfig.apiBaseURL:
    • Config/Debug.xcconfig (default: production https://ourastudiobackendseoul-763614853578.asia-northeast3.run.app/api/v1) β€” used for Run (Debug).
    • Config/Release.xcconfig (production) β€” used for Archive / TestFlight / App Store (Release).
    • No code change needed to switch environments; just select the Build Configuration (Debug vs Release).
  3. (Optional) Local development override: to point Debug to localhost or staging without touching committed files:
    cp Config/Local.xcconfig.example Config/Local.xcconfig
    # edit Config/Local.xcconfig, e.g.:
    # SLASH = /
    # API_BASE_HOST = localhost:8000/api/v1
    # API_BASE_URL = http:/$(SLASH)$(API_BASE_HOST)
    

    Config/Local.xcconfig is gitignored and auto-included only in Debug via #include? "Local.xcconfig". Leave it absent for production default. Note: // must be built via SLASH variable because .xcconfig treats // as a comment.

  4. Select an iOS simulator (e.g., iPhone 15) or connect your physical iPhone device. For physical device, ensure your Apple Developer Team is selected under Signing & Capabilities.
  5. Press Run (⌘ + R) to build and launch. Verify the injected URL in the built app’s Info.plist (API_BASE_URL) if needed:
    # after a Debug build
    plutil -p ~/Library/Developer/Xcode/DerivedData/oura_studio_frontend-*/Build/Products/Debug-iphoneos/"oura studio frontend.app"/Info.plist | grep API_BASE_URL
    

πŸ§ͺ QA & Test Automation

Frontend UI tests use Maestro (black-box, run on iOS Simulator) with Allure reporting (screenshots shown inline per test in the Attachments tab). Test scripts are in test/scripts/ and per-TC documentation is in doc/test/.

Prerequisites

Run a single test flow + generate Allure report

# 1. Create results directory
mkdir -p test-results/maestro

# 2. Run Maestro flow, export JUnit XML + screenshots
maestro test --format junit \
  --output test-results/maestro/report.xml \
  --test-output-dir test-results/maestro-artifacts \
  test/scripts/TC003_DashboardFlow.yaml

# 3. Attach latest screenshots to Allure results
python3 test/attach_screenshots.py --flow TC003_DashboardFlow --tc TC-003

# 4. Generate Allure report (cleans old report first)
allure generate test-results/allure-results -o test-results/allure-report --clean

# 5. Open report in browser
allure open test-results/allure-report

Available test flows (test/scripts/)

File TC ID Scenario Type
TC003_DashboardFlow.yaml TC-003 Dashboard + Buy Material sheet (read-only, does not write data) Sanity / Positive
TC004_TambahProdukManual.yaml TC-004 Add manual product (Free Size) Write
TC005_TambahStokSatu.yaml TC-005 Free Size stock 0 β†’ 1 pcs Write
TC006_JualHargaDiskon.yaml TC-006 Sell 1 pc, price Rp1,000, discount Rp1,000 β†’ total Rp0 Write

Full reference (run all flows at once, merge Allure results, test-results/ folder structure, troubleshooting, CI notes): doc/test/TESTING.md.


πŸ“ Project Folder Structure

oura studio frontend/
β”œβ”€β”€ Config/                     # XCConfig per environment (Debug/Release + Local.xcconfig.example)
β”œβ”€β”€ Components/                 # Shared UI components (DateRangeField, Input, etc.)
β”œβ”€β”€ Core/                       # AppState, Keychain, OuraTheme (Core Configuration)
β”œβ”€β”€ Networking/                 # API client (APIService + AppConfig) & Pydantic-mapped Models
β”œβ”€β”€ Screens/                    # UI screens per feature (Auth, Home, Production, Products, etc.)
└── doc/                        # Handoff docs, revision specs & version history