Skip to content

Add Rider Profit Dashboard (Tailwind, fuel API, localStorage, export) - #1

Merged
LUKZConnectz merged 1 commit into
mainfrom
codex/create-ride-cost-tracking-website
Jun 7, 2026
Merged

Add Rider Profit Dashboard (Tailwind, fuel API, localStorage, export)#1
LUKZConnectz merged 1 commit into
mainfrom
codex/create-ride-cost-tracking-website

Conversation

@LUKZConnectz

Copy link
Copy Markdown
Owner

Motivation

  • Provide a mobile-first dashboard for riders to record jobs, distances and automatically compute fuel consumption, fuel cost and net profit.
  • Keep the app lightweight and local-first by storing entries in localStorage while also showing real-time fuel prices when available.
  • Offer useful UX features (Tailwind UI, Dark Mode, Excel/PDF export, daily/weekly/monthly summaries) so riders can track and export earnings easily.

Description

  • Replaced the original login page with a responsive Tailwind CSS dashboard in index.html containing KPI cards, job-entry form, fuel-price cards and a jobs table.
  • Implemented client logic in script.js to compute liters, fuelCost, and profit, persist jobs/settings to localStorage, render summaries for day/week/month/all, and provide delete/export actions.
  • Added fetchFuelPrices() with a proxy fetch to energy.go.th plus a local cache and fallbackFuels list to handle API/CORS failures, and made fuel cards selectable to populate the form price.
  • Added exportExcel() (XLS via HTML table blob) and print-to-PDF support, plus adjusted styling in style.css and updated README.md with features and run instructions.

Testing

  • Ran a syntax check with node --check script.js, which completed successfully.
  • Started a local HTTP server (python3 -m http.server 4173) and retrieved index.html with curl -I, receiving HTTP 200 (site serves correctly).
  • Attempted to install Playwright for automated screenshots, but the environment returned 403 Forbidden from the npm registry so visual screenshot tooling was not available.

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b5b280d6a7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread script.js
Comment on lines +50 to +52
function today() {
return new Date().toISOString().slice(0, 10);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use local dates instead of UTC defaults

When the user's local date differs from UTC, toISOString() returns the UTC day rather than the rider's current local day, so the default job date, summary reference date, and export filename can be one day off (for example, in Thailand before 07:00 local time, or in US time zones during the evening). Since the dashboard is meant to summarize work by local day/week/month, this can put newly entered jobs into the wrong daily summary unless the user manually corrects the date.

Useful? React with 👍 / 👎.

@LUKZConnectz
LUKZConnectz merged commit 84539f1 into main Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant