How lottajavamike/eve-tracker works
Purpose and Runtime
EVE Tracker is a single-user, local EVE Online project and industry tracker. It separates a React/Vite dashboard from a Node/Express API, with persistent local SQLite state and optional EVE SSO/ESI synchronization. Main runtime entry points are backend/src/index.js and frontend/src/main.jsx; the frontend composition root is frontend/src/App.jsx.
Backend API and Domain Boundary
The Express backend exposes domain-oriented HTTP routes for local tracking and synced character data. Projects and activity logs are handled by backend/src/routes/projects.js and backend/src/routes/activities.js; EVE-derived views are exposed through routes such as backend/src/routes/industry.js, backend/src/routes/assets.js, backend/src/routes/blueprints.js, backend/src/routes/planets.js, backend/src/routes/skills.js, and backend/src/routes/dashboard.js. This API is the boundary between UI state and all persistence/external EVE services.
Local Persistence
backend/src/db.js owns SQLite access and the local data model, stored in data/eve-tracker.db at runtime. It persists user-created projects, activities, manually entered or linked jobs, synchronized character data, wallet history, and OAuth tokens. Project deletion is intentionally non-destructive to related records: linked activity/job project references are cleared rather than deleting those records.
EVE Authentication and ESI Ingestion
Authentication is initiated and completed through backend/src/routes/auth.js, backed by backend/src/esi/sso.js and backend/src/esi/token.js. Tokens enable authenticated ESI requests through backend/src/esi/client.js. Sync pulls character industry jobs, blueprints, assets, planetary colonies, skill queue, and wallet data; it also resolves public universe metadata such as item, blueprint, and planet names, with process-local caching. ESI is optional: local projects and activities remain usable without a connected character.
Scheduled and On-Demand Sync Flow
backend/src/jobs/syncScheduler.js runs automatic refreshes every ten minutes after a character is connected. backend/src/routes/sync.js provides an explicit sync trigger for the Settings and Industry experiences. The control flow is ESI/SSO credentials → ESI client retrieval and enrichment → SQLite upsert/update → API routes/dashboard reads. Scheduler and manual sync share the same external-data boundary and should preserve resilience to missing scopes or disconnected accounts.
Industry Cost Calculation
The live calculation feature is exposed via backend/src/routes/industryCost.js and implemented in backend/src/services/industryCost.js. It combines blueprint/job inputs with ME-adjusted material requirements from EVE Ref and market prices from Fuzzwork, plus system cost data, to compute build cost, expected revenue, and margin. Unlike synced ESI data, these third-party results are calculated on request and are not persisted.
Frontend Presentation and API Flow
The Vite React client uses frontend/src/api/client.js as its backend communication boundary. Page-level views map closely to API domains: frontend/src/pages/Dashboard.jsx, frontend/src/pages/Projects.jsx, frontend/src/pages/Industry.jsx, frontend/src/pages/Assets.jsx, and frontend/src/pages/PlanetaryInteraction.jsx. frontend/src/components/IndustryCostModal.jsx drives the calculator interaction. The browser talks only to the local backend; the backend is responsible for SQLite, CCP ESI, EVE Ref, and Fuzzwork access.
Main entry points: index.js Express server · db.js SQLite data model · client.js ESI client and enrichment · sso.js SSO and token handling
Components 20
React dashboard
- Vite entry
frontend/src/main.jsx - App composition
frontend/src/App.jsx - Dashboard and domain pages · Dashboard, projects, industry, assets, and planetary views.
frontend/src/pages/Dashboard.jsx - API client
frontend/src/api/client.js - Industry cost modal
frontend/src/components/IndustryCostModal.jsx
Local API and services
- Express server
backend/src/index.js - Local tracking routes · Projects and activity log endpoints.
backend/src/routes/projects.js - EVE data routes · Serves industry, assets, blueprints, planets, skills, and dashboard data.
backend/src/routes/industry.js - Auth routes
backend/src/routes/auth.js - Manual sync route
backend/src/routes/sync.js - Industry cost route
backend/src/routes/industryCost.js - SQLite data model · Keeps related records when a project is deleted by clearing project references.
backend/src/db.js - Local tracker state · Projects, activities, jobs, synced character data, wallet history, and tokens.
- SSO and token handling
backend/src/esi/sso.js - ESI client and enrichment · Authenticated retrieval plus cached public universe metadata resolution.
backend/src/esi/client.js - Ten-minute sync scheduler · Refreshes after a character is connected.
backend/src/jobs/syncScheduler.js - Cost calculation · Combines ME materials, prices, system costs, revenue, and margin without persistence.
backend/src/services/industryCost.js
EVE services
- CCP ESI
- EVE Ref
- Fuzzwork
Connections 23
- Vite entry → App composition: mounts
- App composition → Dashboard and domain pages: composes
- Dashboard and domain pages → API client: reads and mutates
- Industry cost modal → API client: requests calculation
- API client → Express server: local HTTP only
- Express server → Local tracking routes: mounts
- Express server → EVE data routes: mounts
- Express server → Auth routes: mounts
- Express server → Manual sync route: mounts
- Express server → Industry cost route: mounts
- Local tracking routes → SQLite data model: persists local tracking
- EVE data routes → SQLite data model: reads synced data
- SQLite data model → Local tracker state: stores
- Auth routes → SSO and token handling: starts and completes login
- SSO and token handling → SQLite data model: stores tokens
- SSO and token handling → CCP ESI: OAuth authorization
- Manual sync route → ESI client and enrichment: triggers
- Ten-minute sync scheduler → ESI client and enrichment: refreshes every 10 minutes
- ESI client and enrichment → CCP ESI: retrieves character and universe data
- ESI client and enrichment → SQLite data model: upserts synced data
- Industry cost route → Cost calculation: calculates on demand
- Cost calculation → EVE Ref: gets material requirements
- Cost calculation → Fuzzwork: gets market prices