# Repository Overview
This document provides a quick overview of the GitHub repository structure and what's included.
## π Repository Structure
```
ChatGPT-Components/
βββ README.md # Main entry point - overview & quick start
βββ CONTRIBUTING.md # Contribution guidelines
βββ server.js # Main Node.js server (4 MCP servers)
βββ package.json # Dependencies
βββ Procfile # Heroku deployment config
β
βββ widgets/ # Interactive HTML components
β βββ target-auth.html # Authentication widget
β βββ product-carousel.html # Product search widget
β βββ add-to-cart.html # Add to cart widget
β βββ checkout.html # Checkout widget
β βββ circle-signup.html # Membership signup widget
β
βββ public/ # Static pages
β βββ auth.html # External auth (Custom GPT Actions)
β βββ privacy.html # Privacy policy
β
βββ docs/ # Comprehensive documentation
βββ BUILDING_MCP_SERVERS.md # Step-by-step tutorial
βββ ARCHITECTURE.md # System design & data flows
βββ examples/ # Deep dives into each example
βββ authentication.md # MCP 1: Authentication server
βββ product-search.md # MCP 2: Product search server
βββ checkout.md # MCP 3: Checkout server
βββ membership.md # MCP 4: Membership server
```
## π― What This Repository Teaches
### 1. **README.md** - First Stop
- Quick overview of all 4 MCP servers
- Live URLs you can connect to immediately
- Quick start guide for local development
- Repository structure explanation
### 2. **BUILDING_MCP_SERVERS.md** - The Tutorial
Comprehensive guide covering:
- What is MCP and how it works
- Building your first MCP server (task manager example)
- Creating interactive widgets
- State management patterns
- Advanced patterns (multi-screen flows, API integration)
- Deployment strategies
- Best practices
**Perfect for**: Developers new to MCP
### 3. **ARCHITECTURE.md** - System Design
Deep dive into:
- Complete system architecture with diagrams
- Communication protocols (SSE, JSON-RPC)
- State management strategies
- Data flow examples for all 4 servers
- Security considerations
- Performance optimization
- Scalability strategies
**Perfect for**: Understanding how everything works together
### 4. **Example Documentation** - Practical Reference
Each example includes:
- β
Overview and demo flow
- β
Architecture breakdown
- β
Tool definitions with code
- β
Widget implementation details
- β
JavaScript patterns and functions
- β
Styling (dark/light mode)
- β
Server endpoints
- β
Usage examples
- β
Customization guide
- β
Testing checklist
- β
Common issues and fixes
- β
Performance tips
- β
Next steps
#### **authentication.md** (MCP 1)
- Session-based authentication
- 3-screen flow (login β verification β success)
- Widget-to-server communication
- Session cleanup
#### **product-search.md** (MCP 2)
- External API integration (Unwrangle)
- Interactive carousel widget
- Detail view navigation
- Personalized AI recommendations
- Loading states
#### **checkout.md** (MCP 3)
- Shopping cart management
- Add-to-cart confirmation
- Complete checkout flow
- Pre-filled payment/shipping
- Success animations
- Single-item cart enforcement
#### **membership.md** (MCP 4)
- Multi-tier selection UI
- Dynamic order summary
- Complex form processing
- Confetti animations
- Multi-screen transitions
## π Live MCP Servers
All servers are live and ready to connect:
| Server | URL | Port | Demo Prompt |
|--------|-----|------|-------------|
| Auth | `https://chatgpt-components-0d9232341440.herokuapp.com/mcp` | Production | *"Log me into Target"* |
| Search | `https://chatgpt-components-0d9232341440.herokuapp.com/mcp2` | Production | *"Search for fitness trackers"* |
| Checkout | `https://chatgpt-components-0d9232341440.herokuapp.com/mcp3` | Production | *"Add to cart and checkout"* |
| Membership | `https://chatgpt-components-0d9232341440.herokuapp.com/mcp4` | Production | *"Sign up for Circle 360"* |
## π Learning Paths
### Beginner (Never built an MCP server)
1. Read **README.md** - understand what's possible
2. Read **BUILDING_MCP_SERVERS.md** - follow the tutorial
3. Connect to live servers - see them in action
4. Clone repo and run locally
5. Modify one example to learn
### Intermediate (Built simple tools)
1. Read **ARCHITECTURE.md** - understand patterns
2. Read specific example docs that match your use case
3. Build your own server using patterns from examples
4. Customize widgets for your brand
### Advanced (Building production systems)
1. Study **ARCHITECTURE.md** - system design
2. Review security considerations
3. Implement scalability patterns
4. Add database integration
5. Deploy to production
## π¨ Key Features Demonstrated
### UI/UX Patterns
- β
Multi-screen flows with smooth transitions
- β
Loading states and progress indicators
- β
Success animations (checkmarks, confetti)
- β
Dark/light mode support
- β
Responsive design
- β
Interactive carousels
- β
Form validation
- β
Detail views
### Technical Patterns
- β
Session management with unique IDs
- β
State persistence across tool calls
- β
SSE for real-time communication
- β
Multiple MCP servers on one Node.js app
- β
External API integration
- β
Widget-to-server communication
- β
`window.openai` API usage
- β
Dynamic content injection
### Business Logic
- β
Authentication flows
- β
Product recommendations (AI personalization)
- β
Shopping cart management
- β
Payment/checkout flows
- β
Membership signups
- β
Tier selection
## π Documentation Quality
Each piece of documentation includes:
- **Clear explanations** in plain English
- **Code examples** with syntax highlighting
- **Diagrams** for visual learners
- **Real-world use cases**
- **Troubleshooting guides**
- **Customization examples**
- **Performance tips**
- **Security recommendations**
## π€ Contributing
See **CONTRIBUTING.md** for:
- How to contribute
- Code style guidelines
- PR process
- Testing requirements
- Recognition for contributors
## π Quick Links
- **Start Here**: [README.md](README.md)
- **Learn MCP**: [BUILDING_MCP_SERVERS.md](docs/BUILDING_MCP_SERVERS.md)
- **System Design**: [ARCHITECTURE.md](docs/ARCHITECTURE.md)
- **Examples**: [docs/examples/](docs/examples/)
- **Contribute**: [CONTRIBUTING.md](CONTRIBUTING.md)
## π― Use Cases for This Repo
### For Learning
- Study MCP patterns
- Learn widget development
- Understand state management
- Practice API integration
### For Building
- Use as starter template
- Copy specific patterns
- Adapt widgets for your brand
- Deploy your own servers
### For Teaching
- Share with your team
- Use in workshops
- Reference in tutorials
- Demonstrate capabilities
### For Production
- Understand best practices
- Learn security patterns
- Study scalability
- See deployment strategies
## π What Makes This Repo Special
1. **Complete Examples**: Not just toy demos - production-ready patterns
2. **Comprehensive Docs**: Every aspect explained in detail
3. **Live Servers**: Test immediately without setup
4. **Multiple Patterns**: 4 different use cases to learn from
5. **Educational Focus**: Built specifically for teaching
6. **Copy-Paste Ready**: Use code directly in your projects
7. **Best Practices**: Security, performance, UX all considered
## π Next Steps
After exploring this repository:
1. **Connect to live servers** - See what's possible
2. **Read the tutorial** - Build your own server
3. **Clone and modify** - Learn by doing
4. **Deploy your own** - Share with others
5. **Contribute back** - Help others learn
---
## π You're Ready!
This repository contains everything you need to:
- β
Learn MCP development
- β
Build interactive ChatGPT components
- β
Deploy production servers
- β
Share knowledge with others
**Start with [README.md](README.md) and go from there!**
Happy building! π