How tramlinehq/tramline works
Project type and purpose
• Tramline is a Ruby on Rails monolithic, full-stack release-management application.
• It comprises a web front-end (ERB/Turbo/Stimulus), a Sidekiq background-worker component, a Postgres database, and Redis for queueing and caching.
• It integrates heavily with external services (GitHub, GitLab, Bitbucket, Jira, Slack, CI/CD/build servers, App Store Connect, Play Store, Crashlytics, Bugsnag, Firebase, GCS, Postmark).
Break down the main components
a. Web application (“site-web”)
– Rails Puma server(s) hosting controllers, views, and Stimulus controllers under app/javascript.
– Turbo Frames/Streams and Tailwind CSS assets served by Importmap.
– Devise for authentication; SSO/email flows under app/controllers/authentication.
– Main domains: Trains & releases (models under app/models), integrations, apps, builds, commits.
b. Background worker (“site-jobs”)
– Sidekiq processes jobs defined under app/jobs and app/libs, orchestrating release flows, webhooks, CI polling, external submissions.
c. Data stores
– Postgres: all relational data (releases, users, trains, commits, integrations).
– Redis: Sidekiq queue, caching, flipper feature flags, Action Cable pub/sub.
d. External integrations
– Webhooks inbound: GitHub, GitLab, Bitbucket, Jira, Slack, CI servers, store-submission callbacks.
– API calls outbound: version-control (GitHub/GitLab/Bitbucket APIs under app/libs/installations), CI servers (Bitrise), distribution services (App Store Connect, Play Store, Firebase), monitoring (Bugsnag), notifications (Slack via app/libs/notifiers), email (Postmark via ActionMailer).
– Artifact storage: Google Cloud Storage bucket for build artifacts.
e. (Optional) applelink microservice: separate Rack app for App Store uploads.
Relationships and data flows
• User → Web: HTTP(S) requests for UI and API (/api/v1/*).
• Web → DB: ActiveRecord read/write.
• Web → Redis: caching, sessions, ActionCable.
• Web → Sidekiq: enqueue jobs for long-running release tasks.
• Sidekiq → DB: read/write models, mark job status.
• Sidekiq → Redis: queue management.
• Sidekiq → External APIs: trigger builds, branch merges, store submissions, fetch metrics.
• External services → Web: webhook callbacks to /integration_listeners/* and /api/v1/pings.
• Web → External services: OAuth flows for Slack, GitHub, other integrations configured in credentials.
• Web ↔ GCS: store and serve build artifacts via signed URLs.
• Web → Postmark: deliver emails.
• Monitoring & logging: Datadog/Sentry clients initialized in config/initializers.
Architectural patterns
– Monolith + worker split: keeps business logic centralized but moves asynchronous tasks out of the request cycle.
– MVC on the web side, Service-Object/Coordinator pattern in app/libs/coordinators and app/jobs.
– Event-driven: webhooks feed into Sidekiq jobs and Coordinators.
– Publish/subscribe: ActionCable channels for real-time updates.
– GitOps-style release flows encapsulated as “release trains” (config under app/models/config and app/libs/triggers).
Relevant technologies
– Ruby on Rails 7, Puma, Sidekiq, Postgres, Redis, Tailwind, Importmap, Stimulus, Turbo.
– External APIs: GitHub/GitLab/Bitbucket (Octokit-style wrappers), Jira, Slack (Bolt), Bitrise, Firebase, Play Store, App Store Connect.
– Render.com (site-web & site-jobs), optional Applelink service (Port 3001).
– Devise for auth, Devise email/SSO controllers, flipper for feature flags, Postmark for mail, Google Cloud SDK.