Skip to content

Latest commit

ย 

History

77 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

PixelPack

๐ŸŒ Languages: English | ็ฎ€ไฝ“ไธญๆ–‡

A pixel-art, RPG-styled personal-item tracker and daily-life dashboard. Manage your belongings, spending, and tasks in a gamified way.

img.png

Features

  • Desktop client โ€” native macOS shell (Tauri 2 thin client): first-run server setup, persistent login via Keychain, tray + global shortcut, device-session management (prebuilt builds in Releases; dev/build in the Desktop client section below)
  • Item management โ€” record item info (price, source, warranty, tags); auto daily-averaged cost
  • Character system โ€” upload portrait, set name/class, record birthday & star sign
  • Daily quests โ€” auto-generated daily tasks (add item, log spending, โ€ฆ); complete them for EXP
  • Achievements โ€” collection achievements (first add, master collector, โ€ฆ); unlocked ones are written to the adventure log
  • Adventure log โ€” auto-recorded system events + manual entries, RPG-style timeline
  • World map โ€” daily AI tech-intel feed with history, organized by six domains (LLMs / agents / vision / infra / research / tools) (frontend + mock; backend pending)
  • Stats โ€” spending trends, item-status breakdown, warranty reminders, and other charts
  • Pixel UI โ€” NES.css-based pixel-art theme, Press Start 2P / Ark Pixel fonts

Tech stack

Layer Tech
Frontend Vue 3.5 + TypeScript + Pinia 3 + Vue Router 4 + Vite 8
Backend FastAPI + SQLAlchemy 2.0 (async) + SQLite (aiosqlite)
Desktop Tauri 2 + Rust (thin client, reuses web/, tokens in OS Keychain)
Auth JWT + session-based (refresh rotation / reuse detection / device sessions)
Charts ECharts 6
Styling NES.css + custom pixel components

Project structure

PixelPack/
โ”œโ”€โ”€ server/                # Python backend
โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ”œโ”€โ”€ main.py        # FastAPI entry, router registration, static files
โ”‚   โ”‚   โ”œโ”€โ”€ config.py      # config (DB, secret, upload dir)
โ”‚   โ”‚   โ”œโ”€โ”€ database.py    # SQLAlchemy async engine + Session
โ”‚   โ”‚   โ”œโ”€โ”€ models/        # ORM models (User, Item, Journal, Quest, ...)
โ”‚   โ”‚   โ”œโ”€โ”€ schemas/       # Pydantic request/response models
โ”‚   โ”‚   โ”œโ”€โ”€ services/      # business logic
โ”‚   โ”‚   โ”œโ”€โ”€ routers/       # API routes (REST endpoints)
โ”‚   โ”‚   โ””โ”€โ”€ utils/         # JWT, password hashing, DI
โ”‚   โ””โ”€โ”€ requirements.txt
โ”œโ”€โ”€ web/                   # Vue frontend
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ api/           # ofetch API wrappers
โ”‚   โ”‚   โ”œโ”€โ”€ components/    # reusable components (PixelDatePicker, ...)
โ”‚   โ”‚   โ”œโ”€โ”€ layouts/       # layouts (AuthLayout, MainLayout)
โ”‚   โ”‚   โ”œโ”€โ”€ router/        # routes + navigation guards
โ”‚   โ”‚   โ”œโ”€โ”€ stores/        # Pinia stores (auth, notification)
โ”‚   โ”‚   โ”œโ”€โ”€ styles/        # global styles (pixel theme, animations, fonts)
โ”‚   โ”‚   โ”œโ”€โ”€ types/         # TypeScript types
โ”‚   โ”‚   โ”œโ”€โ”€ utils/         # helpers (format, export, calc, platform abstraction, refresh worker)
โ”‚   โ”‚   โ””โ”€โ”€ views/         # pages (Dashboard, ItemList, Quests, ...) + desktop/ (Setup, ...)
โ”‚   โ””โ”€โ”€ package.json
โ”œโ”€โ”€ application/desktop/   # Tauri 2 shell (src-tauri/ Rust + reuses web/)
โ””โ”€โ”€ uploads/               # user-uploaded images (gitignored)

Quick start

Prerequisites

  • Python 3.10+
  • Node.js 24+ (aligned with node:24-alpine in web/Dockerfile)
  • npm 10+

Backend

Create the virtualenv at the project root (one repo for both ends; Python is backend-only):

# at project root
python -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -r server/requirements.txt

Start the dev server (โš ๏ธ must run inside server/, since DATABASE_URL and UPLOAD_DIR are relative paths):

cd server
uvicorn app.main:app --reload --port 8000 --log-config app/uvicorn_log_config.json

Then visit http://127.0.0.1:8000/docs for the API docs.

Frontend

cd web
npm install
npm run dev

The frontend dev server runs at http://localhost:3000 and proxies /api and /uploads to the backend at http://127.0.0.1:8000.

Backend tests (auth sessions, etc.):

cd server && pytest -q

Desktop client (macOS ยท Tauri 2)

The desktop app is a thin client: it reuses the web/ frontend, talks to the backend over HTTPS, and stores tokens in the system keychain. Zero server-side changes.

cd application/desktop
npm install                 # installs @tauri-apps/cli (needs Rust toolchain + Xcode CLT)
npm run dev                 # tauri dev: first-run server setup โ†’ sign in
npm run build               # tauri build โ†’ produces .dmg / .app

Design doc: docs/technology/260726-ๆกŒ้ข็ซฏๅฎขๆˆท็ซฏๆŠ€ๆœฏๆ–นๆกˆ.md.

Production build (containerized)

The frontend is built via a Docker multi-stage build (web/Dockerfile: node build โ†’ nginx static serve). No need to run npm run build on the host in production โ€” docker compose up -d --build web does it. For local dev, use npm run dev as above.

Docker deployment (recommended for production)

docker-compose.yml brings up two containers โ€” api (FastAPI/uvicorn) and web (multi-stage nginx static) โ€” both on the shared airise-web network. External traffic is handled by the standalone airise-gateway, which terminates TLS and reverse-proxies.

git clone https://github.com/LunaticKrian/PixelPack.git
cd PixelPack

# 1. Configure secrets (never in git, never in the image โ€” injected at runtime)
cp server/.env.example server/.env
vi server/.env          # fill in ANTHROPIC_AUTH_TOKEN

# 2. Build and start api + web (build on the server โ€” see notes below)
docker compose up -d --build

Common commands:

docker compose ps            # status (api, web)
docker compose logs -f api   # backend logs
git pull && docker compose up -d --build   # update code (./data is preserved)

Deployment topology

Browser โ”€โ”€httpsโ”€โ”€โ–ถ airise-gateway (standalone project, owns 80/443, pure router)
                       โ”œโ”€ /api/       โ”€โ”€โ–ถ pixelpack-api:8000   (this compose)
                       โ””โ”€ /, /uploads/ โ”€โ”€โ–ถ pixelpack-web:80    (this compose, SPA + uploads served directly)

โ”Œโ”€ docker-compose (this project) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  web (nginx:alpine)         โ† multi-stage: node buildโ†’nginx โ”‚
โ”‚   โ”œโ”€ serve SPA (fallback + gzip + cache)                    โ”‚
โ”‚   โ””โ”€ serve /uploads (mount ./data/uploads:ro)               โ”‚
โ”‚  api (uvicorn) :8000                                        โ”‚
โ”‚   โ””โ”€ FastAPI + APScheduler (writes ./data/uploads)          โ”‚
โ”‚                                                              โ”‚
โ”‚  volumes:  ./data โ†’ /app/data (api)                         โ”‚
โ”‚            ./data/uploads โ†’ /app/data/uploads:ro (web)      โ”‚
โ”‚            โ”œโ”€ data.db                                        โ”‚
โ”‚            โ””โ”€ uploads/   (api writes, web reads, same compose) โ”‚
โ”‚  networks: airise-web (external, talks to the gateway)      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Notes

  • Persistence: data.db and uploads/ all live under ./data (bind mount); rebuilding/upgrading containers won't lose data โ€” back up with tar czf backup.tar.gz data/.
  • Secrets: .env is injected via compose env_file; images are safe to push to public registries.
  • Gateway: airise-gateway is a separate project/repo (not under this one) โ€” a pure router: TLS + /apiโ†’api + everything elseโ†’web, mounts no project host path. Uploaded files are served directly by the web container (api writes, web reads the same ./data; zero path drift). See the airise-gateway repo README for its config.
  • โš ๏ธ Bundled-binary platform consistency: claude-agent-sdk ships a glibc native binary (~240MB), so the backend image cannot use alpine, and the build platform must match the runtime platform. Building on Apple Silicon for an amd64 server requires docker buildx build --platform linux/amd64; the safest option is still docker compose build directly on the server.

Full steps, secret-safety discussion, HTTPS/domain extension, and troubleshooting are in docs/deployment/deploy.md.

Docs

Doc Contents
docs/technology/260726-ๆกŒ้ข็ซฏๅฎขๆˆท็ซฏๆŠ€ๆœฏๆ–นๆกˆ.md Desktop Tauri 2 thin client: architecture, platform-abstraction layer, CSP/CORS, packaging/distribution, mobile roadmap
docs/technology/260727-้‰ดๆƒไผš่ฏๅŒ–ไธŽๅบ”็”จ้”.md Refresh rotation + reuse detection + device sessions + desktop app lock (PIN/Touch ID) โ€” design & implementation
docs/deployment/deploy.md Full deployment: web container build โ†’ backend deploy โ†’ gateway update, with verification, daily updates, backup, troubleshooting
docs/technology/260719-nginx้ƒจ็ฝฒๆžถๆž„.md Gateway-hosting architecture (unified entry, shared network, wildcard cert, multi-project onboarding)
docs/technology/260719-ๆ–ฐๆœๅŠกไธŠ็บฟไธŽ็ฝ‘ๅ…ณๆ‰ฉๅฑ•.md New-project onboarding SOP: backend container joins airise-web, site config from _template.example, gateway extension
docs/technology/260719-้€š้…่ฏไนฆ็ญพๅ‘.md *.airise.site wildcard cert DNS-01 issuance, auto-renew hook, single-domainโ†’wildcard migration, troubleshooting
docs/updatelog.md Repo changelog
airise-gateway repo README Gateway container (airise-gateway, standalone project) docs

API overview

Prefix Description
/api/auth register, login, token refresh (rotation), password change, profile update
/api/auth/sessions device-session list, remote sign-out of a specific device
/api/items item CRUD, image upload, status change, CSV export
/api/categories category management
/api/tags tag management
/api/journals adventure log (auto + manual)
/api/quests daily-quest progress, achievements
/api/stats overview, recent items, warranty alerts

All authenticated endpoints use the Authorization: Bearer <token> header.

Configuration

Backend config via env vars or server/.env:

DATABASE_URL=sqlite+aiosqlite:///./data.db
SECRET_KEY=your-secret-key
ACCESS_TOKEN_EXPIRE_MINUTES=60
REFRESH_TOKEN_EXPIRE_DAYS=7
UPLOAD_DIR=uploads

License

MIT

About

A pixel-art, RPG-styled personal item tracker & daily-life dashboard. Vue 3 + FastAPI + Tauri2, with a macOS desktop client.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages