StudioBot.ai/
β
βββ π src/ # TypeScript Source Code
β βββ index.ts # Express server entry point
β β
β βββ π routes/ # API Route Handlers (6 files)
β β βββ auth.routes.ts # Auth endpoints (register, login, profile)
β β βββ video.routes.ts # Video management (upload, list, delete)
β β βββ clip.routes.ts # Clip creation & approval
β β βββ short.routes.ts # Shorts generation
β β βββ thumbnail.routes.ts # Thumbnail generation
β β βββ platform.routes.ts # Platform integrations
β β
β βββ π services/ # Business Logic Layer (10 files)
β β βββ auth.service.ts # User authentication
β β βββ video.service.ts # Video analysis & processing
β β βββ clip.service.ts # Clip extraction with FFmpeg
β β βββ short.service.ts # Vertical format conversion
β β βββ thumbnail.service.ts # Thumbnail generation
β β βββ platform.service.ts # Multi-platform publishing
β β βββ platform.integrations.ts # YouTube, Twitch, Rumble APIs
β β βββ oauth.service.ts # OAuth flow management
β β βββ analytics.service.ts # Analytics aggregation
β β βββ ai.integration.ts # AI service integrations
β β
β βββ π middleware/ # Express Middleware (2 files)
β β βββ errorHandler.ts # Centralized error handling
β β βββ auth.ts # JWT authentication
β β
β βββ π database/ # Data Access Layer (1 file)
β β βββ init.ts # SQLite/PostgreSQL schema
β β
β βββ π types/ # TypeScript Types (1 file)
β β βββ models.ts # Data models & interfaces
β β
β βββ π utils/ # Utility Functions (1 file)
β β βββ logger.ts # Structured logging
β β
β βββ π dashboard/ # React Components (1 file)
β βββ Dashboard.tsx # Main dashboard UI
β
βββ π sdk/ # Client Libraries
β βββ studiobot-sdk.ts # TypeScript SDK (400+ lines)
β
βββ π cli/ # Command-Line Tools
β βββ studiobot-cli.ts # CLI with Commander.js
β
βββ π data/ # Runtime Data
β βββ studiobot.db # SQLite database (auto-created)
β
βββ π temp/ # Temporary Files
β βββ π videos/ # Temporary video storage
β
βββ π output/ # Generated Content
β βββ π clips/ # Generated clips
β βββ π shorts/ # Generated shorts (1080x1920)
β βββ π thumbnails/ # Generated thumbnails
β
βββ π logs/ # Application Logs
β βββ app.log # Main application log file
β
βββ π node_modules/ # NPM Dependencies (auto-created)
β βββ [100+ packages]
β
βββ π dist/ # Compiled JavaScript (auto-created)
β βββ [compiled .js files]
β
βββ π Configuration Files
β βββ package.json # Dependencies & scripts
β βββ package-lock.json # Locked versions
β βββ tsconfig.json # TypeScript config
β βββ .env.example # Environment variables template
β βββ .env # Your local env vars (git ignored)
β βββ .gitignore # Git ignore rules
β βββ .eslintrc.json # Linting rules
β
βββ π³ Container Files
β βββ Dockerfile # Single container build
β βββ docker-compose.yml # Multi-service orchestration
β
βββ π Documentation Files
β βββ README.md # Project description
β βββ API.md # API reference (30+ endpoints)
β βββ ARCHITECTURE.md # System design & patterns
β βββ CONFIGURATION.md # Advanced configuration
β βββ DEPLOYMENT.md # Deployment guide
β βββ SETUP_GUIDE.md # Getting started (NEW)
β βββ PLATFORM_INTEGRATION.md # Platform setup (NEW)
β βββ WORKFLOWS_AND_RECIPES.md # Usage examples (NEW)
β βββ PROJECT_OVERVIEW.md # Complete overview (NEW)
β βββ LATEST_UPDATES.md # What's new (NEW)
β βββ DIRECTORY_STRUCTURE.md # This file (NEW)
β
βββ π§ͺ Testing
β βββ test-api.js # API integration tests (300+ lines)
β
βββ π Project Files
βββ LICENSE # MIT License
βββ .gitattributes # Git attributes
- First Time Setup: Read SETUP_GUIDE.md
- Quick Test: Run
node test-api.js - Check Health:
curl http://localhost:3000/health
- View All Endpoints: API.md
- Route Handlers:
src/routes/(6 files) - Services:
src/services/(10 files) - Types:
src/types/models.ts
- Setup Instructions: PLATFORM_INTEGRATION.md
- Implementation:
src/services/platform.integrations.ts - OAuth Flows:
src/services/oauth.service.ts - Analytics:
src/services/analytics.service.ts
- TypeScript SDK:
sdk/studiobot-sdk.ts - CLI Tool:
cli/studiobot-cli.ts - React Dashboard:
src/dashboard/Dashboard.tsx
- Logs:
logs/app.log - Analytics Service:
src/services/analytics.service.ts - Database:
data/studiobot.db
- Docker Setup: DEPLOYMENT.md
- Dockerfile:
./Dockerfile - Docker Compose:
./docker-compose.yml - Configuration: CONFIGURATION.md
- Architecture: ARCHITECTURE.md
- Workflows: WORKFLOWS_AND_RECIPES.md
- Project Overview: PROJECT_OVERVIEW.md
- Latest Updates: LATEST_UPDATES.md
Contains all TypeScript source code organized into layers:
routes/- HTTP endpoint handlersservices/- Business logic & external APIsmiddleware/- Express middlewaredatabase/- Data access & schematypes/- TypeScript interfacesutils/- Helper functionsdashboard/- React components
Files: 22 TypeScript files
Lines: 5,000+ lines of code
Key File: src/index.ts (application entry point)
Client-side code for consuming the API:
studiobot-sdk.ts- TypeScript SDK with 20+ methods
Usage:
import { StudioBotAPI } from './sdk/studiobot-sdk';
const api = new StudioBotAPI('http://localhost:3000');Interactive console tool:
studiobot-cli.ts- 400+ lines with 10+ commands
Usage:
studiobot-cli auth:register
studiobot-cli video:upload
studiobot-cli clip:createRuntime data storage:
studiobot.db- SQLite database (auto-created)
Access:
sqlite3 data/studiobot.db ".tables"Intermediate processing files:
videos/- Downloaded/uploaded videos awaiting processing
Auto-cleanup: Typically cleared after processing
Final processed outputs:
clips/- Extracted clip videosshorts/- Vertical format shortsthumbnails/- Generated preview images
Storage: Persisted for download/delivery
Runtime diagnostic information:
app.log- Main application log file
View logs:
tail -f logs/app.logAuto-generated compiled JavaScript:
- Contains compiled
.jsfiles fromsrc/TypeScript - Generated by
npm run build
Generated from: src/ directory
Used by: npm start command
1. README.md β Start here
2. SETUP_GUIDE.md β Installation & config
3. test-api.js β Try it out
1. ARCHITECTURE.md β How it works
2. API.md β API endpoints
3. PROJECT_OVERVIEW.md β Complete structure
1. PLATFORM_INTEGRATION.md β Add YouTube/Twitch/Rumble
2. CONFIGURATION.md β Advanced settings
3. WORKFLOWS_AND_RECIPES.md β Automation examples
1. DEPLOYMENT.md β Production setup
2. Docker files β Containerization
3. CONFIGURATION.md β Env variables
Video Upload
- Route:
src/routes/video.routes.ts - Service:
src/services/video.service.ts - Endpoint:
POST /api/videos/upload - SDK:
api.uploadVideo()
Multi-Platform Publishing
- Route:
src/routes/platform.routes.ts - Service:
src/services/platform.service.ts - Integration:
src/services/platform.integrations.ts - Endpoint:
POST /api/distributions/publish
User Authentication
- Route:
src/routes/auth.routes.ts - Service:
src/services/auth.service.ts - Middleware:
src/middleware/auth.ts - Endpoint:
POST /api/auth/login
Analytics
- Service:
src/services/analytics.service.ts - Endpoint:
GET /api/distributions/analytics - SDK:
api.getDistributionAnalytics()
OAuth Integration
- Service:
src/services/oauth.service.ts - Doc:
PLATFORM_INTEGRATION.md - Endpoint:
POST /api/platforms/auth/:platform
TypeScript Services
- Location:
src/services/*.ts - Count: 10 files
- Purpose: Business logic
API Routes
- Location:
src/routes/*.ts - Count: 6 files
- Purpose: HTTP endpoints
React Components
- Location:
src/dashboard/ - Count: 1 main component
- Purpose: Web UI
JavaScript
- Location:
test-api.js,cli/*,sdk/*` - Purpose: Testing, CLI, SDK
SQL/Database
- Location:
src/database/init.ts - Purpose: Schema definition
npm install # Install dependencies
npm run build # Build TypeScript
npm run dev # Development with hot-reload
npm start # Run server
npm test # Run testsnode test-api.js # Run integration tests
curl http://localhost:3000/health # Health check
npm test -- --watch # Watch modesqlite3 data/studiobot.db ".tables" # List tables
sqlite3 data/studiobot.db ".schema" # View schema
npm run migrate:up # Database migrationsdocker build -t studiobot:latest . # Build image
docker run -p 3000:3000 studiobot # Run container
docker-compose up -d # Start all servicesnpx ts-node cli/studiobot-cli.ts help # List commands
npm link # Install globally
studiobot-cli auth:register # Run command| Type | Count | Lines |
|---|---|---|
| Services | 10 | 2,500+ |
| Routes | 6 | 800+ |
| Middleware | 2 | 150 |
| Components | 1 | 350+ |
| SDK | 1 | 400+ |
| CLI | 1 | 400+ |
| Tests | 1 | 300+ |
| Total | 22 | 5,000+ |
| File | Lines | Purpose |
|---|---|---|
| README.md | 150 | Overview |
| API.md | 400 | API reference |
| ARCHITECTURE.md | 300 | Design patterns |
| CONFIGURATION.md | 250 | Config guide |
| DEPLOYMENT.md | 300 | Deployment |
| SETUP_GUIDE.md | 400 | Setup instructions |
| PLATFORM_INTEGRATION.md | 300 | Platform setup |
| WORKFLOWS_AND_RECIPES.md | 500 | Examples |
| PROJECT_OVERVIEW.md | 400 | Complete overview |
| LATEST_UPDATES.md | 400 | What's new |
| Total | 3,000+ | Complete docs |
- 30+ API endpoints
- 7-table database schema
- Video processing pipeline
- Multi-platform integration
- OAuth 2.0 flows
- Analytics aggregation
- React dashboard
- CLI tool
- TypeScript SDK
- TypeScript support
- ESLint config
- Jest setup
- Integration tests
- Error handling
- Logging system
- Docker support
- API reference
- Setup guide
- Architecture guide
- Platform integration guide
- Workflow examples
- Deployment guide
- Configuration guide
- Live streaming support
- Mobile app (React Native)
- Advanced ML features
- Webhook support
- Message queuing
- GraphQL API
- Admin dashboard
- Always start with README.md - Get oriented
- Use SETUP_GUIDE.md before running anything - Proper environment
- Check API.md for endpoint details - Find what you need
- Read ARCHITECTURE.md to understand design - Learn the structure
- Look at WORKFLOWS_AND_RECIPES.md for examples - See real code
- Search for feature names - Find implementation quickly
- Use IDE's "Go to Definition" - Jump between files
- Check test-api.js for usage - See working examples
- Search in PROJECT_OVERVIEW.md for feature index
- Check API.md for endpoint
- Look in
src/routes/for route handler - Find in
src/services/for business logic - Check DIRECTORY_STRUCTURE.md (this file)
- Check SETUP_GUIDE.md for initial setup
- See API.md for endpoint docs
- Look at
test-api.jsfor usage examples - Check SDK method in
sdk/studiobot-sdk.ts - View recipes in WORKFLOWS_AND_RECIPES.md
- Follow DEPLOYMENT.md
- Use docker-compose.yml for full stack
- Configure CONFIGURATION.md
- Follow production checklist in SETUP_GUIDE.md
| Doc | Covers | Links To |
|---|---|---|
| README.md | Overview | All other docs |
| SETUP_GUIDE.md | Getting started | PLATFORM_INTEGRATION.md |
| PLATFORM_INTEGRATION.md | Platform setup | CONFIGURATION.md |
| API.md | Endpoints | src/routes/ |
| WORKFLOWS_AND_RECIPES.md | Examples | SDK, CLI, API |
| ARCHITECTURE.md | Design | Database, Services |
| DEPLOYMENT.md | Production | Docker, docker-compose.yml |
| PROJECT_OVERVIEW.md | Reference | All docs |
You're all set! Navigate using this guide and the cross-references above. Happy coding! π