diff --git a/learning/.devcontainer/devcontainer.json b/learning/.devcontainer/devcontainer.json new file mode 100644 index 0000000..3c0ba32 --- /dev/null +++ b/learning/.devcontainer/devcontainer.json @@ -0,0 +1,22 @@ + "customizations": { + "vscode": { + "extensions": [ + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode", + "bradlc.vscode-tailwindcss" + ] + } + }, + "forwardPorts": [ + 3000 + ], + "portsAttributes": { + "3000": { + "label": "Learning App", + "onAutoForward": "notify" + } + }, + "postCreateCommand": "npm install", + "postStartCommand": "if [ ! -f .env.local ]; then cp .env.example .env.local && echo '✅ Created .env.local from .env.example.'; fi && echo '🚀 Ready! Run: npm run dev' && echo '📝 Set GOOGLE_API_KEY in .env.local'", + "remoteUser": "node" +} \ No newline at end of file diff --git a/learning/.env.example b/learning/.env.example new file mode 100644 index 0000000..825e33c --- /dev/null +++ b/learning/.env.example @@ -0,0 +1,3 @@ +# Google Gemini API Key +# Get your API key from: https://aistudio.google.com/app/apikey +GOOGLE_API_KEY=your_api_key_here diff --git a/learning/.gitignore b/learning/.gitignore index 5ef6a52..7b8da95 100644 --- a/learning/.gitignore +++ b/learning/.gitignore @@ -32,6 +32,7 @@ yarn-error.log* # env files (can opt-in for committing if needed) .env* +!.env.example # vercel .vercel diff --git a/learning/README.md b/learning/README.md index afeca84..bc721c8 100644 --- a/learning/README.md +++ b/learning/README.md @@ -98,9 +98,39 @@ learning/ └── NOTES.md # Detailed design documentation ``` -## Getting Started -### Prerequisites +### 🚀 Quick Start with GitHub Codespaces + +The fastest way to get started is using GitHub Codespaces - no local setup required! + +[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/google-gemini/workshops) + +1. **Open in Codespaces** + - Navigate to the [workshops repository](https://github.com/google-gemini/workshops) + - Click **Code** → **Codespaces** → **Create codespace on main** + - Wait for the environment to initialize (~2-3 minutes) + +2. **Set up your API key** + ```bash + # A .env.local file is automatically created for you when the Codespace starts. + # Edit .env.local and add your GOOGLE_API_KEY from https://aistudio.google.com/app/apikey + ``` + +3. **Start the development server** + ```bash + npm run dev + ``` + +4. **Open the app** + - VSCode will show a notification to open the forwarded port + - Click **Open in Browser** or navigate to the **Ports** tab + +That's it! The application is now running in your browser. 🎉 + +--- + +### Prerequisites (Local Development) + - Node.js 18+ and npm - Google API Key with access to Gemini API