adamp 1ed2642e20 Add restock history tracking, payment tracking, and reports page
- New stock_adjustments table logs every stock change (restock, order
  create/update/delete) with reason and reference
- Orders now track payment_method and amount_paid with validation
- New /api/reports endpoint with 5 aggregation queries and date filtering
- Reports page with date range presets and sales, customer, revenue,
  status, and inventory sections
- Payment fields added to OrderNew and OrderDetail pages with balance due
- Girl Scouts trefoil logo added to header
- Vite dev server exposed on network for mobile access

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 21:20:59 -06:00
2026-02-09 17:48:42 -06:00
2026-02-09 17:48:42 -06:00
2026-02-09 17:48:42 -06:00
2026-02-09 17:48:42 -06:00
2026-02-09 17:48:42 -06:00
2026-02-09 17:48:42 -06:00

Girl Scout Cookie Tracker

A self-hosted web app for tracking cookie inventory and customers for a single troop. Works on desktop and mobile.

Features

  • Inventory: Add cookie products (name, price, quantity, low-stock threshold). Adjust stock (restock or deduct). Low-stock highlighting.
  • Customers: Store name, phone, email, address, notes. Search by name, email, or phone.
  • Orders: Create orders with customer (or walk-in), line items (product + quantity), status (pending, paid, delivered). Inventory is deducted automatically. Edit or delete orders (stock is restored on delete).
  • Dashboard: Summary counts, low-stock list, recent orders.

Requirements

  • Node.js 18+
  • npm

Setup

  1. Clone or download this repo.

  2. Install dependencies:

    npm install
    cd client && npm install && cd ..
    
  3. Optional: copy .env.example to .env and set:

    • PORT — API port (default 3002)
    • DATABASE_PATH — path to SQLite file (default ./data/cookies.db)
    • Authentication (optional): Set APP_PASSWORD to require a password to log in. Set APP_SECRET to a long random string (used to sign session cookies). If APP_PASSWORD is not set, the app runs without login; if set, users must enter the password to access the app. Use "Log out" in the nav to sign out.

Development

Run the API server and the Vite dev server together:

npm run dev

Use the frontend URL in your browser. The database file is created automatically on first request.

Production build and run

  1. Build the client:

    npm run build
    
  2. Run the server in production mode (serves the built client and API):

    npm start
    

    Or set NODE_ENV=production and run node server/index.js. The app will serve static files from client/dist and handle the SPA fallback.

  3. Open http://localhost:3002 (or your PORT).

Deployment (self-hosted)

  • Run the app behind a reverse proxy (e.g. nginx) if you want HTTPS or a different port.
  • Set DATABASE_PATH to a persistent volume path so the SQLite file survives restarts.
  • Set APP_PASSWORD and APP_SECRET in production so only people with the password can access the app. Session cookies are httpOnly and (in production) Secure when served over HTTPS.
  • Back up the SQLite file regularly (e.g. cron job copying data/cookies.db).

Project structure

  • server/ — Express API and SQLite (products, customers, orders, dashboard).
  • client/ — Vite + React SPA (Dashboard, Inventory, Customers, Orders, New order, Order detail).
  • data/ — Created at runtime; contains cookies.db by default.
Description
Girl Scout Cookie tracking application
Readme 253 KiB
Languages
JavaScript 93.5%
CSS 6.2%
HTML 0.3%