An open API service indexing awesome lists of open source software.

https://github.com/diberry/typescript-cosmosdb-business-intelligence-ai


https://github.com/diberry/typescript-cosmosdb-business-intelligence-ai

Last synced: 4 months ago
JSON representation

Awesome Lists containing this project

README

          

# TypeScript Cosmos DB Business Intelligence AI

๐ŸŽ“ **A Teaching Repository for Building AI-Powered Movie Search with Azure**

Learn how to build a complete TypeScript application that combines Azure Cosmos DB with OpenAI for intelligent movie search and recommendations.

## ๐Ÿš€ Quick Start

1. **Prerequisites**: Azure subscription, Node.js 18+, TypeScript
2. **Setup**: `npm install && npm run setup`
3. **Deploy**: `npm run deploy`
4. **Run**: `npm start`

## ๐Ÿ“š Learning Path

This repository is organized for progressive learning:

### ๐Ÿ“– Documentation
- [`docs/README.md`](docs/README.md) - Detailed project overview
- [`docs/getting-started.md`](docs/getting-started.md) - Step-by-step setup guide
- [`docs/architecture.md`](docs/architecture.md) - System design and patterns
- [`docs/lessons-learned.md`](docs/lessons-learned.md) - Critical implementation insights
- [`docs/troubleshooting.md`](docs/troubleshooting.md) - Common issues and solutions

### ๐ŸŽ“ Tutorials
- [`tutorials/01-setup/`](tutorials/01-setup/) - Environment and Azure resource setup
- [`tutorials/02-cosmos-db/`](tutorials/02-cosmos-db/) - Database operations and vector indexing
- [`tutorials/03-openai-integration/`](tutorials/03-openai-integration/) - AI/ML integration patterns
- [`tutorials/04-vector-search/`](tutorials/04-vector-search/) - Semantic search implementation
- [`tutorials/05-testing/`](tutorials/05-testing/) - Comprehensive testing strategies

### ๐Ÿ“‹ Examples
- [`examples/basic-queries/`](examples/basic-queries/) - Simple Cosmos DB queries
- [`examples/vector-search/`](examples/vector-search/) - Vector similarity search
- [`examples/ai-responses/`](examples/ai-responses/) - OpenAI integration patterns

## ๐Ÿ—๏ธ Architecture

```mermaid
graph TD
A[CLI Application] --> B[Movie AI Core]
B --> C[Cosmos DB Client]
B --> D[OpenAI Client]
C --> E[Vector Search]
D --> F[Embeddings]
D --> G[Chat Completions]
```

## ๐Ÿงช Testing

- **Unit Tests**: `npm test`
- **Integration Tests**: `npm run test:integration`
- **E2E Tests**: `npm run test:e2e`
- **Coverage**: `npm run coverage`

## ๐Ÿ› ๏ธ Key Technologies

- **TypeScript ESM** - Modern JavaScript with strong typing
- **Azure Cosmos DB** - NoSQL database with vector search
- **Azure OpenAI** - GPT-4o and text-embedding-ada-002
- **Vitest** - Fast and modern testing framework
- **Azure Developer CLI** - Infrastructure as code

## ๐Ÿ“ Project Structure

```
โ”œโ”€โ”€ ๐Ÿ“š docs/ # All documentation
โ”œโ”€โ”€ ๐ŸŽ“ tutorials/ # Step-by-step learning materials
โ”œโ”€โ”€ ๐Ÿ“‹ examples/ # Code examples for each feature
โ”œโ”€โ”€ ๐Ÿ“ src/ # Source code (well-organized)
โ”œโ”€โ”€ ๐Ÿงช tests/ # Comprehensive test suite
โ”œโ”€โ”€ ๐Ÿ› ๏ธ tools/ # Scripts and infrastructure
โ””โ”€โ”€ ๐Ÿ“Š data/ # Sample data and schemas
```

## ๐Ÿ”ง Development Commands

```bash
# Setup and deployment
npm run setup # Initial environment setup
npm run deploy # Deploy Azure resources
npm run validate # Validate configuration

# Development
npm run dev # Start development mode
npm run build # Build for production
npm run lint # Code linting

# Testing
npm test # Run all tests
npm run test:unit # Unit tests only
npm run test:integration # Integration tests only
npm run coverage # Generate coverage report
```

## ๐ŸŽฏ Learning Objectives

After completing this tutorial, you'll understand:

- โœ… Modern TypeScript ESM patterns and async/await best practices
- โœ… Azure Cosmos DB vector search and indexing strategies
- โœ… OpenAI API integration with proper error handling
- โœ… Semantic search implementation with fallback mechanisms
- โœ… Comprehensive testing strategies for Azure applications
- โœ… Infrastructure as code with Azure Developer CLI

## ๐Ÿšจ Critical Configuration Notes

โš ๏ธ **Common Pitfall**: Azure OpenAI baseURL construction
- โŒ Wrong: `https://account.openai.azure.com/`
- โœ… Correct: `https://account.openai.azure.com/openai/deployments/model-name`

๐Ÿ“– See [`docs/lessons-learned.md`](docs/lessons-learned.md) for comprehensive troubleshooting guidance.

## ๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

---

๐Ÿ’ก **Tip**: Start with [`docs/getting-started.md`](docs/getting-started.md) for a guided learning experience!