Skip to content

Commit 2981114

Browse files
committed
Initial project setup with core app files
Add main React app, settings modal, constants, types, and service for LLM prompt optimization. Includes test suite, configuration files, CI workflow, documentation, and example environment variables. Supports Gemini and OpenAI-compatible APIs, with prompt templates, history, and favorites features.
1 parent 04d87dc commit 2981114

24 files changed

+7001
-0
lines changed

.env.example

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# ==============================================================================
2+
# LLM PROMPT OPTIMIZER - ENVIRONMENT VARIABLES
3+
# ==============================================================================
4+
#
5+
# This file contains example environment variables for the application.
6+
# Copy this file to `.env.local` and fill in your actual API keys.
7+
#
8+
# IMPORTANT: Never commit `.env.local` to version control!
9+
#
10+
# ==============================================================================
11+
12+
# ------------------------------------------------------------------------------
13+
# GEMINI API KEY (Primary Provider)
14+
# ------------------------------------------------------------------------------
15+
#
16+
# Get your free Gemini API key at: https://aistudio.google.com/apikey
17+
#
18+
# The application uses Gemini 2.5 Pro by default to optimize prompts.
19+
# This is required if you're using the default Gemini provider.
20+
#
21+
GEMINI_API_KEY=your_gemini_api_key_here
22+
23+
# ------------------------------------------------------------------------------
24+
# ALTERNATIVE: OPENAI-COMPATIBLE API
25+
# ------------------------------------------------------------------------------
26+
#
27+
# If you prefer to use an OpenAI-compatible API instead of Gemini,
28+
# you can configure it via the Settings modal (gear icon) in the app.
29+
#
30+
# Required settings (configured in-app):
31+
# - Base URL: e.g., https://api.openai.com/v1
32+
# - API Key: Your OpenAI API key
33+
# - Model: e.g., gpt-4, gpt-3.5-turbo
34+
#
35+
# Note: These settings are stored in browser localStorage, not in .env
36+
#
37+
# ------------------------------------------------------------------------------

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build-and-test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18.x, 20.x, 22.x]
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
cache: 'npm'
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Run tests
31+
run: npm test
32+
33+
- name: Build project
34+
run: npm run build
35+
36+
- name: Upload build artifacts
37+
if: matrix.node-version == '20.x'
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: dist
41+
path: dist/
42+
retention-days: 7

.gitignore

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
# Dependencies
11+
node_modules
12+
13+
# Build outputs
14+
dist
15+
dist-ssr
16+
build
17+
*.local
18+
19+
# Environment variables & sensitive files
20+
.env
21+
.env.local
22+
.env.production
23+
.env.*.local
24+
*.key
25+
*.pem
26+
*secret*
27+
28+
# Archives (may contain sensitive data)
29+
*.zip
30+
*.tar.gz
31+
*.rar
32+
33+
# Editor directories and files
34+
.vscode/*
35+
!.vscode/extensions.json
36+
.idea
37+
.DS_Store
38+
*.suo
39+
*.ntvs*
40+
*.njsproj
41+
*.sln
42+
*.sw?
43+
44+
# OS files
45+
Thumbs.db
46+
.DS_Store
47+
48+
# Testing
49+
coverage
50+
.nyc_output
51+
52+
# Optional npm cache directory
53+
.npm
54+
55+
# Optional eslint cache
56+
.eslintcache
57+
/Dev
58+
CLAUDE.md
59+
AGENTS.md
60+
.claude/settings.local.json
61+
GEMINI.md

App.test.tsx

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import { describe, it, expect } from 'vitest'
2+
import { render, screen } from '@testing-library/react'
3+
import App from './App'
4+
5+
describe('App Smoke Tests', () => {
6+
it('should render without crashing', () => {
7+
render(<App />)
8+
expect(document.body).toBeDefined()
9+
})
10+
11+
it('should display the main title', () => {
12+
render(<App />)
13+
const title = screen.getByText(/LLM Prompt Optimizer/i)
14+
expect(title).toBeInTheDocument()
15+
})
16+
17+
it('should display the optimize button', () => {
18+
render(<App />)
19+
const button = screen.getByRole('button', { name: /optimize/i })
20+
expect(button).toBeInTheDocument()
21+
})
22+
23+
it('should have a textarea for prompt input', () => {
24+
render(<App />)
25+
const textarea = screen.getByPlaceholderText(/enter your prompt/i)
26+
expect(textarea).toBeInTheDocument()
27+
})
28+
29+
it('should display all LLM selection buttons', () => {
30+
render(<App />)
31+
expect(screen.getByText(/Gemini/i)).toBeInTheDocument()
32+
expect(screen.getByText(/Anthropic/i)).toBeInTheDocument()
33+
expect(screen.getByText(/OpenAI/i)).toBeInTheDocument()
34+
expect(screen.getByText(/Meta/i)).toBeInTheDocument()
35+
})
36+
37+
it('should display template section', () => {
38+
render(<App />)
39+
const templateHeader = screen.getByText(/Start with a Template/i)
40+
expect(templateHeader).toBeInTheDocument()
41+
})
42+
43+
it('should display history sidebar', () => {
44+
render(<App />)
45+
const historyTab = screen.getByRole('button', { name: /history/i })
46+
const favoritesTab = screen.getByRole('button', { name: /favorites/i })
47+
expect(historyTab).toBeInTheDocument()
48+
expect(favoritesTab).toBeInTheDocument()
49+
})
50+
})

0 commit comments

Comments
 (0)