This guide will help you set up and run StreamSource locally for development and testing.
- Docker Desktop - Download here
- Git - For cloning the repository
- Modern terminal - Terminal.app, iTerm2, or similar
# Navigate to the project directory
cd ~/dev/streamsource
# One-command setup (handles everything automatically)
make setupThis automated setup will:
- β
Create
.envfile from template - β Install Ruby gems and JavaScript dependencies
- β Start PostgreSQL database
- β Run database migrations
- β Seed the database with sample data
# Start all services in development mode
make devThis starts:
- Rails API & Admin Interface on http://localhost:3000
- PostgreSQL database container
- Redis cache/sessions container
- Asset watchers for live code reloading
Once running, you can access:
| Service | URL | Description |
|---|---|---|
| π Main Application | http://localhost:3000 | Root application |
| π¨βπΌ Admin Interface | http://localhost:3000/admin | Management dashboard |
| π API Documentation | http://localhost:3000/api-docs | Interactive API docs (Swagger) |
| π₯ Health Check | http://localhost:3000/health | System status endpoint |
| ποΈ Feature Flags | http://localhost:3000/admin/flipper | Feature toggle management |
The seeded database includes an admin user:
- Email:
admin@example.com - Password:
Password123!
Note: Check
db/seeds.rbfor exact credentials if these don't work.
make up # Starts services in background
make logs # View logs in follow mode
make status # Check container status
make down # Stop all services# 1. Copy environment template
cp .env.example .env
# 2. Edit configuration (optional for local testing)
nano .env
# 3. Install dependencies
make install
# 4. Start database only
docker compose up -d db
# 5. Setup database
make migrate
make seed
# 6. Start everything
make dev# Full test suite with coverage
make test
# Specific test types
make test-models # Model tests only
make test-requests # API/request tests only
make test-parallel # Faster parallel execution# Quick health check
make health
# Comprehensive diagnostics
make doctor
# Check configuration
make env-check# Test health endpoint
curl http://localhost:3000/health
# Test database connectivity
curl http://localhost:3000/health/db
# Test Redis connectivity
curl http://localhost:3000/health/redis
# Test API endpoints (may require authentication)
curl http://localhost:3000/api/v1/streamsmake dev # Start in development mode
make up # Start in background
make down # Stop all services
make restart # Restart all services
make logs # Follow application logs
make status # Show container statusmake shell # Open bash shell in web container
make rails # Open Rails console (alias: make c)
make routes # Show all Rails routes
make attach # Attach to container for debuggingmake migrate # Run pending migrations
make rollback # Rollback last migration
make seed # Seed database with sample data
make reset # Reset database (β οΈ destroys data!)
make db-shell # Open PostgreSQL shell
make backup # Backup database and configmake lint # Comprehensive code analysis
make lint-fix # Auto-fix code style issues
make lint-ruby # Ruby style check only
make lint-js # JavaScript style check only
make security # Security audit and scanning
make quality # Full quality check (lint + test)
make pre-commit # Pre-commit validationmake install # Install all dependencies
make update # Update all dependencies
make bundle # Install Ruby gems
make yarn # Install JavaScript packages
make assets # Compile assets for production
make assets-dev # Compile assets for development# Diagnose common problems
make doctor
# Rebuild (keeps build cache)
make rebuild
# Deep clean (removes containers, volumes, local images, build cache)
make clean
make rebuild# Access database directly
make db-shell
# Reset database (β οΈ destroys all data)
make reset
# Check database connection
make health# Check system resources
make doctor
# View detailed logs
make logs-all
# Check container status
make ps-all| Error | Solution |
|---|---|
| "Docker not found" | Install Docker Desktop and ensure it's running |
| "Port 3000 already in use" | Stop other Rails apps or use make down |
| "Database connection failed" | Run make doctor and check database container |
| "Permission denied" | Check file permissions with make security |
| "Bundle install failed" | Try make clean then make rebuild |
- Start:
make dev - Make code changes (auto-reloads)
- Test changes:
make test - Check quality:
make pre-commit - Stop:
Ctrl+Cormake down
# Run comprehensive checks
make pre-commit
# This runs:
# - Full test suite
# - Code style checks (Ruby & JavaScript)
# - Security analysis
# - Dependency audit# 1. Create database migration (if needed)
make exec cmd="bin/rails generate migration AddFeatureToModel"
# 2. Run migration
make migrate
# 3. Generate tests
make exec cmd="bin/rails generate rspec:model Feature"
# 4. Run tests frequently
make test-watch
# 5. Check code quality
make quality- Rails 8 - Modern Ruby on Rails framework
- PostgreSQL 18 - Primary database
- Redis 8 - Caching and session storage
- Hotwire/Stimulus - Real-time frontend updates
- ActionCable - WebSocket support for real-time features
- Docker - Containerized development environment
- RESTful API - Comprehensive API for streams, streamers, timestamps
- Admin Interface - Real-time collaborative editing
- Feature Flags - Flipper-based feature toggles
- Authentication - JWT for API, sessions for admin
- Real-time Updates - ActionCable WebSocket support
- Rate Limiting - Rack::Attack protection
- User - Authentication and authorization
- Streamer - Content creators
- StreamerAccount - Platform-specific accounts
- Stream - Individual streaming sessions
- Timestamp - Event annotations/incidents
For faster development, use these shortcut commands:
make d # dev
make u # up
make l # logs
make r # restart
make s # status
make t # test
make c # rails (console)- DEPLOYMENT.md - Production deployment guide
- API Documentation - Interactive API docs (when running)
- LINTING.md - Code quality and linting guide
- Vendor Documentation - See
vendor/docs/for framework references
If you encounter issues:
- Run diagnostics:
make doctor - Check logs:
make logs - Review health:
make health - Clean and rebuild:
make clean && make rebuild - Check documentation in the
docs/directory
Once you have StreamSource running locally:
- β Admin Interface: http://localhost:3000/admin
- β API Documentation: http://localhost:3000/api-docs
- β Health Monitoring: http://localhost:3000/health
- β Real-time Features: WebSocket support enabled
- β Development Tools: Rails console, logs, debugging
Happy coding! π
π‘ Pro Tip: Use
make helpanytime to see all available commands with descriptions.