From 42ca76c48b6cc1a0656e5216889b077c96c6ac6a Mon Sep 17 00:00:00 2001 From: "juancarlos.cavero" Date: Thu, 30 Apr 2026 07:05:41 +0200 Subject: [PATCH] feat: Make Upload-Post API key required and warn on every screen Treat the Upload-Post key as mandatory like the Gemini key: block /api/process when either is missing, mark the Settings section as Required, and show a persistent banner plus a header pill on every screen until both keys are configured. The missing-key modal now lets the user paste each key inline. Co-Authored-By: Claude Opus 4.7 (1M context) --- dashboard/src/App.jsx | 150 ++++++++++++++++++++++++++++++------------ 1 file changed, 107 insertions(+), 43 deletions(-) diff --git a/dashboard/src/App.jsx b/dashboard/src/App.jsx index 6e6bf49..57f37cc 100644 --- a/dashboard/src/App.jsx +++ b/dashboard/src/App.jsx @@ -1,5 +1,5 @@ import React, { useState, useEffect } from 'react'; -import { Upload, FileVideo, Sparkles, Youtube, Instagram, Share2, LogOut, ChevronDown, Check, Activity, LayoutDashboard, Settings, PlusCircle, History, Menu, X, Terminal, Shield, LayoutGrid, Image, Globe, RotateCcw, Calendar } from 'lucide-react'; +import { Upload, FileVideo, Sparkles, Youtube, Instagram, Share2, LogOut, ChevronDown, Check, Activity, LayoutDashboard, Settings, PlusCircle, History, Menu, X, Terminal, Shield, LayoutGrid, Image, Globe, RotateCcw, Calendar, AlertTriangle, KeyRound } from 'lucide-react'; import KeyInput from './components/KeyInput'; import MediaInput from './components/MediaInput'; import ResultCard from './components/ResultCard'; @@ -321,7 +321,7 @@ function App() { }; const handleProcess = async (data) => { - if (!apiKey) { + if (!apiKey || !uploadPostKey) { setShowKeyModal(true); return; } @@ -494,14 +494,48 @@ function App() { /> )} - {!apiKey && ( - - API Key Missing - + {(!apiKey || !uploadPostKey) && ( + )} + {/* Persistent Missing Keys Banner — visible on every screen */} + {(!apiKey || !uploadPostKey) && activeTab !== 'settings' && ( +
+
+ +
+ Required API keys missing.{' '} + + {!apiKey && !uploadPostKey + ? 'Set your Gemini and Upload-Post API keys to use OpenShorts.' + : !apiKey + ? 'Set your Gemini API key to use OpenShorts.' + : 'Set your Upload-Post API key to use OpenShorts.'} + +
+
+ +
+ )} + {/* Session Recovery Banner */} {sessionRecovered && (
@@ -530,15 +564,14 @@ function App() {
-
+

Social Integration

- Optional + Required

- Automatically publish your clips to TikTok, Instagram Reels, and YouTube Shorts via Upload-Post. + Required to publish your clips to TikTok, Instagram Reels, and YouTube Shorts via Upload-Post. Includes a free tier (no credit card required). - If you prefer, you can skip this and manually download/upload your videos.

@@ -856,43 +889,74 @@ function App() { {showKeyModal && (
setShowKeyModal(false)}>
e.stopPropagation()}> -

Gemini API Key Required

+

+ {!apiKey && !uploadPostKey + ? 'Required API Keys Missing' + : !apiKey + ? 'Gemini API Key Required' + : 'Upload-Post API Key Required'} +

- You need a Google Gemini API key to use the Clip Generator. It's free and takes 30 seconds to get. + OpenShorts needs both a Gemini API key and an Upload-Post API key. Both have free tiers.

-
-

How to get your free key:

-
    -
  1. Go to aistudio.google.com/app/apikey
  2. -
  3. Sign in with your Google account
  4. -
  5. Click "Create API Key"
  6. -
  7. Copy the key and paste it below
  8. -
-
- { - if (e.key === 'Enter' && e.target.value.trim()) { - setApiKey(e.target.value.trim()); - setShowKeyModal(false); - } - }} - /> - {/* Upload-Post info */} -
-

Optional: Auto-publish to social media

-

- With an Upload-Post API key you can publish your clips directly to TikTok, Instagram Reels, and YouTube Shorts — or schedule them for later. Free tier available, no credit card needed. + {/* Gemini block */} +

+

+ {apiKey ? : } + Gemini API Key {apiKey && — set}

-
    -
  1. Register at app.upload-post.com
  2. -
  3. Connect your TikTok, Instagram, or YouTube accounts
  4. -
  5. Go to API Keys and generate one
  6. -
  7. Paste it in Settings — done!
  8. -
+ {!apiKey && ( + <> +
    +
  1. Go to aistudio.google.com/app/apikey
  2. +
  3. Sign in with your Google account
  4. +
  5. Click "Create API Key"
  6. +
  7. Copy the key and paste it below
  8. +
+ { + if (e.key === 'Enter' && e.target.value.trim()) { + setApiKey(e.target.value.trim()); + } + }} + /> + + )} +
+ + {/* Upload-Post block */} +
+

+ {uploadPostKey ? : } + Upload-Post API Key {uploadPostKey && — set} +

+ {!uploadPostKey && ( + <> +

+ Required to publish your clips to TikTok, Instagram Reels, and YouTube Shorts. Free tier available, no credit card needed. +

+
    +
  1. Register at app.upload-post.com
  2. +
  3. Connect your TikTok, Instagram, or YouTube accounts
  4. +
  5. Go to API Keys and generate one
  6. +
  7. Paste it below
  8. +
+ { + if (e.key === 'Enter' && e.target.value.trim()) { + setUploadPostKey(e.target.value.trim()); + } + }} + /> + + )}