@powerhousedao/switchboard 4.1.0-dev.5 → 4.1.0-dev.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,34 @@
1
+ ## 4.1.0-dev.8 (2025-08-06)
2
+
3
+ ### 🚀 Features
4
+
5
+ - **switchboard,config,reactor-api:** handle auth in reactor-api ([f33c921ee](https://github.com/powerhouse-inc/powerhouse/commit/f33c921ee))
6
+
7
+ ### ❤️ Thank You
8
+
9
+ - acaldas @acaldas
10
+
11
+ ## 4.1.0-dev.7 (2025-08-06)
12
+
13
+ ### 🚀 Features
14
+
15
+ - **switchboard:** added readme ([fbadfca11](https://github.com/powerhouse-inc/powerhouse/commit/fbadfca11))
16
+
17
+ ### ❤️ Thank You
18
+
19
+ - Frank
20
+
21
+ ## 4.1.0-dev.6 (2025-08-06)
22
+
23
+ ### 🚀 Features
24
+
25
+ - **reactor-mcp:** load local document models and reload when they change ([0408a017c](https://github.com/powerhouse-inc/powerhouse/commit/0408a017c))
26
+ - **reactor-local,reactor-api,document-drive:** reload local document models when they change ([5d9af3951](https://github.com/powerhouse-inc/powerhouse/commit/5d9af3951))
27
+
28
+ ### ❤️ Thank You
29
+
30
+ - acaldas @acaldas
31
+
1
32
  ## 4.1.0-dev.5 (2025-08-05)
2
33
 
3
34
  This was a version bump only for @powerhousedao/switchboard to align it with other projects, there were no code changes.
package/README.md ADDED
@@ -0,0 +1,218 @@
1
+ # Switchboard
2
+
3
+ A powerful document-driven server that provides a unified API for managing and serving document models, drives, and reactors in the Powerhouse ecosystem.
4
+
5
+ ## 🚀 Features
6
+
7
+ - **Document Model Management**: Serve and manage document models with GraphQL API
8
+ - **Document Drive Support**: Handle document drives with filesystem and PostgreSQL storage
9
+ - **Reactor Integration**: Built-in support for Powerhouse reactors
10
+ - **Flexible Storage**: Support for filesystem, PostgreSQL, and Redis caching
11
+ - **Docker Ready**: Containerized deployment with comprehensive environment configuration
12
+ - **Authentication**: Configurable authentication with guest, user, and admin roles
13
+ - **HTTPS Support**: Built-in HTTPS server with custom certificates
14
+ - **Profiling**: Integration with Pyroscope for performance monitoring
15
+ - **Error Tracking**: Sentry integration for error monitoring and reporting
16
+
17
+ ## 📦 Installation
18
+
19
+ ### Prerequisites
20
+
21
+ - Node.js 22+
22
+ - pnpm (recommended) or npm
23
+ - Redis (optional, for caching)
24
+ - PostgreSQL (optional, for persistent storage)
25
+
26
+ ### Local Development
27
+
28
+ ```bash
29
+ # Clone the repository
30
+ git clone https://github.com/powerhouse-inc/powerhouse.git
31
+ cd powerhouse
32
+
33
+ # Install dependencies
34
+ pnpm install
35
+
36
+ # Build the switchboard
37
+ pnpm --filter @powerhousedao/switchboard build
38
+
39
+ # Start in development mode
40
+ pnpm --filter @powerhousedao/switchboard dev
41
+ ```
42
+
43
+ ### Global Installation
44
+
45
+ ```bash
46
+ # Install globally
47
+ npm install -g @powerhousedao/switchboard
48
+
49
+ # Or using pnpm
50
+ pnpm add -g @powerhousedao/switchboard
51
+ ```
52
+
53
+ ## 🏃‍♂️ Quick Start
54
+
55
+ ## ⚙️ Configuration
56
+
57
+ ### Environment Variables
58
+
59
+ | Variable | Description | Default |
60
+ |----------|-------------|---------|
61
+ | `PORT` | Server port | `4001` |
62
+ | `DATABASE_URL` | Database connection string | `./.ph/drive-storage` |
63
+ | `REDIS_URL` | Redis connection URL | - |
64
+ | `REDIS_TLS_URL` | Redis TLS connection URL | - |
65
+ | `SENTRY_DSN` | Sentry DSN for error tracking | - |
66
+ | `SENTRY_ENV` | Sentry environment | - |
67
+ | `PYROSCOPE_SERVER_ADDRESS` | Pyroscope server address | - |
68
+
69
+ ### Authentication Configuration
70
+
71
+ ```typescript
72
+ const options = {
73
+ auth: {
74
+ enabled: true,
75
+ guests: ['0x123', '0x456'],
76
+ users: ['0x789', '0xabc'],
77
+ admins: ['0xdef', '0xghi']
78
+ }
79
+ };
80
+ ```
81
+
82
+ ### Storage Options
83
+
84
+ Switchboard supports multiple storage backends:
85
+
86
+ - **Filesystem**: Local file-based storage (default)
87
+ - **PostgreSQL**: Persistent database storage
88
+ - **Redis**: Caching layer (optional)
89
+
90
+ ## 🐳 Docker Deployment
91
+
92
+ ### Using Docker Compose
93
+
94
+ ```yaml
95
+ version: '3.8'
96
+ services:
97
+ switchboard:
98
+ image: powerhouse/switchboard:latest
99
+ ports:
100
+ - "4001:4001"
101
+ environment:
102
+ - PORT=4001
103
+ - DATABASE_URL=postgresql://user:pass@db:5432/switchboard
104
+ - REDIS_URL=redis://redis:6379
105
+ depends_on:
106
+ - db
107
+ - redis
108
+
109
+ db:
110
+ image: postgres:15
111
+ environment:
112
+ POSTGRES_DB: switchboard
113
+ POSTGRES_USER: user
114
+ POSTGRES_PASSWORD: pass
115
+
116
+ redis:
117
+ image: redis:7-alpine
118
+ ```
119
+
120
+ ### Environment Variables for Docker
121
+
122
+ ```bash
123
+ # Database
124
+ PH_SWITCHBOARD_DATABASE_URL="postgresql://user:pass@db:5432/switchboard"
125
+ PH_SWITCHBOARD_REDIS_URL="redis://redis:6379"
126
+
127
+ # Authentication
128
+ PH_SWITCHBOARD_AUTH_ENABLED=true
129
+ PH_SWITCHBOARD_ADMINS_LIST="0x123,0x456"
130
+ PH_SWITCHBOARD_USERS_LIST="0x789,0xabc"
131
+ PH_SWITCHBOARD_GUESTS_LIST="0xdef,0xghi"
132
+
133
+ # Packages
134
+ PH_PACKAGES="package1,package2,package3"
135
+ ```
136
+
137
+ ## 🔧 Development
138
+
139
+ ### Project Structure
140
+
141
+ ```
142
+ src/
143
+ ├── index.ts # Main entry point
144
+ ├── server.ts # Server implementation
145
+ ├── config.ts # Configuration management
146
+ ├── types.ts # TypeScript type definitions
147
+ ├── utils.ts # Utility functions
148
+ ├── profiler.ts # Profiling integration
149
+ ├── install-packages.ts # Package installation
150
+ └── clients/ # External client integrations
151
+ └── redis.ts # Redis client
152
+ ```
153
+
154
+ ### Available Scripts
155
+
156
+ ```bash
157
+ # Build the project
158
+ pnpm build
159
+
160
+ # Start in development mode
161
+ pnpm dev
162
+
163
+ # Start production server
164
+ pnpm start
165
+
166
+ # Lint code
167
+ pnpm lint
168
+
169
+ # Clean build artifacts
170
+ pnpm clean
171
+ ```
172
+
173
+ ### Adding New Features
174
+
175
+ 1. **Document Models**: Add new document model modules to the reactor builder
176
+ 2. **Storage Backends**: Implement new storage adapters
177
+ 3. **Authentication**: Extend authentication logic
178
+ 4. **API Endpoints**: Add new GraphQL resolvers
179
+
180
+ ## 📚 API Reference
181
+
182
+ ### GraphQL Endpoints
183
+
184
+ Switchboard exposes a GraphQL API for document operations:
185
+
186
+ - **Document Models**: Query and mutate document models
187
+ - **Document Drives**: Manage document drives
188
+ - **Reactor Operations**: Execute reactor operations
189
+
190
+ ### REST Endpoints
191
+
192
+ - `GET /health` - Health check endpoint
193
+ - `POST /graphql` - GraphQL endpoint
194
+ - `GET /graphql` - GraphQL playground (development)
195
+
196
+ ## 🤝 Contributing
197
+
198
+ 1. Fork the repository
199
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
200
+ 3. Commit your changes (`git commit -m 'Add amazing feature'`)
201
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
202
+ 5. Open a Pull Request
203
+
204
+ ## 📄 License
205
+
206
+ This project is licensed under the ISC License - see the [LICENSE](LICENSE) file for details.
207
+
208
+ ## 🆘 Support
209
+
210
+ - **Documentation**: [Powerhouse Docs](https://docs.powerhouse.com)
211
+ - **Issues**: [GitHub Issues](https://github.com/powerhouse-inc/powerhouse/issues)
212
+ - **Discussions**: [GitHub Discussions](https://github.com/powerhouse-inc/powerhouse/discussions)
213
+
214
+ ## 🔗 Related Projects
215
+
216
+ - [@powerhousedao/reactor-api](https://github.com/powerhouse-inc/powerhouse/tree/main/packages/reactor-api) - Reactor API package
217
+ - [@powerhousedao/document-drive](https://github.com/powerhouse-inc/powerhouse/tree/main/packages/document-drive) - Document drive management
218
+ - [@powerhousedao/document-model](https://github.com/powerhouse-inc/powerhouse/tree/main/packages/document-model) - Document model system