File size: 8,978 Bytes
831ccdd
 
 
 
 
a84e269
20c8fc2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a84e269
afb889c
4077a2f
afb889c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
831ccdd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
---
title: HealBot Avatar
sdk: docker
emoji: πŸ“ˆ
---
<<<<<<< HEAD
# πŸ€– Talking Avatar with AI

An interactive 3D talking avatar powered by AI that can have natural conversations with users. The avatar features realistic lip-sync, facial expressions, and animations.

![License](https://img.shields.io/badge/license-MIT-blue.svg)
![Node](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen)
![Python](https://img.shields.io/badge/python-3.8%2B-blue)

## ✨ Features

- 🎭 **3D Animated Avatar** - Realistic 3D character with smooth animations
- πŸ’¬ **AI-Powered Conversations** - Natural language chat using custom AI API
- πŸ—£οΈ **Text-to-Speech** - High-quality voice synthesis using Edge TTS
- πŸ‘„ **Lip Sync** - Accurate lip synchronization using Rhubarb Lip Sync
- 😊 **Facial Expressions** - Dynamic expressions based on conversation context
- 🎀 **Voice Input** - Browser-based speech recognition (Web Speech API)
- πŸ” **User Authentication** - Firebase authentication with personalized sessions
- πŸ“± **Responsive Design** - Works on desktop and mobile devices

## πŸ—οΈ Architecture

```
talking-avatar-with-ai/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ backend/          # Express.js API server
β”‚   β”‚   β”œβ”€β”€ modules/      # Custom API, lip-sync logic
β”‚   β”‚   β”œβ”€β”€ utils/        # TTS utilities
β”‚   β”‚   └── server.js     # Main server file
β”‚   └── frontend/         # React + Vite application
β”‚       β”œβ”€β”€ src/
β”‚       β”‚   β”œβ”€β”€ components/  # Avatar, Chat UI
β”‚       β”‚   β”œβ”€β”€ hooks/       # Speech, authentication
β”‚       β”‚   └── contexts/    # Auth context
β”‚       └── public/
β”‚           └── models/      # 3D avatar models
β”œβ”€β”€ Rhubarb-Lip-Sync-*/  # Lip sync engine
└── resources/            # Additional resources

```

## πŸš€ Quick Start

### Prerequisites

- Node.js 18+ 
- Python 3.8+
- Git

### Installation

1. **Clone the repository**
   ```bash
   git clone https://github.com/YOUR_USERNAME/talking-avatar-with-ai.git
   cd talking-avatar-with-ai
   ```

2. **Install dependencies**
   ```bash
   # Install root dependencies
   npm install

   # Install backend dependencies
   cd apps/backend
   npm install

   # Install frontend dependencies
   cd ../frontend
   npm install
   ```

3. **Install Python dependencies**
   ```bash
   pip install edge-tts
   ```

4. **Set up environment variables**
   ```bash
   # Backend
   cd apps/backend
   cp .env.example .env
   # Edit .env if needed (no variables required for basic setup)

   # Frontend
   cd ../frontend
   cp .env.example .env
   # Edit .env and set VITE_API_URL=http://localhost:3000
   ```

5. **Run the application**

   **Option 1: Run both services together (from root)**
   ```bash
   npm run dev
   ```

   **Option 2: Run separately**
   ```bash
   # Terminal 1 - Backend
   cd apps/backend
   npm run dev

   # Terminal 2 - Frontend
   cd apps/frontend
   npm run dev
   ```

6. **Open your browser**
   - Navigate to `http://localhost:5173`
   - Start chatting with your avatar!

## 🌐 Deployment

See [DEPLOY.md](./DEPLOY.md) for detailed deployment instructions.

### Quick Deploy Options:

**Backend:** Railway, Render, or Heroku  
**Frontend:** Vercel, Netlify, or Railway

### Recommended Setup:
- **Backend** β†’ Railway (includes Python support)
- **Frontend** β†’ Vercel (optimized for React/Vite)

## πŸ”§ Configuration

### Custom API

The avatar uses a custom chat API. To change it, edit:
```javascript
// apps/backend/modules/customAPI.mjs
const API_BASE_URL = "https://your-api-url.com";
```

### Avatar Model

To use a different 3D avatar:
1. Export your avatar as GLB format
2. Place in `apps/frontend/public/models/`
3. Update the path in `Avatar.jsx`

### Voice Settings

Modify TTS voice in:
```python
# apps/backend/utils/tts.py
voice = "en-US-AriaNeural"  # Change to your preferred voice
```

## πŸ“š Tech Stack

### Frontend
- **React** - UI framework
- **Three.js** - 3D rendering
- **@react-three/fiber** - React renderer for Three.js
- **@react-three/drei** - Useful helpers for R3F
- **Vite** - Build tool
- **Firebase** - Authentication

### Backend
- **Express.js** - Web server
- **Node.js** - Runtime
- **Python** - TTS processing
- **Edge TTS** - Text-to-speech
- **Rhubarb Lip Sync** - Lip synchronization

## 🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## πŸ“ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## πŸ™ Acknowledgments

- [Rhubarb Lip Sync](https://github.com/DanielSWolf/rhubarb-lip-sync) - Lip sync engine
- [Edge TTS](https://github.com/rany2/edge-tts) - Text-to-speech
- [Ready Player Me](https://readyplayer.me/) - Avatar creation (if used)
- [Three.js](https://threejs.org/) - 3D graphics library

## πŸ“§ Contact

For questions or support, please open an issue on GitHub.

## 🎯 Roadmap

- [ ] Multi-language support
- [ ] Custom avatar upload
- [ ] Voice cloning
- [ ] Emotion detection
- [ ] Screen sharing capability
- [ ] Mobile app version

---

**Made with ❀️ by [Your Name]**
=======
---
title: HealAvatar
emoji: 🐠
colorFrom: indigo
colorTo: red
sdk: static
pinned: false
app_build_command: npm run build
app_file: build/index.html
---

# Getting Started with Create React App

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.

The page will reload when you make changes.\
You may also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can't go back!**

If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.

You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

### Code Splitting

This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)

### Analyzing the Bundle Size

This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)

### Making a Progressive Web App

This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)

### Advanced Configuration

This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)

### Deployment

This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)

### `npm run build` fails to minify

This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
>>>>>>> 601fb1de6c4d68f8dbc1519e0193a88cdb8675f0