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

+28
View File
@@ -0,0 +1,28 @@
<% content_for :title, "#{@aircraft.tail_number} Flights" %>
<%= render "shared/aircraft_header", aircraft: @aircraft %>
<section class="card">
<div class="card-header"><h2 class="card-title">Flight Log</h2><%= link_to "+ Log Flight", new_aircraft_flight_log_path(@aircraft), class: "btn-primary" %></div>
<% if @flight_logs.any? %>
<div class="overflow-x-auto">
<table class="table">
<thead><tr><th>Date</th><th>Route</th><th class="text-right">Tach</th><th class="text-right">Hobbs</th><th class="text-right">Oil</th><th class="text-right">Fuel</th><th>Pilot</th><th></th></tr></thead>
<tbody>
<% @flight_logs.each do |fl| %>
<tr>
<td class="whitespace-nowrap"><%= link_to fl.date, aircraft_flight_log_path(@aircraft, fl), class: "link" %></td>
<td><%= fl.route_summary.presence || "—" %></td>
<td class="text-right tabular-nums"><%= hours(fl.tach_time) %></td>
<td class="text-right tabular-nums"><%= hours(fl.hobbs_time) %></td>
<td class="text-right tabular-nums"><%= fl.oil_added ? "#{fl.oil_added} qt" : "" %></td>
<td class="text-right tabular-nums"><%= fl.fuel_added ? "#{fl.fuel_added} gal" : "" %></td>
<td class="text-xs"><%= fl.user&.display_name %></td>
<td class="text-right"><%= "📍" if fl.track_log.attached? %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
<% else %>
<%= empty_state "No flights logged yet." %>
<% end %>
</section>
+36
View File
@@ -0,0 +1,36 @@
<% content_for :title, "Log Flight" %>
<%= render "shared/aircraft_header", aircraft: @aircraft %>
<%= form_with model: [@aircraft, @flight_log], class: "card card-body space-y-5 max-w-3xl" do |f| %>
<%= f.errors_summary %>
<div class="grid gap-4 sm:grid-cols-3">
<%= f.field :date, as: :date, required: true %>
<%= f.field :departure_location, label: "From", placeholder: "KPVD" %>
<%= f.field :destination_location, label: "To", placeholder: "KBID" %>
</div>
<fieldset class="grid gap-4 sm:grid-cols-3">
<legend class="mb-2 text-sm font-semibold">Tach (required)</legend>
<%= f.field :tach_out, as: :number, step: 0.1, label: "Tach out" %>
<%= f.field :tach_in, as: :number, step: 0.1, label: "Tach in" %>
<%= f.field :tach_time, as: :number, step: 0.1, label: "…or duration", hint: "Calculated from out/in if blank." %>
</fieldset>
<fieldset class="grid gap-4 sm:grid-cols-3">
<legend class="mb-2 text-sm font-semibold">Hobbs (optional)</legend>
<%= f.field :hobbs_out, as: :number, step: 0.1, label: "Hobbs out" %>
<%= f.field :hobbs_in, as: :number, step: 0.1, label: "Hobbs in" %>
<%= f.field :hobbs_time, as: :number, step: 0.1, label: "…or duration" %>
</fieldset>
<fieldset class="grid gap-4 sm:grid-cols-3">
<legend class="mb-2 text-sm font-semibold">Oil & fuel added</legend>
<%= f.field :oil_added, as: :number, step: 0.25, label: "Oil added (qt)" %>
<%= f.field :oil_level_after, as: :number, step: 0.25, label: "Oil level after (qt)" %>
<%= f.field :oil_added_type, label: "Oil type", placeholder: "Aeroshell W100" %>
<%= f.field :fuel_added, as: :number, step: 0.1, label: "Fuel added (gal)" %>
<%= f.field :fuel_level_after, as: :number, step: 0.1, label: "Fuel level after (gal)" %>
<%= f.field :fuel_added_type, label: "Fuel type", placeholder: "100LL" %>
</fieldset>
<%= f.field :route, as: :textarea, rows: 2 %>
<%= f.field :notes, as: :textarea, rows: 2 %>
<%= f.field :track_log, as: :file, label: "Track log (GPX/KML/CSV)" %>
<p class="hint">Saving adds the tach time to the aircraft and all in-service components, and records any oil/fuel added.</p>
<div class="flex gap-2"><%= f.submit "Log Flight" %><%= link_to "Cancel", aircraft_flight_logs_path(@aircraft), class: "btn-secondary" %></div>
<% end %>
+15
View File
@@ -0,0 +1,15 @@
<%= render "shared/aircraft_header", aircraft: @aircraft %>
<section class="card max-w-3xl">
<div class="card-header"><h2 class="card-title">Flight on <%= fmt_date(@flight_log.date) %></h2>
<% if owner? %><%= delete_button "Delete", aircraft_flight_log_path(@aircraft, @flight_log), confirm: "Delete this flight log? Aircraft and component hours will NOT be rolled back." %><% 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">Tach</dt><dd><%= hours(@flight_log.tach_time) %> <span class="text-xs text-slate-500"><%= "(#{@flight_log.tach_out} → #{@flight_log.tach_in})" if @flight_log.tach_out && @flight_log.tach_in %></span></dd>
<dt class="text-slate-500">Hobbs</dt><dd><%= hours(@flight_log.hobbs_time) %> <span class="text-xs text-slate-500"><%= "(#{@flight_log.hobbs_out} → #{@flight_log.hobbs_in})" if @flight_log.hobbs_out && @flight_log.hobbs_in %></span></dd>
<dt class="text-slate-500">Route</dt><dd class="col-span-3"><%= @flight_log.route_summary.presence || "—" %> <%= @flight_log.route %></dd>
<dt class="text-slate-500">Oil added</dt><dd><%= @flight_log.oil_added ? "#{@flight_log.oil_added} qt #{@flight_log.oil_added_type}" : "—" %></dd>
<dt class="text-slate-500">Fuel added</dt><dd><%= @flight_log.fuel_added ? "#{@flight_log.fuel_added} gal #{@flight_log.fuel_added_type}" : "—" %></dd>
<dt class="text-slate-500">Pilot</dt><dd><%= @flight_log.user&.display_name || "—" %></dd>
<dt class="text-slate-500">Track log</dt><dd><%= @flight_log.track_log.attached? ? link_to(@flight_log.track_log.filename, rails_blob_path(@flight_log.track_log, disposition: :attachment), class: "link") : "—" %></dd>
</dl>
<% if @flight_log.notes.present? %><div class="border-t border-slate-100 px-4 py-3 text-sm"><%= simple_format @flight_log.notes %></div><% end %>
</section>