How vennarbank/fueltracker works
1. This repository is a client-side fuel tracking app built as a React + TypeScript frontend and packaged for Android with Capacitor. There is no backend service in the tree, so the main architecture is a single UI application plus a native Android host.
2. The web application is the primary runtime. src/main.tsx mounts the app into index.html, and src/App.tsx is the top-level composition root. Global styling lives in src/index.css and src/App.css.
3. The UI is split into feature-oriented components under src/components/: FuelForm, LogList, Dashboard, Analytics, and Settings. These names suggest a domain centered on fuel-entry capture, history review, summary metrics, and user preferences.
4. src/types.ts is the shared domain contract for the app. It likely defines the data shapes passed between the form, list, dashboard, and analytics views, keeping the feature components aligned around the same fuel-log model.
5. App.tsx is the orchestration boundary: it likely owns the shared app state and routes data between the feature components. The expected flow is user input in FuelForm, state updates in the app root, then derived views in Dashboard, LogList, and Analytics, with Settings influencing display or behavior.
6. AndroidFrame.tsx indicates there is some platform-aware UI layering on top of the core React app. It likely helps adapt the interface or layout when running inside the Android/Capacitor container versus a plain browser build.
7. The Android side under android/ is a Capacitor wrapper, not a separate business-logic implementation. MainActivity.java is the native entry point, while AndroidManifest.xml, resource folders, activity_main.xml, and file_paths.xml provide the standard Android app shell and platform configuration.
8. The Android wrapper contains the generated Gradle build structure (android/app/build.gradle, android/build.gradle, gradle.properties, Gradle wrapper files). This layer’s role is packaging, permissions, and runtime hosting of the web assets in an Android WebView.
9. Test scaffolding exists on both sides: src has no visible test files, but Android includes unit and instrumented test placeholders under android/app/src/test and android/app/src/androidTest. That indicates the repo currently relies mostly on component-level development plus template Android test harnesses.
10. The build/tooling stack is Vite for the web app (vite.config.ts), TypeScript (tsconfig*.json), and ESLint (eslint.config.js). capacitor.config.ts connects the web build to the native Android packaging step.
11. Architecturally, the important boundary is between the pure React domain/UI layer and the Capacitor Android host. All domain behavior appears to live in TypeScript components; Android mostly serves as a container unless additional native plugins are added later.
12. There is no sign of remote API integration, state server, or database layer in the repository tree. For an architecture diagram, this should be treated as a mostly self-contained offline-capable client app with optional native Android packaging.
Main entry points: App.tsx App root · types.ts Domain types · MainActivity.java Main activity · main.tsx Entry point
Components 21
React app
Client-side fuel tracking UI and shared domain logic.
- Entry point · Mounts the application into the browser DOM.
src/main.tsx - App root · Top-level composition root and shared state boundary.
src/App.tsx - Domain types · Common fuel-log data contracts used across features.
src/types.ts - Fuel form · Captures new fuel log input from the user.
src/components/FuelForm.tsx - Log list · Shows saved fuel entries and history views.
src/components/LogList.tsx - Dashboard · Presents high-level status and key totals.
src/components/Dashboard.tsx - Analytics · Derives trends and aggregate metrics from logs.
src/components/Analytics.tsx - Settings · Controls app behavior and display preferences.
src/components/Settings.tsx - Android frame · Adapts the React UI for the Android/Capacitor container.
src/components/AndroidFrame.tsx - Global styles · Shared application styling for the React UI.
src/index.css - App styles · Component-level styling for the app shell.
src/App.css
Android host
Capacitor wrapper and native Android packaging layer.
- Main activity · Native Android entry point hosting the web view.
android/app/src/main/java/com/fuelflow/app/MainActivity.java - Android manifest · Declares the Android application and its runtime setup.
android/app/src/main/AndroidManifest.xml - Main layout · Defines the native activity container layout.
android/app/src/main/res/layout/activity_main.xml - File paths · Configures native file access paths for the wrapper.
android/app/src/main/res/xml/file_paths.xml - App gradle · Module-level Android build configuration.
android/app/build.gradle - Root gradle · Project-level Android build configuration.
android/build.gradle
Build tooling
Frontend and Android build configuration.
- Capacitor config · Connects the web build to the Android wrapper.
capacitor.config.ts - Vite config · Frontend build and dev-server configuration.
vite.config.ts - TypeScript config · TypeScript compiler settings for the app and tooling.
tsconfig.json - ESLint config · Code quality and linting rules for the frontend.
eslint.config.js
Connections 23
- Entry point → App root: mounts · Bootstraps the root React tree.
- App root → Domain types: uses · Shares domain contracts across the UI.
- App root → Fuel form: coordinates · Receives user input and updates shared state.
- App root → Log list: feeds · Passes log data to history display.
- App root → Dashboard: derives · Supplies summary metrics and totals.
- App root → Analytics: derives · Supplies aggregated data for insights.
- App root → Settings: applies · Distributes user preferences through the app.
- App root → Android frame: adapts · Wraps the UI for Android-specific presentation.
- App root → Global styles: styles · Uses global CSS for base presentation.
- App root → App styles: styles · Uses app-specific CSS rules.
- Fuel form → Domain types: reads/writes · Uses shared fuel-log data shapes.
- Log list → Domain types: reads · Renders fuel entries using shared types.
- Dashboard → Domain types: reads · Computes summary views from the domain model.
- Analytics → Domain types: reads · Computes trends and aggregates from the domain model.
- Settings → Domain types: reads · Uses shared state and preference-related domain data.
- Main activity → Android manifest: declares · Android activity and app entry are registered in the manifest.
- Main activity → Main layout: hosts · Uses the native layout as the activity container.
- Main activity → File paths: relies on · Native file access configuration supports the wrapper.
- App gradle → Root gradle: inherits · Module build depends on project-level Android build setup.
- Capacitor config → App gradle: bridges · Capacitor connects the web build to the Android package.
- Vite config → Entry point: builds · Bundles the React entry for browser and mobile web views.
- TypeScript config → Entry point: compiles · TypeScript settings govern the frontend source.
- ESLint config → App root: checks · Linting targets the React application code.