whung99 Claude Opus 4.6 commited on
Commit
4432e84
·
1 Parent(s): 0d37119

feat: add HF Space config with Docker SDK

Browse files

Add YAML frontmatter for HuggingFace Spaces deployment and
multi-stage Dockerfile to build frontend and serve via FastAPI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Files changed (2) hide show
  1. Dockerfile +15 -0
  2. README.md +26 -79
Dockerfile ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM node:18-slim AS frontend-build
2
+ WORKDIR /app/frontend
3
+ COPY frontend/package*.json ./
4
+ RUN npm install --silent
5
+ COPY frontend/ ./
6
+ RUN npx vite build --outDir ../backend/static
7
+
8
+ FROM python:3.11-slim
9
+ WORKDIR /app
10
+ COPY backend/requirements.txt .
11
+ RUN pip install --no-cache-dir -r requirements.txt
12
+ COPY backend/ ./
13
+ COPY --from=frontend-build /app/backend/static ./static
14
+ EXPOSE 8000
15
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
README.md CHANGED
@@ -1,3 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
  # Oppy — AI Voice Assistant for Multi-Project Management
2
 
3
  Oppy is a voice-first AI assistant built on Google's Gemini ecosystem. It helps students and professionals juggling multiple projects (school, work, startup) stay on top of everything through natural voice conversation.
@@ -10,7 +22,7 @@ Oppy connects to your Gmail and Google Calendar, analyzes urgency across all you
10
  - Voice conversation powered by Gemini 3 Flash (chat) and Gemini 2.5 Flash TTS (speech)
11
  - Wake word activation — say "Oppy" to start hands-free
12
  - Animated SVG avatar with eye tracking, blinking, and mouth animation
13
- - Real Gmail and Google Calendar integration
14
  - Expandable project cards with direct action links
15
  - Gemini-inspired UI (Google Sans, white theme, Google color palette)
16
 
@@ -21,55 +33,8 @@ Oppy connects to your Gmail and Google Calendar, analyzes urgency across all you
21
  | Backend | Python, FastAPI, SSE streaming |
22
  | AI | Gemini 3 Flash (chat + function calling), Gemini 2.5 Flash Preview TTS |
23
  | Frontend | React 18, Vite, Web Speech API |
