Skip to content

asdteke/HomeInventory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

HomeInventory Logo

HomeInventory

Security Docker PWA License

The open-source project behind envanterim.net.tr
An open-source home inventory management system with 100+ language UI support and field-level encryption for sensitive data.

Features β€’ Tech Stack β€’ Quick Start β€’ Docker β€’ Environment β€’ Structure β€’ License

🌐 Language: English | TΓΌrkΓ§e | Deutsch | EspaΓ±ol | Ψ§Ω„ΨΉΨ±Ψ¨ΩŠΨ©


Features

  • 🏠 Multi-house support β€” Create or join households with shared inventories
  • πŸ“¦ Item management β€” Track items with photos, quantities, barcodes, and descriptions
  • 🏷️ Categories & Rooms β€” Organize items by custom categories, rooms, and locations
  • πŸ“± Barcode / QR scanning β€” Quickly add or find items using your device camera
  • πŸ” Authentication β€” JWT-based auth with Google OAuth support and email verification
  • βœ… 2FA & trusted devices β€” TOTP authenticator apps, one-time backup codes, and remembered-device controls
  • πŸ”’ Personal Vault β€” Browser-generated vault keys and encrypted personal records for high-sensitivity items
  • πŸ›‘οΈ Field-level encryption β€” AES-256-GCM protection for sensitive verification and inventory fields
  • 🐳 Docker & cloud secret delivery β€” Docker secrets and OCI runtime secret bootstrap for production key management
  • πŸ‘¨β€πŸ’Ό Admin panel β€” User management, ban controls, email sending, and system logs
  • πŸ“§ Email system β€” Transactional emails via Resend API (verification, admin notices)
  • πŸ’Ύ Backup & Restore β€” Export and import your inventory data
  • 🌍 100+ language UI β€” The frontend ships with 100+ selectable languages for global access
  • πŸŒ™ Dark / Light theme β€” Auto-detects system preference
  • πŸ“± Responsive β€” Mobile-first design, works on all screen sizes
  • πŸ” SEO ready β€” Sitemap, robots.txt, meta tags, and IndexNow support
  • πŸ”‘ Secure Password Recovery β€” Email-based reset or offline Recovery Key for local account recovery

Security & Privacy (Server-Side Encryption at Rest)

HomeInventory is designed with enterprise-grade security to protect your personal data. All sensitive fields, media files, and PII are encrypted on the server using AES-256-GCM before being written to disk or database. This protects against database theft and unauthorized file access. Note: because encryption keys are managed server-side, a server administrator with access to both the database and the environment variables can decrypt the data.

  • Field-Level Encryption: Sensitive data like item names, descriptions, barcodes, and custom categories are encrypted via AES-256-GCM before ever hitting the database.
  • Encrypted Media Storage: All uploaded photos and thumbnails have their EXIF metadata stripped and are stored on disk as AES-256-GCM encrypted blobs. They are only decrypted in RAM when requested by authenticated users.
  • PII Protection: User emails and usernames are stored encrypted. Authentication utilizes a deterministic HMAC-SHA-256 lookup token system, allowing seamless login without exposing the underlying PII to rainbow table attacks.
  • Key Rotation Ready: The application supports a Keyring map, allowing administrators to rotate the primary encryption key without breaking legacy encrypted data.
  • Enterprise Secret Management (Optional): For enterprise deployments, the standard .env-based encryption key delivery can be upgraded to Oracle Cloud Infrastructure (OCI) Secret Management. HomeInventory already supports Instance Principals-based runtime secret loading, eliminating hardcoded production secrets and allowing encryption keys to be managed through OCI Vault.

Tech Stack

Backend

Technology Purpose
Node.js + Express REST API server
better-sqlite3 Embedded SQLite database
JWT + bcrypt Authentication & password hashing
Passport.js Google OAuth 2.0 integration
Helmet HTTP security headers
express-rate-limit Brute-force / DDoS protection
Resend Transactional email service
Sharp Image processing & thumbnails
i18next Server-side internationalization

Frontend

