This project runs EXCLUSIVELY in Docker containers. Do NOT use system Ruby, Bundler, or any host machine tools.
This project uses:
- Ruby 4.0.1
- Rails 8.0.x
- PostgreSQL 18
- Redis 8
- Node.js 24
# Clone the repository
git clone [repository-url]
cd streamsource
# Start all services with Docker Compose
docker compose up -d
# The application automatically:
# - Creates and migrates the database
# - Seeds sample data including admin user
# - Builds JavaScript and CSS assets
# - Starts the Rails server
# Verify everything is running
docker compose ps
# Check logs
docker compose logs -f web- API: http://localhost:3000
- Admin Interface: http://localhost:3000/admin (admin@example.com / Password123!)
- API Documentation: http://localhost:3000/api-docs
While it's technically possible to install Ruby locally using rbenv or rvm, this is strongly discouraged for this project. All development must be done through Docker to ensure consistency across environments.
The StreamSource Rails 8 application includes:
- User: Authentication with bcrypt, role-based permissions (default, editor, admin)
- Stream: Comprehensive streaming source management with:
- Location tracking (city, state)
- Platform integration
- Status management (active, inactive, live, ended)
- Archiving capability
- Pinning functionality
- Timestamps (started_at, ended_at)
- Streamer: Content creator profiles
- StreamerAccount: Platform-specific accounts for streamers
- StreamUrl: URL management and validation
- Annotation: Incident/event tracking with priority and status
- AnnotationStream: Many-to-many relationship for annotations
- Note: Polymorphic notes attachable to streams or streamers
- UsersController: Signup/login endpoints
- StreamsController: Full CRUD with filtering, pinning, archiving
- StreamersController: Streamer management
- AnnotationsController: Incident tracking
- NotesController: Note management
- HealthController: Health check endpoints
- StreamsController: Web interface for stream management
- StreamersController: Web interface for streamer management
- AnnotationsController: Web interface for annotation management
- UsersController: User administration
- NotesController: Note viewing
- SessionsController: Admin authentication
- API: JWT-based authentication with 24-hour tokens
- Admin: Session-based authentication
- Authorization: Pundit policies for role-based access control
- Roles: default (view only), editor (CRUD own), admin (full access)
- ActionCable: WebSocket support for real-time updates
- Channels: StreamChannel, AnnotationChannel, AdminChannel
- Hotwire: Turbo + Stimulus for dynamic UI
- Rate Limiting: Rack::Attack configuration
- CORS: Rack::Cors for API access control
- Caching: Redis integration
- Pagination: Pagy for all pagination needs
- N+1 Detection: Bullet in development
- Logging: Lograge for structured logs
- RSpec 6.1: Comprehensive test suite
- FactoryBot: Test data generation
- SimpleCov: Code coverage reporting
- Database Cleaner: Proper test isolation
- WebMock & VCR: External API testing
- JavaScript: ESBuild bundler
- CSS: Tailwind CSS via cssbundling-rails
- Watch Mode: Separate Docker services for development
See full documentation at http://localhost:3000/api-docs
POST /api/v1/users/signup- Create new accountPOST /api/v1/users/login- Login
GET /api/v1/streams- List streams (with filtering and pagination)GET /api/v1/streams/:id- Show streamPOST /api/v1/streams- Create streamPATCH /api/v1/streams/:id- Update streamDELETE /api/v1/streams/:id- Delete streamPUT /api/v1/streams/:id/pin- Pin streamDELETE /api/v1/streams/:id/pin- Unpin streamPOST /api/v1/streams/:id/archive- Archive streamPOST /api/v1/streams/:id/unarchive- Unarchive stream
GET /api/v1/streamers- List streamersGET /api/v1/streamers/:id- Show streamerPOST /api/v1/streamers- Create streamerPATCH /api/v1/streamers/:id- Update streamerDELETE /api/v1/streamers/:id- Delete streamer
GET /api/v1/annotations- List annotationsGET /api/v1/annotations/:id- Show annotationPOST /api/v1/annotations- Create annotationPATCH /api/v1/annotations/:id- Update annotationDELETE /api/v1/annotations/:id- Delete annotation
GET /health- Basic health checkGET /health/live- Liveness probeGET /health/ready- Readiness probe (checks DB)GET /metrics- Prometheus metrics
ws://localhost:3000/cable- ActionCable endpoint
All commands must be run with Docker:
# Rails console
docker compose exec web bin/rails console
# Run tests
docker compose exec web bin/test
# Run specific test
docker compose exec web bin/test spec/models/stream_spec.rb
# Generate migration
docker compose exec web bin/rails g migration AddFieldToModel
# Run migrations
docker compose exec web bin/rails db:migrate
# Check routes
docker compose exec web bin/rails routes
# Lint code
docker compose exec web bundle exec rubocop
# Build assets
docker compose exec web yarn build
docker compose exec web yarn build:css- Review the API documentation at http://localhost:3000/api-docs
- Explore the admin interface at http://localhost:3000/admin
- Run the test suite to ensure everything is working
- Check out the feature flags at http://localhost:3000/admin/flipper
- Review CONTRIBUTING.md for development guidelines