https://github.com/fwextensions/hours-of-operation
https://github.com/fwextensions/hours-of-operation
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/fwextensions/hours-of-operation
- Owner: fwextensions
- Created: 2025-08-01T02:29:43.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-08-15T20:49:24.000Z (11 months ago)
- Last Synced: 2025-08-15T22:42:42.011Z (11 months ago)
- Language: HTML
- Homepage: https://hours-of-operation.vercel.app
- Size: 24.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Business Hours Parser - Next.js App
A Next.js application that converts natural language business hours descriptions into structured JSON format using OpenAI's API.
## Setup
1. Install dependencies:
```bash
npm install
```
2. Set up your OpenAI API key:
- Copy `.env.local` and add your OpenAI API key:
```
OPENAI_API_KEY=your_actual_openai_api_key_here
```
3. Run the development server:
```bash
npm run dev
```
4. Open [http://localhost:3000](http://localhost:3000) in your browser.
## Features
- ✅ Secure server-side API calls (API key not exposed to client)
- ✅ Natural language processing of business hours
- ✅ Structured JSON output
- ✅ Demo mode for testing without API key
- ✅ Clean, responsive UI
- ✅ Error handling and validation
## Usage
1. Enter a natural language description of business hours (e.g., "we're open tuesdays and thursdays 9-5, with an hour closed for lunch at 12")
2. Click "Parse Hours with AI" to get structured JSON output
3. Use "Try Demo Mode" to see example output without using the API
## API
The app includes a Next.js API route at `/api/parse-hours` that:
- Accepts POST requests with `hoursText` in the body
- Returns structured JSON with business hours
- Handles OpenAI API communication securely on the server side