A small React and TypeScript app for logging flight hours by aircraft tail number. The app shows total flights, total hours, and the five most recent flight log entries.
- React
- TypeScript
- Vite
- Vitest
- Tailwind CSS Vite plugin
- Node.js
>=20.19.0 - npm
The repo includes an .nvmrc file for Node version managers.
Install dependencies:
npm installStart the local dev server:
npm run devOpen the local URL printed by Vite.
Flight logs are stored in:
data/flights.json
During local development, a Vite plugin serves a lightweight JSON API:
GET /api/flightsreads saved flight logsPOST /api/flightssaves a new flight log
Each flight entry contains:
type FlightLogEntry = {
id: string;
hours: number;
loggedAt: string;
tailNumber: string;
};Run tests:
npm testRun tests in watch mode:
npm run test:watchBuild for production:
npm run buildPreview the production build:
npm run previewsrc/components/ React UI components
src/constants/ Static app constants
src/libs/ Shared utility and validation functions
src/plugins/ Vite development plugins
src/state/ API client and reducer logic
src/types/ Shared TypeScript types
data/ Local JSON data store
This project uses a Vite dev-server plugin for local JSON file persistence. That keeps the app lightweight for development, but a production deployment would need a real backend or hosted storage service for writes.