24
- | APIs | Gmail API, Google Calendar API |
25
-
26
- ## Quick start
27
-
28
- ### Prerequisites
29
- - Python 3.11+
30
- - Node.js 18+
31
- - A [Google AI API key](https://aistudio.google.com/apikey)
32
-
33
- ### Setup
34
-
35
- ```bash
36
- # Clone
37
- git clone https://github.com/solanathouu/hack-google.git
38
- cd hack-google
39
-
40
- # Backend
41
- cd backend
42
- pip install -r requirements.txt
43
- echo "GOOGLE_API_KEY=your_key_here" > .env
44
-
45
- # Frontend
46
- cd ../frontend
47
- npm install
48
- ```
49
-
50
- ### Run (development)
51
-
52
- Terminal 1 — backend:
53
- ```bash
54
- cd backend
55
- uvicorn main:app --host 0.0.0.0 --port 8000
56
- ```
57
-
58
- Terminal 2 — frontend:
59
- ```bash
60
- cd frontend
61
- npx vite --host 0.0.0.0 --port 5173
62
- ```
63
-
64
- Open http://localhost:5173
65
-
66
- ### Run (production / Replit)
67
-
68
- ```bash
69
- bash start.sh
70
- ```
71
-
72
- This builds the frontend and serves everything from FastAPI on port 8000.
73
 
74
  ## How to use
75
 
@@ -78,35 +43,6 @@ This builds the frontend and serves everything from FastAPI on port 8000.
78
  3. Once the green "Micro actif" dot appears, say **"Oppy"** or click again
79
  4. Ask anything: "What's my schedule today?", "Tell me about Sophie's email", "What should I prioritize?"
80
  5. Oppy answers vocally and listens for your next question
81
- 6. Say "merci" or "au revoir" to end the conversation
82
-
83
- ## Project structure
84
-
85
- ```
86
- backend/
87
- main.py — FastAPI app, API endpoints, static file serving
88
- agent.py — Gemini agent loop, chat session, system prompts
89
- tts.py — Gemini TTS audio generation
90
- mock_data.py — Demo emails, events, web signals
91
- urgency.py — Keyword-based urgency scoring
92
- initiative.py — Project health evaluation
93
- tools.py — Tool functions (read_emails, get_events, search_web)
94
- config.json — Project definitions
95
-
96
- frontend/src/
97
- App.jsx — Main orchestrator (phase state machine)
98
- components/
99
- JarvisOrb.jsx — Animated orb with phase-based effects
100
- OppyFace.jsx — SVG face (sparkle eyes + mouth)
101
- ConversationOverlay.jsx — Chat transcript display
102
- ProjectCard.jsx — Expandable project card with sources
103
- ProjectCardsDrawer.jsx — Bottom drawer for project cards
104
- hooks/
105
- useOperatorSSE.js — Chat API communication
106
- useTTS.js — Gemini TTS playback
107
- useWakeWord.js — Wake word detection
108
- useSpeechRecognition.js — Speech-to-text for conversation
109
- ```
110
 
111
  ## API endpoints
112
 
@@ -114,9 +50,20 @@ frontend/src/
114
  |--------|------|-------------|
115
  | POST | `/api/chat` | Send a message, get SSE streamed response |
116
  | POST | `/api/tts` | Convert text to speech (WAV audio) |
 
117
  | GET | `/api/project/{id}/sources` | Get emails, events, signals for a project |
 
 
118
  | GET | `/api/health` | Health check |
119
 
 
 
 
 
 
 
 
 
120
  ## License
121
 
122
  MIT
 
1
+ ---
2
+ title: Oppy
3
+ emoji: ✨
4
+ colorFrom: blue
5
+ colorTo: green
6
+ sdk: docker
7
+ app_port: 8000
8
+ pinned: false
9
+ license: mit
10
+ short_description: AI Voice Assistant for Multi-Project Management
11
+ ---
12
+
13
  # Oppy — AI Voice Assistant for Multi-Project Management
14
 
15
  Oppy is a voice-first AI assistant built on Google's Gemini ecosystem. It helps students and professionals juggling multiple projects (school, work, startup) stay on top of everything through natural voice conversation.
 
22
  - Voice conversation powered by Gemini 3 Flash (chat) and Gemini 2.5 Flash TTS (speech)
23
  - Wake word activation — say "Oppy" to start hands-free
24
  - Animated SVG avatar with eye tracking, blinking, and mouth animation
25
+ - Real Gmail and Google Calendar integration via OAuth 2.0
26
  - Expandable project cards with direct action links
27
  - Gemini-inspired UI (Google Sans, white theme, Google color palette)
28
 
 
33
  | Backend | Python, FastAPI, SSE streaming |
34
  | AI | Gemini 3 Flash (chat + function calling), Gemini 2.5 Flash Preview TTS |
35
  | Frontend | React 18, Vite, Web Speech API |
36
+ | APIs | Gmail API, Google Calendar API, Google Docs API |
37
+ | Auth | Google OAuth 2.0 |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
  ## How to use
40
 
 
43
  3. Once the green "Micro actif" dot appears, say **"Oppy"** or click again
44
  4. Ask anything: "What's my schedule today?", "Tell me about Sophie's email", "What should I prioritize?"
45
  5. Oppy answers vocally and listens for your next question
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
  ## API endpoints
48
 
 
50
  |--------|------|-------------|
51
  | POST | `/api/chat` | Send a message, get SSE streamed response |
52
  | POST | `/api/tts` | Convert text to speech (WAV audio) |
53
+ | GET | `/api/run` | Run the operator pipeline (SSE) |
54
  | GET | `/api/project/{id}/sources` | Get emails, events, signals for a project |
55
+ | GET | `/api/auth/status` | Check Google OAuth status |
56
+ | GET | `/api/auth/login` | Start Google OAuth flow |
57
  | GET | `/api/health` | Health check |
58
 
59
+ ## Environment variables
60
+
61
+ Set these as HuggingFace Space secrets:
62
+
63
+ | Variable | Description |
64
+ |----------|-------------|
65
+ | `GOOGLE_API_KEY` | Google AI API key from [AI Studio](https://aistudio.google.com/apikey) |
66
+
67
  ## License
68
 
69
  MIT