Initial commit: Rails port of Simple Aircraft Manager

Rails 8.1 + SQLite rewrite of marbindrakon/simple-aircraft-manager,
designed to self-host as a single container (Solid Queue/Cache/Cable,
Active Storage on disk, Hotwire + importmap, Tailwind).

- Airworthiness engine ported from health/services.py (ADs, grounding
  squawks, inspection recurrency, component replacement)
- Hours updates and flight logs cascading to in-service components,
  optional airworthiness enforcement
- Components, squawks, ADs, inspections, logbook, documents, major
  records, oil/fuel consumption stats and charts, activity log
- Admin/owner/pilot RBAC and public share links (status/maintenance)
- Docker Compose and Kamal deployment, env-driven production config
- Service and integration tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-04 17:59:08 -05:00
commit 38df19c331
264 files changed
+8365

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
<%= form_with model: [aircraft, record], class: "card card-body space-y-4 max-w-3xl" do |f| %>
<%= f.errors_summary %>
<div class="grid gap-4 sm:grid-cols-3">
<%= f.field :record_type, as: :select, label: "Type", collection: MajorRecord::RECORD_TYPES.invert %>
<%= f.field :date_performed, as: :date %>
<%= f.field :aircraft_hours, as: :number, step: 0.1 %>
</div>
<%= f.field :title, required: true %>
<%= f.field :description, as: :textarea, rows: 4 %>
<div class="grid gap-4 sm:grid-cols-2">
<%= f.field :performed_by %>
<%= f.field :component_id, as: :select, label: "Component", collection: component_options(aircraft) %>
<%= f.field :form_337_document_id, as: :select, label: "Form 337 document", collection: document_options(aircraft) %>
<%= f.field :logbook_entry_id, as: :select, label: "Logbook entry", collection: logbook_options(aircraft) %>
<%= f.field :stc_number, label: "STC number" %>
<%= f.field :stc_holder, label: "STC holder" %>
<%= f.field :stc_document_id, as: :select, label: "STC document", collection: document_options(aircraft) %>
</div>
<%= f.field :has_ica, as: :checkbox, label: "Includes Instructions for Continued Airworthiness" %>
<%= f.field :ica_notes, as: :textarea, rows: 2, label: "ICA notes" %>
<%= f.field :notes, as: :textarea, rows: 2 %>
<div class="flex gap-2"><%= f.submit "Save" %><%= link_to "Cancel", aircraft_major_records_path(aircraft), class: "btn-secondary" %></div>
<% end %>
<% if record.persisted? %><div class="mt-4"><%= delete_button "Delete record", aircraft_major_record_path(aircraft, record) %></div><% end %>
+2
View File
@@ -0,0 +1,2 @@
<%= render "shared/aircraft_header", aircraft: @aircraft %>
<%= render "form", aircraft: @aircraft, record: @record %>
+27
View File
@@ -0,0 +1,27 @@
<% content_for :title, "#{@aircraft.tail_number} Major Records" %>
<%= render "shared/aircraft_header", aircraft: @aircraft %>
<section class="card">
<div class="card-header"><h2 class="card-title">Major Repairs & Alterations</h2>
<% if owner? %><div class="flex gap-2">
<%= link_to "+ Repair", new_aircraft_major_record_path(@aircraft, type: "repair"), class: "btn-secondary" %>
<%= link_to "+ Alteration", new_aircraft_major_record_path(@aircraft, type: "alteration"), class: "btn-primary" %></div><% end %></div>
<% if @records.any? %>
<table class="table">
<thead><tr><th>Date</th><th>Type</th><th>Title</th><th>Performed by</th><th>STC</th><th>ICA</th></tr></thead>
<tbody>
<% @records.each do |r| %>
<tr>
<td class="whitespace-nowrap"><%= r.date_performed %></td>
<td><%= tag.span r.type_label, class: r.record_type == "repair" ? "badge-orange" : "badge-blue" %></td>
<td><%= link_to r.title, aircraft_major_record_path(@aircraft, r), class: "link" %><%= tag.div(r.component, class: "text-xs text-slate-500") if r.component %></td>
<td class="text-xs"><%= r.performed_by %></td>
<td class="text-xs"><%= r.stc_number %></td>
<td><%= "✓" if r.has_ica? %></td>
</tr>
<% end %>
</tbody>
</table>
<% else %>
<%= empty_state "No major repairs or alterations recorded." %>
<% end %>
</section>
+2
View File
@@ -0,0 +1,2 @@
<%= render "shared/aircraft_header", aircraft: @aircraft %>
<%= render "form", aircraft: @aircraft, record: @record %>
+19
View File
@@ -0,0 +1,19 @@
<%= render "shared/aircraft_header", aircraft: @aircraft %>
<section class="card max-w-4xl">
<div class="card-header"><h2 class="card-title"><%= @record.type_label %>: <%= @record.title %></h2>
<% if owner? %><%= link_to "Edit", edit_aircraft_major_record_path(@aircraft, @record), class: "btn-secondary btn-sm" %><% end %></div>
<dl class="card-body grid grid-cols-2 gap-x-4 gap-y-2 text-sm sm:grid-cols-4">
<dt class="text-slate-500">Date</dt><dd><%= fmt_date(@record.date_performed) %></dd>
<dt class="text-slate-500">Aircraft hours</dt><dd><%= hours(@record.aircraft_hours) %></dd>
<dt class="text-slate-500">Performed by</dt><dd><%= @record.performed_by.presence || "—" %></dd>
<dt class="text-slate-500">Component</dt><dd><%= @record.component || "—" %></dd>
<dt class="text-slate-500">Form 337</dt><dd><%= @record.form_337_document ? link_to(@record.form_337_document.name, aircraft_document_path(@aircraft, @record.form_337_document), class: "link") : "—" %></dd>
<dt class="text-slate-500">STC</dt><dd><%= [@record.stc_number, @record.stc_holder].compact_blank.join(" · ").presence || "—" %>
<%= link_to("(docs)", aircraft_document_path(@aircraft, @record.stc_document), class: "link") if @record.stc_document %></dd>
<dt class="text-slate-500">Logbook</dt><dd><%= @record.logbook_entry ? link_to(@record.logbook_entry.date, aircraft_logbook_entry_path(@aircraft, @record.logbook_entry), class: "link") : "—" %></dd>
<dt class="text-slate-500">ICAs</dt><dd><%= @record.has_ica? ? "Yes" : "No" %></dd>
</dl>
<% [["Description", @record.description], ["ICA notes", @record.ica_notes], ["Notes", @record.notes]].each do |title, text| %>
<% if text.present? %><div class="border-t border-slate-100 px-4 py-3 text-sm"><h3 class="mb-1 font-medium"><%= title %></h3><%= simple_format text %></div><% end %>
<% end %>
</section>