Skip to content

Latest commit

 

History

113 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Palox Management System

License Node Vue TypeScript Supabase Last Commit Open Issues Pull Requests

A warehouse management application for agricultural produce storage.

The system is designed for warehouses that store goods in stacked palox containers instead of traditional shelf-based storage. It helps manage storage locations, inventory, products, and warehouse movements in cold storage environments.

Features

  • Palox container management
  • Stack-based warehouse organization
  • Cold storage location tracking
  • Inventory overview
  • Product and supplier management
  • Warehouse movement tracking
  • Database-driven inventory management
  • Responsive web application
  • Supabase-powered backend

Tech Stack

  • Vue 3
  • Ionic Vue
  • TypeScript
  • Vite
  • Supabase
  • PostgreSQL
  • Pinia
  • AG Grid
  • Zod
  • Nix development environment

Screenshots

Warehouse Overview

Requirements

  • Git
  • Node.js 22+
  • npm 10+
  • Nix with flakes enabled (recommended)
  • Podman or Docker
  • Supabase CLI

The project provides a reproducible development environment using Nix.

Development Setup

1. Clone Repository

git clone <repository-url>
cd hofladen

2. Start Nix Development Environment

The project provides a flake.nix.

Start it with:

nix develop

Verify the environment:

node -v
npm -v

Expected:

Node.js 22.x
npm 10.x

3. Install Dependencies

npm install

4. Setup Podman for Supabase

Supabase CLI requires a Docker-compatible API.

Podman provides this through a socket.

Check:

systemctl --user status podman.socket

If inactive:

systemctl --user enable --now podman.socket

The development environment sets:

export DOCKER_HOST="unix://$XDG_RUNTIME_DIR/podman/podman.sock"

Verify:

podman info

5. Initialize Supabase

For the first setup:

npm run db:first-initialization

This will:

  • Start local Supabase
  • Create the database
  • Apply migrations
  • Import supabase/seed.sql
  • Generate TypeScript database types
  • Generate Zod schemas

Environment Variables

Create a .env.local file.

Backend / Generator Variables

Used by database generation scripts.

Example:

DB_USER=postgres
DB_HOST=127.0.0.1
DB_NAME=postgres
DB_PASSWORD=postgres
DB_PORT=54322

Frontend Variables

Vite variables require the VITE_ prefix.

Example:

VITE_SUPABASE_URL=http://127.0.0.1:54321
VITE_SUPABASE_ANON_KEY=<local-anon-key>

Get the current local Supabase environment:

supabase status -o env

Running the Application

Start Supabase:

npm run db:start

Start the frontend:

npm run dev

Open: http://localhost:5173

Database Workflow

Reset Local Database

npm run db:reset

This will:

  • Remove the local database
  • Apply migrations
  • Import seed data
  • Regenerate database types and schemas

Export Current Database State

Create a new seed file:

npm run db:dump

This updates supabase/seed.sql.

Afterwards:

npm run db:reset

can recreate the same state locally.

Generate Database Types

After schema changes:

npm run db:generate-types-and-zod

Generated files:

  • src/types/database.types.ts
  • generated Zod schemas

Available Commands

Command Description
npm run dev Start development server
npm run build Create production build
npm run preview Preview production build
npm run lint Run ESLint
npm run test:unit Run unit tests
npm run test:e2e Run Cypress tests
npm run db:start Start local Supabase
npm run db:stop Stop local Supabase
npm run db:reset Reset local database
npm run db:dump Export database seed
npm run db:generate-types Generate TypeScript database types
npm run db:generate-types-and-zod Generate types and Zod schemas

Common Problems

Supabase Client Error

Error:

supabaseUrl is required

Check:

  • VITE_SUPABASE_URL
  • VITE_SUPABASE_ANON_KEY

Restart Vite after changing environment variables.

PostgreSQL Connection Error

Error:

ECONNREFUSED localhost:5432

Local Supabase PostgreSQL runs on 127.0.0.1:54322, not the default PostgreSQL port.

Supabase CLI Version Warning

If Supabase CLI reports:

A new version of Supabase CLI is available

this is only informational. The CLI version is controlled by the development environment.

Recommended Development Workflow

Typical daily workflow:

Terminal 1:

nix develop
npm run db:start

Terminal 2:

nix develop
npm run dev

Only reset the database after migration changes or when rebuilding the local environment:

npm run db:reset

Contributing

see CONTRIBUTING.md

License

see LICENSE.md