Initial commit: buildfor_life_repair inventory system

SvelteKit + PostgreSQL app for tracking vintage computers, audio equipment,
components, and installation history. Features device/component CRUD, operation
logs, QR code labels, global search, image uploads, and dark mode.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-06 17:11:05 +07:00
commit 6f0e0ad6c6
64 changed files with 8996 additions and 0 deletions
+106
View File
@@ -0,0 +1,106 @@
# buildfor_life_repair
Inventory and repair tracking system for vintage computers and audio equipment. Built with SvelteKit, PostgreSQL, and Tailwind CSS.
## Features
- **Device tracking** — computers, audio equipment, peripherals with full specs, images, documents
- **Component tracking** — individual parts (BlueSCSI, RAM, logic boards, etc.) linked to devices
- **Installation log** — full history of component installs/removals with timestamps
- **Operation/repair log** — per-device repair, inspection, cleaning, modification history
- **QR code labels** — printable labels for devices and components, scannable for quick lookup
- **Global search** — find devices/components by ID, name, or scanned QR code
- **Dark mode** — follows system preference or manual toggle
## Prerequisites
- [Node.js](https://nodejs.org/) 18+
- [PostgreSQL](https://www.postgresql.org/) 14+ (or Docker)
## Setup
### 1. Install dependencies
```bash
npm install
```
### 2. Set up the database
**Option A: Use your own PostgreSQL instance**
```sql
CREATE USER bflr WITH PASSWORD 'bflr_dev';
CREATE DATABASE buildfor_life_repair OWNER bflr;
\c buildfor_life_repair
GRANT ALL PRIVILEGES ON DATABASE buildfor_life_repair TO bflr;
GRANT ALL ON SCHEMA public TO bflr;
```
**Option B: Use Docker**
```bash
docker compose up -d
```
### 3. Configure environment
Copy the example env file and edit as needed:
```bash
cp .env.example .env
```
Edit `.env` with your database connection string:
```
DATABASE_URL=postgresql://bflr:bflr_dev@localhost:5432/buildfor_life_repair
UPLOAD_DIR=static/uploads
BASE_URL=http://localhost:5173
```
### 4. Run database migrations
Push the schema to your database:
```bash
npm run db:push
```
Or generate and run migrations:
```bash
npm run db:generate
npm run db:migrate
```
### 5. Start the dev server
```bash
npm run dev
```
The app will be available at [http://localhost:5173](http://localhost:5173).
## Database commands
| Command | Description |
|---|---|
| `npm run db:push` | Push schema changes directly to the database |
| `npm run db:generate` | Generate SQL migration files from schema changes |
| `npm run db:migrate` | Run pending migrations |
| `npm run db:studio` | Open Drizzle Studio (visual database browser) |
## Build for production
```bash
npm run build
npm run preview
```
## Tech stack
- **Frontend:** SvelteKit 5, Svelte 5 (runes), Tailwind CSS v4
- **Backend:** SvelteKit server, Drizzle ORM, PostgreSQL
- **Validation:** Zod
- **Other:** sharp (image thumbnails), qrcode (QR generation), date-fns