A personal recipe app as an alternative to HelloFresh ā simple meals with practical shopping lists for German supermarkets. Powered by AI for recipe generation and image creation.
# Clone the repository
git clone [email protected]:mahype/cookbook.git
cd cookbook
# Install dependencies
npm install
# Seed the database with example recipes
npm run seed
# Start the development server
npm run dev
The app runs at http://localhost:5178.
To enable AI recipe generation, configure a provider in the app:
The app can run as a native mobile app via Capacitor.
Prerequisites:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developersudo xcodebuild -license acceptBuild & Run:
# Build for Capacitor (uses adapter-static, stubs server modules)
bash scripts/build-capacitor.sh
# Build the iOS project
cd ios/App
xcodebuild -project App.xcodeproj -scheme App \
-destination 'platform=iOS Simulator,name=iPhone 17 Pro' \
-configuration Debug build
# Run in Simulator
xcrun simctl boot "iPhone 17 Pro" # or any available simulator
open -a Simulator
xcrun simctl install booted ~/Library/Developer/Xcode/DerivedData/App-*/Build/Products/Debug-iphonesimulator/App.app
xcrun simctl launch booted de.cookbook.app
Or via Xcode GUI:
npx cap open ios
Then select a simulator or connected device and press ā¶ļø.
On a real iPhone (free, no Developer Account needed):
npx cap open iosFor App Store distribution:
Prerequisites:
Setup (first time):
# After Android Studio is installed, add platform tools to PATH
# (add to ~/.zshrc or ~/.bashrc)
export ANDROID_HOME=$HOME/Library/Android/sdk # macOS
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/emulator
# Create an emulator (or do it via Android Studio ā Virtual Device Manager)
# Android Studio ā More Actions ā Virtual Device Manager ā Create Device
# Recommended: Pixel 8, API 34 (Android 14)
Build & Run:
# Build for Capacitor
bash scripts/build-capacitor.sh
# Open in Android Studio
npx cap open android
Then select an emulator or connected device and press ā¶ļø.
On a real Android phone:
For Play Store distribution:
npm run dev # Start dev server (web, with hot reload)
npm run build # Production build (web)
npm run build:cap # Capacitor build + sync (CAPACITOR=true)
bash scripts/build-capacitor.sh # Full native build (stubs server, syncs platforms)
| Component | Technology |
|---|---|
| Frontend | SvelteKit (Svelte 5) with Runes |
| Styling | Tailwind CSS v4 |
| Database (web) | SQLite via better-sqlite3 |
| Database (native) | SQLite via sql.js (WASM) |
| Native wrapper | Capacitor |
| Language | TypeScript |
| Build | Vite |
Web mode: SvelteKit with server-side rendering, better-sqlite3 for the database, API routes for data access.
Native mode (Capacitor): SvelteKit with adapter-static (SPA), sql.js (SQLite compiled to WASM) running in the browser, all data stored in IndexedDB. No server needed ā the app works fully offline.
The dual-mode architecture is handled by src/lib/stores/data.ts which detects the environment and routes data calls accordingly.
cookbook/
āāā scripts/
ā āāā seed.ts # Database seeder
ā āāā build-capacitor.sh # Native build script
āāā src/
ā āāā lib/
ā ā āāā server/
ā ā ā āāā db.ts # Server-side SQLite (better-sqlite3)
ā ā ā āāā ai.ts # Multi-provider AI abstraction
ā ā āāā client/
ā ā ā āāā db.ts # Client-side SQLite (sql.js/WASM)
ā ā ā āāā ai-recipes.ts # Client-side AI recipe generation
ā ā ā āāā ai-images.ts # DALL-E image generation + validation
ā ā āāā stores/
ā ā ā āāā data.ts # Dual-mode data layer (server vs client)
ā ā āāā stubs/
ā ā ā āāā better-sqlite3.ts # Mock for Capacitor builds
ā ā āāā pantryMatch.ts # Pantry matching utility
ā ā āāā components/
ā ā āāā RecipeCard.svelte # Recipe card (approve, dismiss, expand)
ā ā āāā RecipeDetails.svelte # Ingredients + steps
ā ā āāā TabToggle.svelte # Tab switcher
ā ā āāā StepIndicator.svelte # Multi-step wizard
ā āāā routes/
ā āāā rezepte/ # Recipes (suggestions + saved, tab toggle)
ā āāā lebensmittel/ # Shopping list + pantry (tab toggle)
ā āāā einstellungen/ # Settings (preferences, AI, servings)
ā āāā planen/ # Meal planning + voting
ā āāā api/ # REST endpoints (web mode only)
āāā ios/ # iOS project (gitignored, generated)
āāā android/ # Android project (gitignored, generated)
āāā capacitor.config.ts # Capacitor configuration
āāā svelte.config.js # SvelteKit config (dual adapter)
āāā vite.config.ts # Vite config (with Capacitor alias)
Private project.