Skip to content

enatega/menu-uploader-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Menu to CSV Converter

A full-stack React + Express app that uses OpenAI to extract restaurant menu items from images and PDFs, then exports them as CSV.

Quick Start

1. Install dependencies

npm install

2. Configure environment

Copy .env.example to .env and add your OpenAI API key:

cp .env.example .env

Edit .env:

OPENAI_API_KEY=sk-your-actual-openai-api-key
PORT=5000

Alternatively, enter the API key via the Settings page in the UI.

3. Start the backend server

npm run server

Server starts at http://localhost:5000

4. Start the frontend (new terminal)

npm run dev

Frontend starts at http://localhost:5173

5. Or run both together

npm start

Environment Variables

Variable Default Description
OPENAI_API_KEY Your OpenAI API key (required)
PORT 5000 Backend server port

Folder Structure

ai-menu-to-csv/
├── server/
│   ├── index.js          # Express backend
│   ├── uploads/          # Uploaded files (temp)
│   └── data/
│       ├── history.json  # Upload history
│       └── settings.json # App settings
├── src/
│   ├── App.jsx           # React app (all pages)
│   ├── main.jsx          # Entry point
│   ├── styles.css        # All styles
│   └── utils.js          # CSV helpers
├── .env                  # Environment variables
├── .env.example          # Example env file
├── package.json
├── vite.config.js        # Vite + proxy config
├── index.html
└── README.md

API Routes

Method Route Description
GET /api/health Server health check
GET /api/settings Get settings
POST /api/settings Save settings
GET /api/history Upload history
DELETE /api/history/:id Delete history entry
GET /api/stats Usage statistics
POST /api/upload Upload file
POST /api/process Process with OpenAI

Features

  • Drag & drop upload — JPG, PNG, WEBP, PDF
  • AI extraction — Uses gpt-4.1-mini via OpenAI Responses API
  • PDF support — Direct PDF upload + pdf-parse text fallback
  • Editable preview table — Edit/delete rows before export
  • CSV export — Download or copy to clipboard
  • History — Tracks all uploads with status
  • Settings — Configure API key, model, limits
  • JSON preview — View raw extracted JSON

Troubleshooting

Blank white screen

  • Make sure npm run dev is running on port 5173
  • Check browser console for errors

ECONNREFUSED / upload errors

  • Make sure npm run server is running on port 5000
  • The Vite proxy forwards /api/* to http://localhost:5000

OpenAI errors

  • Ensure your API key is set in .env or Settings page
  • Check you have credits on your OpenAI account
  • Model gpt-4.1-mini requires OpenAI API access

PDF not working

  • Enable "PDF fallback" in Settings
  • Try converting the PDF to an image (JPG/PNG) instead

JSON parsing errors

  • The app has robust JSON parsing with multiple fallback strategies
  • If a menu is very complex, try a cleaner image/scan

Supported File Types

Type MIME Notes
JPG/JPEG image/jpeg Best results
PNG image/png Best results
WEBP image/webp Good results
PDF application/pdf Falls back to text extraction

Max file size: 10MB (configurable in Settings)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors