48 lines
1.5 KiB
Markdown
48 lines
1.5 KiB
Markdown
# tally-counter
|
|
|
|
A self-hosted tally counter web app. Create counters, organise them into groups, track history, and view stats.
|
|
|
|
## Features
|
|
|
|
- Create, edit, and delete counters with optional photos
|
|
- Organise counters into groups with drag-and-drop reordering
|
|
- Per-counter history modal — streak stats, 90-day chart, activity calendar
|
|
- Global stats page with top counters and 12-month calendar
|
|
- Counters can't go below 0
|
|
- Hover-to-prefetch on history modal for instant opens
|
|
- Fully persistent via SQLite (better-sqlite3, WAL mode)
|
|
|
|
## Tech stack
|
|
|
|
- **Next.js 16** — App Router, TypeScript, standalone output
|
|
- **Tailwind CSS v4** — Catppuccin Mocha theme
|
|
- **better-sqlite3** — embedded SQLite, no external database needed
|
|
- **@dnd-kit** — drag-and-drop for counters and groups
|
|
|
|
## Running locally
|
|
|
|
```bash
|
|
npm install
|
|
npm run dev
|
|
```
|
|
|
|
Open [http://localhost:3000](http://localhost:3000).
|
|
|
|
Data is stored in `.data/` (SQLite DB + uploaded images).
|
|
|
|
## Docker
|
|
|
|
```bash
|
|
docker build -t tally-counter .
|
|
docker run -p 3000:3000 -v tally_data:/data tally-counter
|
|
```
|
|
|
|
The `/data` volume holds both the database and uploaded images. Mount it to persist data across container restarts.
|
|
|
|
## Environment variables
|
|
|
|
| Variable | Default | Description |
|
|
|------------|----------------------|------------------------------------|
|
|
| `DATA_DIR` | `.data` (dev) / `/data` (Docker) | Directory for SQLite DB and uploads |
|
|
| `PORT` | `3000` | HTTP port |
|