This contains everything you need to run your app locally with a secure backend.
View your app in AI Studio: https://ai.studio/apps/drive/1aqT_T8oW6muK6YXOBnzlXNce5Z7f5u5u
Prerequisites: Node.js
-
Install dependencies:
npm install
-
Set the
OPENAI_API_KEYin .env to your OpenAI API key:OPENAI_API_KEY=your-actual-api-key-here -
Run the app with backend:
npm start
This will start both the backend server (port 3001) and the frontend dev server (port 3000).
Alternatively, run them separately:
- Backend:
npm run server(port 3001) - Frontend:
npm run dev(port 3000)
- Backend:
The app now uses a Node.js backend to keep your OpenAI API key secure:
- Backend (
server.js): Express server that handles all OpenAI API calls - Frontend (React/Vite): Communicates with backend via
/apiendpoints - API Key Security: The OpenAI API key is only stored on the server and never exposed to the browser
