Compare commits
3 Commits
v1.1.1
...
628907bb20
| Author | SHA1 | Date | |
|---|---|---|---|
| 628907bb20 | |||
| 891bb248c8 | |||
| 81f89fd14e |
@@ -40,7 +40,7 @@ jobs:
|
||||
steps:
|
||||
- name: Clone repository
|
||||
run: |
|
||||
apk add --no-cache git curl jq
|
||||
apk add --no-cache git curl jq docker-cli
|
||||
git clone https://${{ secrets.GITEA_TOKEN }}@gitea.jeanlucmakiola.de/${{ gitea.repository }}.git repo
|
||||
cd repo
|
||||
git checkout ${{ gitea.ref_name }}
|
||||
|
||||
81
README.md
81
README.md
@@ -1,2 +1,83 @@
|
||||
# GearBox
|
||||
|
||||
A single-user web app for managing gear collections (bikepacking, sim racing, etc.), tracking weight and price, and planning purchases through research threads.
|
||||
|
||||
## Features
|
||||
|
||||
- Organize gear into categories with custom icons
|
||||
- Track weight and price for every item
|
||||
- Create setups (packing lists) from your collection with automatic weight/cost totals
|
||||
- Research threads for comparing candidates before buying
|
||||
- Image uploads for items and candidates
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Docker Compose (recommended)
|
||||
|
||||
Create a `docker-compose.yml`:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
gearbox:
|
||||
image: gitea.jeanlucmakiola.de/makiolaj/gearbox:latest
|
||||
container_name: gearbox
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- DATABASE_PATH=./data/gearbox.db
|
||||
volumes:
|
||||
- gearbox-data:/app/data
|
||||
- gearbox-uploads:/app/uploads
|
||||
healthcheck:
|
||||
test: ["CMD", "bun", "-e", "fetch('http://localhost:3000/api/health').then(r=>r.ok?process.exit(0):process.exit(1)).catch(()=>process.exit(1))"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
start_period: 10s
|
||||
retries: 3
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
gearbox-data:
|
||||
gearbox-uploads:
|
||||
```
|
||||
|
||||
Then run:
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
GearBox will be available at `http://localhost:3000`.
|
||||
|
||||
### Docker
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--name gearbox \
|
||||
-p 3000:3000 \
|
||||
-e NODE_ENV=production \
|
||||
-e DATABASE_PATH=./data/gearbox.db \
|
||||
-v gearbox-data:/app/data \
|
||||
-v gearbox-uploads:/app/uploads \
|
||||
--restart unless-stopped \
|
||||
gitea.jeanlucmakiola.de/makiolaj/gearbox:latest
|
||||
```
|
||||
|
||||
## Data
|
||||
|
||||
All data is stored in two Docker volumes:
|
||||
|
||||
- **gearbox-data** -- SQLite database
|
||||
- **gearbox-uploads** -- uploaded images
|
||||
|
||||
Back up these volumes to preserve your data.
|
||||
|
||||
## Updating
|
||||
|
||||
```bash
|
||||
docker compose pull
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
Database migrations run automatically on startup.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
services:
|
||||
gearbox:
|
||||
build: .
|
||||
image: gitea.jeanlucmakiola.de/makiolaj/gearbox:latest
|
||||
container_name: gearbox
|
||||
ports:
|
||||
- "3000:3000"
|
||||
@@ -10,6 +10,12 @@ services:
|
||||
volumes:
|
||||
- gearbox-data:/app/data
|
||||
- gearbox-uploads:/app/uploads
|
||||
healthcheck:
|
||||
test: ["CMD", "bun", "-e", "fetch('http://localhost:3000/api/health').then(r=>r.ok?process.exit(0):process.exit(1)).catch(()=>process.exit(1))"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
start_period: 10s
|
||||
retries: 3
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
bun run db:push
|
||||
bun run src/db/migrate.ts
|
||||
exec bun run src/server/index.ts
|
||||
|
||||
13
src/db/migrate.ts
Normal file
13
src/db/migrate.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Database } from "bun:sqlite";
|
||||
import { drizzle } from "drizzle-orm/bun-sqlite";
|
||||
import { migrate } from "drizzle-orm/bun-sqlite/migrator";
|
||||
|
||||
const sqlite = new Database(process.env.DATABASE_PATH || "gearbox.db");
|
||||
sqlite.run("PRAGMA journal_mode = WAL");
|
||||
sqlite.run("PRAGMA foreign_keys = ON");
|
||||
|
||||
const db = drizzle(sqlite);
|
||||
migrate(db, { migrationsFolder: "./drizzle" });
|
||||
|
||||
sqlite.close();
|
||||
console.log("Migrations applied successfully");
|
||||
Reference in New Issue
Block a user