Technology Purpose
React 18 UI library
Vite Build tool & dev server
Tailwind CSS Utility-first styling
React Router v7 Client-side routing
Lucide React Icon library
html5-qrcode Barcode & QR scanning
react-i18next Frontend internationalization
react-joyride Interactive onboarding tours

Quick Start

Prerequisites

  • Node.js β‰₯ 18 β€” download
  • npm β‰₯ 9 (comes with Node.js)

1. Clone & Install

git clone https://github.com/asdteke/HomeInventory.git
cd HomeInventory

# Install backend + frontend dependencies in one command
npm run install-all

2. Create Environment File

cp .env.example .env

Open .env in your editor and set at minimum these values for local development:

NODE_ENV=development
PORT=3001
SITE_URL=http://localhost:5173
JWT_SECRET=change-this-to-any-random-string-at-least-32-chars
APP_ENCRYPTION_KEY=replace-with-32-byte-base64-or-64-char-hex-key
APP_ENCRYPTION_KEY_ID=2026-03-local

πŸ’‘ Tip: You can generate a secure JWT_SECRET with:

node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

πŸ” Encryption key: Generate APP_ENCRYPTION_KEY with:

openssl rand -base64 32

APP_ENCRYPTION_KEY and APP_ENCRYPTION_KEY_ID are required because sensitive fields now use fail-secure encryption at startup. The remaining variables (GOOGLE_CLIENT_ID, RESEND_API_KEY, etc.) are optional for local development. Features that depend on them (Google login, email sending) will be gracefully disabled.

Optional: Oracle Cloud Secret Management

If you deploy HomeInventory on an Oracle Cloud Infrastructure compute instance, you can keep production secrets in OCI Secret Management and let the runtime load them before the app starts.

Recommended pattern:

SECRET_PROVIDER=oci
OCI_AUTH_MODE=instance_principal
OCI_REGION=eu-frankfurt-1
OCI_VAULT_ID=ocid1.vault.oc1..exampleuniqueID
OCI_SECRET_MAPPINGS={"JWT_SECRET":"homeinventory-jwt-secret","APP_ENCRYPTION_KEY":"homeinventory-app-encryption-key","APP_ENCRYPTION_KEY_ID":"homeinventory-app-encryption-key-id","RESEND_API_KEY":"homeinventory-resend-api-key"}

Notes:

  • Leave SECRET_PROVIDER=env for local development.
  • OCI_SECRET_MAPPINGS can point to secret OCIDs or secret names.
  • OCI_VAULT_ID is required only when you use secret names instead of secret OCIDs.
  • For file-based Docker secrets, keep the default /run/secrets mount or set DOCKER_SECRETS_DIR when your runtime mounts secrets elsewhere.
  • The server entrypoint now bootstraps runtime secrets automatically, so node server.js, npm run dev, and npm start continue to work.
  • Maintenance scripts such as encryption backfill and IndexNow submission also use the same OCI bootstrap path.

3. Start Development

npm run dev

This starts both backend and frontend concurrently. Open your browser:

Service URL
πŸ–₯️ Frontend http://localhost:5173
βš™οΈ Backend API http://localhost:3001
πŸ“± Network (phone) http://<your-local-ip>:5173

4. Production Build (optional)

# Build frontend for production
npm run build

# Start production server (serves built frontend + API)
npm start

Docker

Deploy HomeInventory with Docker for easy self-hosting:

# Clone and enter directory
git clone https://github.com/asdteke/HomeInventory.git
cd HomeInventory

# Create environment file for non-secret settings
cp .env.example .env

# Create Docker secret files (or point HOMEINVENTORY_SECRETS_DIR at another folder)
mkdir -p secrets
printf '%s' 'change-this-jwt-secret' > secrets/jwt_secret.txt
printf '%s' 'change-this-32-byte-base64-key' > secrets/app_encryption_key.txt
printf '%s' '2026-compose' > secrets/app_encryption_key_id.txt

# Start with Docker Compose
docker compose up -d

The app will be available at http://localhost:3001

docker-compose.yml reads secret source files from ${HOMEINVENTORY_SECRETS_DIR:-./secrets} on the host and mounts them inside the container at /run/secrets.

The full .env file is passed through to the container, so optional settings such as APP_ENCRYPTION_KEYRING, EXPOSE_SERVER_INFO, and INDEXNOW_* continue to work in Docker.

For detailed Docker configuration, reverse proxy setup, backup/restore, and Unraid deployment, see DOCKER.md.

Environment Variables

Copy .env.example to .env and fill in the required values:

Variable Required Description
NODE_ENV βœ… development or production
PORT βœ… Backend server port (default: 3001)
SITE_URL βœ… Your site's public URL
SECRET_PROVIDER ⬜ env (default) or oci for OCI Secret Management bootstrap
OCI_AUTH_MODE ⬜ Runtime auth mode for OCI bootstrap (instance_principal)
OCI_REGION ⬜ Optional OCI region override for secret retrieval
OCI_VAULT_ID ⬜ Required only when OCI_SECRET_MAPPINGS uses secret names
OCI_SECRET_MAPPINGS ⬜ JSON map of env var names to OCI secret OCIDs or secret names
OCI_SECRET_OVERWRITE ⬜ Overwrite already-set env values with OCI secret values
OCI_SECRET_BUNDLE_STAGE ⬜ Secret bundle stage to read (CURRENT by default)
DOCKER_SECRETS_DIR ⬜ Override runtime path for file-based Docker secrets (default: /run/secrets)
JWT_SECRET βœ… Random secret for JWT signing (min 32 chars)
APP_ENCRYPTION_KEY βœ… 32-byte encryption key for sensitive field protection
APP_ENCRYPTION_KEY_ID βœ… Stable key identifier for new encrypted payloads
APP_ENCRYPTION_KEYRING ⬜ Optional JSON map of legacy key IDs to keys for decryption after rotation
GOOGLE_CLIENT_ID ⬜ Google OAuth client ID
GOOGLE_CLIENT_SECRET ⬜ Google OAuth client secret
RESEND_API_KEY ⬜ Resend.com API key for emails
SUPPORT_EMAIL ⬜ Support email address
BOOTSTRAP_ADMIN_EMAIL ⬜ Auto-promote this email to admin
EXPOSE_SERVER_INFO ⬜ Show server info endpoint (true/false)
APP_EMAIL_LANGUAGE ⬜ Language for outgoing emails (default: en)
INDEXNOW_KEY ⬜ IndexNow API key for SEO indexing
INDEXNOW_BASE_URL ⬜ Base URL for IndexNow submissions
INDEXNOW_ENDPOINT ⬜ IndexNow API endpoint URL
INDEXNOW_KEY_LOCATION ⬜ Optional IndexNow key file location override

⚠️ Never commit your .env file! It is already in .gitignore.

Project Structure

Home-inventory/
β”œβ”€β”€ app.js                    # Express app setup & middleware
β”œβ”€β”€ server.js                 # Runtime bootstrap & server entry point
β”œβ”€β”€ auth.js                   # JWT middleware & token generation
β”œβ”€β”€ database.js               # SQLite DB initialization & migrations
β”œβ”€β”€ package.json              # Backend dependencies & scripts
β”œβ”€β”€ .env.example              # Environment variable template
β”œβ”€β”€ .gitignore
β”œβ”€β”€ LICENSE
β”‚
β”œβ”€β”€ config/
β”‚   └── i18n.js               # i18next server config
β”‚
β”œβ”€β”€ middleware/
β”‚   └── auth.js               # Auth & admin middleware
β”‚
β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ auth.js               # Login, register, OAuth, password
β”‚   β”œβ”€β”€ items.js              # CRUD for inventory items
β”‚   β”œβ”€β”€ categories.js         # Category management
β”‚   β”œβ”€β”€ rooms.js              # Room management
β”‚   β”œβ”€β”€ locations.js          # Location management
β”‚   β”œβ”€β”€ barcode.js            # Barcode lookup & scanning
β”‚   β”œβ”€β”€ houses.js             # Multi-house management
β”‚   β”œβ”€β”€ admin.js              # Admin panel endpoints
β”‚   β”œβ”€β”€ admin-email.js        # Admin email sending
β”‚   β”œβ”€β”€ email.js              # Email verification & status
β”‚   β”œβ”€β”€ backup.js             # Backup/restore endpoints
β”‚   └── ...
β”‚
β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ encryption.js         # AES-256-GCM field encryption helpers
β”‚   β”œβ”€β”€ protectedFields.js    # Inventory field encrypt/decrypt helpers
β”‚   β”œβ”€β”€ passwordRecovery.js   # Recovery key generation & verification
β”‚   β”œβ”€β”€ mediaStorage.js       # Encrypted media read/write helpers
β”‚   β”œβ”€β”€ runtimeSecrets.js     # OCI Secret Management bootstrap
β”‚   β”œβ”€β”€ emailService.js       # Resend email integration
β”‚   β”œβ”€β”€ indexNow.js           # IndexNow SEO submission
β”‚   └── logger.js             # KVKK-compliant logging
β”‚
β”œβ”€β”€ locales/                  # Backend i18n (100+ languages)
β”‚
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ run-with-runtime-secrets.mjs # OCI runtime secret bootstrap for maintenance scripts
β”‚   β”œβ”€β”€ backfill-field-encryption.mjs # Encrypt legacy plaintext field data
β”‚   β”œβ”€β”€ generate-locales.js   # Locale generation scripts
β”‚   └── indexnow-submit.mjs   # CLI IndexNow submission
β”‚
└── client/                   # React frontend
    β”œβ”€β”€ index.html
    β”œβ”€β”€ package.json
    β”œβ”€β”€ vite.config.js
    β”œβ”€β”€ tailwind.config.js
    β”œβ”€β”€ public/
    β”‚   β”œβ”€β”€ brand/            # Logo assets (dark/light)
    β”‚   β”œβ”€β”€ locales/          # Frontend i18n files
    β”‚   β”œβ”€β”€ robots.txt
    β”‚   └── sitemap.xml
    └── src/
        β”œβ”€β”€ App.jsx           # Root component & routing
        β”œβ”€β”€ main.jsx          # Entry point
        β”œβ”€β”€ index.css         # Global styles
        β”œβ”€β”€ i18n.js           # Frontend i18n config
        β”œβ”€β”€ components/       # All React components
        β”‚   β”œβ”€β”€ Dashboard.jsx
        β”‚   β”œβ”€β”€ ItemList.jsx
        β”‚   β”œβ”€β”€ ItemForm.jsx
        β”‚   β”œβ”€β”€ CategoryManager.jsx
        β”‚   β”œβ”€β”€ RoomManager.jsx
        β”‚   β”œβ”€β”€ Settings.jsx
        β”‚   β”œβ”€β”€ AdminPanel.jsx
        β”‚   β”œβ”€β”€ BarcodeScanner.jsx
        β”‚   β”œβ”€β”€ LandingPage.jsx
        β”‚   β”œβ”€β”€ Login.jsx
        β”‚   β”œβ”€β”€ Register.jsx
        β”‚   └── ...
        β”œβ”€β”€ context/          # React contexts (Auth, Theme)
        └── utils/            # Frontend utilities

API Endpoints

Method Endpoint Description
POST /api/auth/register Register new user
POST /api/auth/login Login
GET /api/items List items
POST /api/items Create item
PUT /api/items/:id Update item
DELETE /api/items/:id Delete item
GET /api/categories List categories
GET /api/rooms List rooms
GET /api/houses List user's houses
GET /api/admin/* Admin panel endpoints
GET /api/health Health check

All /api/* endpoints (except auth) require a JWT Bearer token.

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Disclaimer

This is an independent open-source project. It is not affiliated with, endorsed by, or connected to any commercial product or company using a similar name.

AI-Assisted Development

This project was developed with significant assistance from AI tools (including Google Gemini and OpenAI GPT).

License

MIT β€” see LICENSE for details.

About

Open-source home inventory management system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages