Update project documentation with comprehensive architecture details
- Enhanced CLAUDE.md with detailed architectural concepts and patterns - Added dynamic table naming system documentation - Documented persistent OBS connection management and dual integration - Explained glass morphism UI architecture and real-time monitoring - Updated README.md with modern professional presentation - Added comprehensive setup instructions and feature highlights - Included all development commands and API endpoint references - Cross-referenced CLAUDE.md for detailed technical documentation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
9f019db74f
commit
91ef418b1b
2 changed files with 133 additions and 49 deletions
86
README.md
86
README.md
|
@ -1,28 +1,82 @@
|
|||
This is a [Next.js](https://nextjs.org) app to control multiple OBS [Source Switchers](https://obsproject.com/forum/resources/source-switcher.941/)
|
||||
# OBS Source Switcher Plugin UI
|
||||
|
||||
A professional [Next.js](https://nextjs.org) web application for controlling multiple OBS [Source Switchers](https://obsproject.com/forum/resources/source-switcher.941/) with real-time WebSocket integration and modern glass morphism UI.
|
||||
|
||||
## Features
|
||||
|
||||
- **Multi-Screen Source Control**: Manage 7 different screen positions (large, left, right, and 4 corners)
|
||||
- **Real-time OBS Integration**: WebSocket connection with live status monitoring
|
||||
- **Team & Stream Management**: Organize streams by teams with full CRUD operations
|
||||
- **Modern UI**: Glass morphism design with responsive layout
|
||||
- **Professional Broadcasting**: Audio routing, scene management, and live status indicators
|
||||
- **Dual Integration**: WebSocket API + text file monitoring for maximum compatibility
|
||||
|
||||
## Quick Start
|
||||
|
||||
```bash
|
||||
npm install
|
||||
npm run dev
|
||||
```
|
||||
|
||||
Open [http://localhost:3000](http://localhost:3000) to access the control interface.
|
||||
|
||||
## Configuration
|
||||
The application uses a configurable directory for storing files and the database. To update the directory: create `.env.local` in the root of the project.
|
||||
|
||||
`.env.local` should look like:
|
||||
```
|
||||
### Environment Variables
|
||||
|
||||
Create `.env.local` in the project root:
|
||||
|
||||
```env
|
||||
# File storage directory (optional, defaults to ./files)
|
||||
FILE_DIRECTORY=C:\\OBS\\source-switching
|
||||
```
|
||||
If no `.env.local` file is created, it will default to `./files`, as seen in `config.js`
|
||||
|
||||
|
||||
```javascript
|
||||
const config = {
|
||||
FILE_DIRECTORY: path.resolve('./files'),
|
||||
};
|
||||
# OBS WebSocket settings (optional, these are defaults)
|
||||
OBS_WEBSOCKET_HOST=127.0.0.1
|
||||
OBS_WEBSOCKET_PORT=4455
|
||||
OBS_WEBSOCKET_PASSWORD=your_password_here
|
||||
```
|
||||
|
||||
In the "Source Switcher" properties in OBS, at the bottom, is a setting called `Current Source File`. Enable that, point it to the location of one of the text files, and put the read interval to 1000ms. Your source will change whenever the text file changes to a source _that is defined in the Source Switcher properties_
|
||||
### OBS Source Switcher Setup
|
||||
|
||||
The list of available sources is defined in a SQLite3 DB, location set in the `api/setActive.ts` route.
|
||||
1. In OBS, configure Source Switcher properties
|
||||
2. Enable "Current Source File" at the bottom
|
||||
3. Point to one of the generated text files (e.g., `large.txt`, `left.txt`)
|
||||
4. Set read interval to 1000ms
|
||||
5. Sources will switch automatically when files change
|
||||
|
||||
`npm install` and
|
||||
`npm run dev` to run it.
|
||||
### Database Setup
|
||||
|
||||
This is my first [Next.js](https://nextjs.org) app and I am not a Javascript Developer professionally, use at your own risk.
|
||||
```bash
|
||||
# Create seasonal database tables
|
||||
npm run create-sat-summer-2025-tables
|
||||
```
|
||||
|
||||
## Development Commands
|
||||
|
||||
```bash
|
||||
npm run dev # Start development server
|
||||
npm run build # Build for production
|
||||
npm run start # Start production server
|
||||
npm run lint # Run ESLint
|
||||
npm run type-check # TypeScript validation
|
||||
```
|
||||
|
||||
## Architecture
|
||||
|
||||
- **Frontend**: Next.js 15 with React 19 and TypeScript
|
||||
- **Backend**: Next.js API routes with SQLite database
|
||||
- **OBS Integration**: WebSocket connection + text file monitoring
|
||||
- **Styling**: Custom CSS with glass morphism and Tailwind utilities
|
||||
- **CI/CD**: Forgejo workflows with self-hosted runners
|
||||
|
||||
## API Endpoints
|
||||
|
||||
- `GET /api/streams` - List all streams
|
||||
- `POST /api/addStream` - Create new stream and OBS source
|
||||
- `POST /api/setActive` - Set active stream for screen position
|
||||
- `GET /api/obsStatus` - Real-time OBS connection status
|
||||
- `GET /api/teams` - Team management
|
||||
|
||||
See `CLAUDE.md` for detailed architecture documentation.
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue