Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FactoryPilot Pro

An advanced manufacturing cost analysis, pricing strategy, and market intelligence platform — available as a Windows desktop app and iOS SwiftUI app.


Windows Desktop App — Quick Start

Stack: Electron + Vite + React + TypeScript · Installer: NSIS (.exe)

Prerequisites


Step 1 — Clone the repository

git clone <your-repo-url> Trial
cd Trial
git checkout claude/factorypilot-pro-app-48j2B

Step 2 — Start the backend (standalone, zero-config)

cd factorypilot-backend
npm install
node standalone.js

The standalone backend starts immediately at http://localhost:3000 — no database or Docker required.

It uses validated market data for Turkey, Kenya, and Germany, and dynamically recalculates pricing based on your overhead, gross-margin, and VAT inputs.


Step 3 — Build the Windows installer

cd factorypilot-desktop
npm install
npm run desktop:build

This compiles the React/TypeScript renderer with Vite, bundles the Electron main process, and runs electron-builder to produce the NSIS installer.

Output:

factorypilot-desktop/dist/FactoryPilotPro Setup.exe

Step 4 — Install the app

Double-click FactoryPilotPro Setup.exe and follow the installer.

  • You can choose the installation directory.
  • A FactoryPilotPro shortcut is created on your Desktop and in the Start Menu.

Step 5 — Open the app

Double-click the FactoryPilotPro shortcut on your Desktop.

The app opens with the backend URL pre-set to http://localhost:3000. Go to Settings at any time to change the URL.


Development mode (hot reload)

cd factorypilot-desktop
npm install
npm run desktop:dev

Scripts reference (factorypilot-desktop/package.json)

Script What it does
desktop:dev Electron + Vite dev server with hot reload
desktop:build Compile renderer + package → dist/FactoryPilotPro Setup.exe
desktop:start Run the compiled app locally (no packaging)

Desktop app file layout

factorypilot-desktop/
├── electron.vite.config.ts        # Vite config for main + renderer
├── package.json                   # Scripts + electron-builder NSIS config
├── src/
│   ├── main/index.ts              # Electron main process (window creation)
│   ├── preload/index.ts           # Context bridge (minimal)
│   └── renderer/
│       ├── index.html             # Vite entry HTML
│       └── src/
│           ├── App.tsx            # Root component (nav + state)
│           ├── types.ts           # TypeScript interfaces (request/response)
│           ├── index.css          # Dark theme CSS
│           └── components/
│               ├── PlanForm.tsx       # Input form (9 fields)
│               ├── ResultsView.tsx    # Pricing / Analogs / BOM / Assumptions tabs
│               └── SettingsScreen.tsx # Backend URL setting
└── dist/
    └── FactoryPilotPro Setup.exe  # Generated after desktop:build

Architecture

FactoryPilotPro/
├── FactoryPilotProApp.swift         # @main App entry point
├── ContentView.swift                # Root TabView navigation
│
├── Models/
│   ├── Product.swift               # Input + all Codable output models
│   ├── CountryProfile.swift        # CountryProfile + predefined profiles
│   └── AppSettings.swift           # AppSettings ObservableObject + LLMProvider enum
│
├── ViewModels/
│   ├── MainViewModel.swift         # Analysis orchestration, state management
│   └── SettingsViewModel.swift     # Settings & API test logic
│
├── Views/
│   ├── InputFormView.swift         # Product input form with country profile card
│   ├── ResultsView.swift           # Tabbed results (Overview/Costing/Competitors/Positioning)
│   ├── CostingView.swift           # Manufacturing params + cost breakdown + bar chart
│   ├── CompetitorView.swift        # Price positioning map + market share chart
│   ├── MarketPositioningView.swift # Pricing waterfall + USPs + channels + entry strategy
│   ├── HistoryView.swift           # Analysis history list + detail view
│   └── SettingsView.swift          # Provider config + API key + country profiles browser
│
├── Services/
│   ├── LLMService.swift            # OpenAI + Anthropic + Custom API calls
│   ├── JSONValidator.swift         # JSON extraction, schema validation, decode
│   └── ExportService.swift         # JSON + CSV export, share sheet items
│
├── Engines/
│   └── PricingEngine.swift         # Local quick estimate + manufacturing param inference + validation
│
└── Mock/
    └── MockData.swift              # Pre-built mock results for Turkey, Kenya, Germany

Features

Country Intelligence

Country Currency VAT Labor/hr Electricity/kWh Competitors
Turkey TRY ₺ 20% ₺115 ₺2.85 Omo, Persil, Bingo, Fairy, Ariel...
Kenya KES/USD 16% KSh 80 KSh 22.50 Sunsilk, Pantene, Menengai, Bidco...
Germany EUR € 19% €15.50 €0.22 Frosch, Ecover, DM Bio, Domestos...
Unknown USD est. 15% Regional Regional Global multinationals, is_estimate=true

Analysis Output (JSON Schema)

{
  "product": { "name", "country", "packaging", "currency" },
  "manufacturing_parameters": {
    "batch_size_kg", "mixing_time_minutes", "temperature_celsius",
    "rpm", "fill_weight_grams", "cycle_time_minutes"
  },
  "costing_breakdown": {
    "raw_materials_per_unit", "labor_per_unit", "electricity_per_unit",
    "packaging_per_unit", "overhead_per_unit", "quality_control_per_unit",
    "total_cogs", "currency", "notes"
  },
  "pricing_strategy": {
    "manufacturer_price", "distributor_price", "retailer_price",
    "consumer_price", "vat_included_price", "currency", "vat_percent", "gross_margin_percent"
  },
  "competitor_analysis": [
    { "brand", "product", "retail_price", "market_share_percent", "positioning", "currency" }
  ],
  "market_positioning": {
    "recommended_segment", "price_tier", "unique_selling_points",
    "target_channels", "market_entry_strategy"
  },
  "assumptions": ["..."],
  "is_estimate": false,
  "generated_at": "ISO8601"
}

Setup

Xcode Project Setup

  1. Open Xcode 15+
  2. Create new project: iOS > App
    • Product Name: FactoryPilotPro
    • Interface: SwiftUI
    • Language: Swift
    • Minimum iOS: 16.0
  3. Delete the default ContentView.swift
  4. Drag all files from this directory into the Xcode project
  5. Ensure all files are added to the app target

Configuration

  1. Launch the app
  2. Go to Settings tab
  3. Select Mock Mode (no API key needed for testing)
  4. For Live Mode: add your OpenAI or Anthropic API key

Supported LLM Providers

Provider Models Available JSON Mode
OpenAI GPT-4o, GPT-4o-mini, GPT-4-turbo response_format: json_object
Anthropic claude-opus-4-6, claude-sonnet-4-6, claude-haiku-4-5 ✅ System prompt enforced
Custom Any OpenAI-compatible endpoint ✅ Same as OpenAI

Security Notes

  • API keys stored in UserDefaults (migrate to Keychain for production)
  • No analytics, no telemetry
  • All LLM calls made directly from device
  • JSON validated before display — non-JSON responses rejected

Requirements

  • iOS 16.0+
  • Xcode 15.0+
  • Swift 5.9+

About

Just for teial

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages