# ERP POS

PostgreSQL foundation for a multi-store point-of-sale system. The initial schema lives in the `erp` database schema and covers stores, staff access, products, customers, stock, sales, and payments.

## Start the database

1. Copy `.env.example` to `.env` and set a local development password.
2. Start PostgreSQL with `docker compose up -d`.
3. Check readiness with `docker compose ps`.

The database is exposed only on localhost. Initialization SQL runs when the database volume is first created. To apply future schema changes to an existing database, use versioned migrations; init scripts are not rerun for an existing volume.

Connect with:

```sh
docker compose exec database psql -U erp_pos -d erp_pos
```

The initial account and database names can be changed through `.env`. Do not commit `.env` or use development credentials in production.