Skip to content
huimingtwPublic

About

bikeParts is a simple inventory management system built with Golang.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Bike Parts Inventory

A standalone bicycle parts inventory system for small bike shops and repair studios. The UI is in Traditional Chinese. On first launch, a setup wizard guides you through email notification configuration — no manual config file editing required.

Screenshots

Parts List

Parts below their reorder level are highlighted in red.

Parts List

Stock In / Out

Log multiple entries at once with optional notes.

Stock In

Low Stock Notifications

Shows parts that have triggered an alert. Automatically cleared after restocking.

Notifications

Stock Out

Submit multiple entries at once. Successful rows are removed immediately; failed rows (e.g. insufficient stock) stay highlighted inline so you can fix and resubmit without re-entering the others. A low-stock warning modal pops up automatically if any part drops to or below its reorder level after the operation.

Stock Out

Settings

Email settings can be changed directly in the UI with a test-send button. No restart required. Email notifications can be toggled on/off without removing the SMTP credentials.

Settings

Features

  • Parts CRUD with soft delete
  • Stock increase / decrease with movement history
  • Batch stock-out: all rows submitted together; failed rows highlighted inline, successful rows removed immediately
  • Low stock pop-up alert on the decrease page when stock drops to or below reorder level
  • Low stock email alerts via Gmail SMTP (triggered on decrease + daily retry scheduler)
  • Email notifications toggle (enable/disable without clearing credentials)
  • Idempotency key support for stock mutations
  • Vanilla JS frontend (sidebar layout, senior-friendly)
  • First-run setup wizard + settings UI (no manual config file editing)
  • E2E tests with in-memory SQLite

Tech Stack

  • Backend: Go, Gin, SQLite (go-sqlite3)
  • Frontend: Vanilla JS, HTML, CSS (no build step)
  • Email: Gmail SMTP via gomail.v2

Database Schema

DB Diagram

Setup

make run
# open http://localhost:8080

On first launch, a setup wizard will guide you through email configuration. No .env file required.

Optional: copy .env.example to .env to pre-fill settings via environment variables.

Data Directory

All persistent data is stored in the OS user config directory:

OS Path
Windows %AppData%\bikeparts\

Files created:

  • data.db — SQLite database
  • config.json — email and port settings
  • app.log — rotating log (10 MB max, 3 backups, 30-day retention)

Make Commands

Command Description
make run Start the server
make build Build binary to bin/bikeparts (macOS/Linux)
make build_windows Cross-compile bin/bikeparts.exe for Windows (requires mingw-w64)
make seed Seed the local dev DB with sample data (requires sqlite3 CLI)
make e2e_test Run e2e tests
make release Tag and push to trigger a GitHub release

Environment Variables

Environment variables override settings from config.json. Useful for server deployments.

Key Description
PORT HTTP port (default: 8080)
DB_PATH SQLite file path (default: user config dir)
EMAIL_USER Gmail address
EMAIL_PASS Gmail app password
EMAIL_TO Alert recipient email
SMTP_PORT SMTP port (default: 587)

API

Parts

Method Path Description
GET /api/parts List all parts
GET /api/parts/:id Get part by ID
POST /api/parts Create part
PUT /api/parts/:id Update part
DELETE /api/parts/:id Soft delete part

Stock

Method Path Description
POST /api/parts/:id/increase Increase stock
POST /api/parts/:id/decrease Decrease stock

Notifications

Method Path Description
GET /api/notifications List active low stock notifications

Settings

Method Path Description
GET /api/settings Get current settings (password masked)
PUT /api/settings Save settings
POST /api/settings/test-email Send a test email

Stock mutation endpoints require an Idempotency-Key header (UUID) to prevent duplicate operations.

Give It a Try (Windows)

Download the latest bikeparts.exe from the Releases page and run it.

About

bikeParts is a simple inventory management system built with Golang.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages