How hofnarrxx/auto-log works
1. This repository is a full-stack application split into two major deployable parts: a Spring Boot backend under backend/ and an Angular frontend under frontend/. The backend exposes the API and handles persistence, security, and file-access orchestration; the frontend is the browser UI.
2. The backend is organized as a conventional layered Java application: controller for HTTP endpoints, service for business logic, repository for database access, and model for persisted domain objects. DTOs live in a separate dto package, so API payloads are not the same as persistence entities.
3. Authentication and authorization are a central backend subsystem. AuthController, AuthService, JwtService, JwtAuthenticationFilter, SecurityConfig, CustomUserDetailsService, and CustomOAuth2UserService together support email/password auth, JWT-based API access, OAuth2 login, and refresh-token handling. RefreshToken and RefreshTokenRepository show that long-lived session renewal is part of the architecture.
4. The core domain is vehicle log management. The main entities are User, Vehicle, Fuel, Maintenance, MaintenanceAttachment, ShareLink, and related enums/value types like Currency, MaintenanceCategory, and auth-provider types. Controllers and services are grouped around these business areas: vehicles, fuel entries, maintenance records, and sharing/public access.
5. Persistence is handled through repository interfaces such as VehicleRepository, FuelRepository, MaintenanceRepository, MaintenanceAttachmentRepository, ShareLinkRepository, UserRepository, and AuthProviderRepository. This indicates a database-backed system with service-to-repository boundaries rather than direct controller-to-database access.
6. File storage is a separate boundary from the database. R2Config, R2Properties, VehicleImageService, and MaintenanceAttachmentService indicate integration with S3-compatible object storage via R2-style configuration. The API exposes upload/download URL DTOs for vehicle images and maintenance attachments, so the backend likely generates signed URLs and the browser talks to object storage directly for file transfer.
7. Public sharing is modeled as its own subsystem. ShareLinkController, ShareLinkService, PublicVehicleAccessController, and PublicVehicleAccessService support shareable, read-only vehicle views without requiring a normal authenticated user session. This is a distinct access path from the owner-focused dashboard APIs.
8. The backend’s HTTP surface is split by concern: VehicleController, FuelController, MaintenanceController, MetadataController, AuthController, ShareLinkController, and PublicVehicleAccessController. This suggests a REST API with separate endpoints for CRUD, lookup/metadata, public access, and auth flows.
9. Error handling is centralized. Custom exceptions such as VehicleNotFoundException, FuelNotFoundException, MaintenanceNotFoundException, ShareLinkNotFoundException, EmailAlreadyExistsException, and validation exceptions are mapped through GlobalExceptionHandler, giving the frontend consistent failure responses.
10. The frontend is an Angular single-page app structured around feature areas. app.routes.ts, auth-guard.ts, and auth-interceptor.ts define route protection and API request wiring, while app-layout provides the authenticated shell. This separates global app behavior from feature-specific screens.
11. Frontend features mirror the backend domain: authentication (login, register), a main dashboard, vehicle management (vehicle-form, vehicle-dashboard with details/fuel/maintenance tabs), settings, and shared-public vehicle views under features/share. The presence of vehicle-store.ts suggests local state management for vehicle workflows.
12. API access from the browser is mediated through a small auth layer in frontend/src/app/core/auth, which likely attaches JWTs to requests and blocks unauthenticated routes. auth-api.ts is the explicit frontend boundary to backend auth endpoints.
13. The frontend also contains a currency.service.ts, which reflects backend currency handling as part of the vehicle-cost workflows. Static translations under public/i18n/en.json and pl.json indicate localized UI text, which matters for the diagram only as a presentation concern.
14. Tooling and runtime boundaries are straightforward: Maven/Spring Boot on the backend, Angular on the frontend, with tests present in both trees. application.yml is the backend configuration entry point, while Angular’s package.json/angular.json define the client build and runtime setup.
15. For an architecture diagram, the main flows are: browser → Angular routes/components → auth interceptor/guards → Spring Boot REST controllers → services → repositories/database; and browser → signed upload/download URLs → object storage for vehicle images and maintenance attachments. Public share links form a second, unauthenticated read-only path into the backend.
Main entry points: app.routes.ts Routes · dto DTOs · auth Auth layer · vehicle Vehicle UI
Components 21
Backend
Spring Boot API, domain logic, persistence, security, and storage orchestration.
- Autolog app · Backend application bootstrap and runtime entry point.
backend/src/main/java/com/hofnarrxx/autolog/AutologApplication.java - HTTP API · Primary authenticated REST surface for auth, vehicles, fuel, maintenance, metadata, and sharing.
- Auth stack · JWT, OAuth2, user details, refresh tokens, and security configuration.
- Vehicle domain · Vehicle CRUD and image URL orchestration.
- Fuel domain · Fuel entry management and related API operations.
- Maintenance domain · Maintenance records, categories, and attachment workflows.
- Sharing · Share-link creation and unauthenticated read-only vehicle access.
- Repositories · Database repositories for users, vehicles, fuel, maintenance, tokens, and share links.
- Domain model · Persisted entities and value types for users, vehicles, fuel, maintenance, attachments, tokens, and currencies.
- DTOs · Request/response payloads for auth, vehicles, fuel, maintenance, share links, and upload/download URLs.
backend/src/main/java/com/hofnarrxx/autolog/dto - Object storage · R2-style signed upload/download URL generation for vehicle images and maintenance attachments.
- Error handling · Central exception translation to consistent API responses.
Frontend
Angular SPA with route-level features and client-side auth wiring.
- Angular app · Browser application bootstrap and root shell.
frontend/src/app/app.ts - Routes · Top-level route configuration and feature navigation.
frontend/src/app/app.routes.ts - Auth layer · Route protection and authenticated API request wiring.
frontend/src/app/core/auth - App shell · Authenticated layout container and shared UI framing.
frontend/src/app/core/layout/app-layout - Auth screens · Login and registration UI.
frontend/src/app/features/auth - Vehicle UI · Vehicle form and dashboard with details, fuel, and maintenance tabs.
frontend/src/app/features/vehicle - Dashboard · Main post-login landing page and summary workspace.
frontend/src/app/features/dashboard - Shared view · Unauthenticated public vehicle read-only experience.
frontend/src/app/features/share - Settings · User preferences and account settings UI.
frontend/src/app/features/settings
Connections 36
- Angular app → Routes: uses · Root app delegates navigation to route configuration.
- Routes → Auth screens: navigates to · Routes expose login and registration screens.
- Routes → Dashboard: navigates to · Routes expose the main dashboard.
- Routes → Vehicle UI: navigates to · Routes expose vehicle workflows and subviews.
- Routes → Shared view: navigates to · Routes expose public shared-vehicle views.
- Routes → Settings: navigates to · Routes expose settings screens.
- Routes → App shell: wraps · Protected routes render inside the app shell.
- Routes → Auth layer: protects · Route guards gate authenticated areas.
- Auth layer → HTTP API: calls · Auth layer invokes backend auth endpoints and attaches JWTs.
- Shared view → Sharing: reads · Shared vehicle screens fetch public access data.
- Vehicle UI → HTTP API: calls · Vehicle workflows use authenticated API endpoints.
- Dashboard → HTTP API: calls · Dashboard data comes from backend API resources.
- Settings → HTTP API: calls · Settings flows use backend API resources.
- Autolog app → HTTP API: hosts · Application bootstraps the REST API surface.
- HTTP API → Auth stack: delegates · Auth controller and security filter chain handle login, OAuth2, JWT, and refresh flows.
- HTTP API → Vehicle domain: delegates · Vehicle controller routes to vehicle service logic.
- HTTP API → Fuel domain: delegates · Fuel controller routes to fuel service logic.
- HTTP API → Maintenance domain: delegates · Maintenance controller routes to maintenance service logic.
- HTTP API → Sharing: delegates · Share-link and public-access controllers handle sharing flows.
- Vehicle domain → Repositories: stores · Vehicle operations persist through repositories.
- Fuel domain → Repositories: stores · Fuel operations persist through repositories.
- Maintenance domain → Repositories: stores · Maintenance operations persist through repositories.
- Sharing → Repositories: stores · Share link and public access lookups use repositories.
- Auth stack → Repositories: stores · Users, auth providers, and refresh tokens are persisted.
- Vehicle domain → Domain model: uses · Vehicle services operate on persisted domain entities.
- Fuel domain → Domain model: uses · Fuel services operate on persisted domain entities.
- Maintenance domain → Domain model: uses · Maintenance services operate on persisted domain entities.
- Auth stack → Domain model: uses · Security services use users, auth providers, and refresh tokens.
- Vehicle domain → DTOs: transfers · Vehicle APIs expose request/response DTOs.
- Fuel domain → DTOs: transfers · Fuel APIs expose request/response DTOs.
- Maintenance domain → DTOs: transfers · Maintenance APIs expose request/response DTOs and file URL payloads.
- Auth stack → DTOs: transfers · Auth flows exchange token and credential DTOs.
- Sharing → DTOs: transfers · Share APIs expose public access DTOs.
- Vehicle domain → Object storage: orchestrates · Vehicle image uploads/downloads are handled via signed URL storage integration.
- Maintenance domain → Object storage: orchestrates · Maintenance attachments use signed URL storage integration.
- HTTP API → Error handling: maps errors · Controllers rely on centralized exception handling.