Skip to content

About

One-command Docker Compose setup for Brew Inventory, a full-stack coffee and tea inventory app.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Brew Inventory

Run the whole Brew Inventory stack locally with a single command. Brew Inventory is a full-stack inventory management app for specialty coffee and tea stores.

This repo contains only the Docker Compose setup. The application code lives in two separate repos, which Compose builds directly from GitHub:

Service Source Description
client brew-inventory-client React frontend, served by nginx
server brew-inventory-server Express REST API
db Official postgres:17-alpine image PostgreSQL database
db-setup Same image as server One-shot job that creates tables and seeds data

Prerequisites

  • Docker with Docker Compose v2 (included in Docker Desktop)
  • Internet access on the first run, since the images are built from the GitHub repos

You don't need Node.js or PostgreSQL installed, and you don't need to clone the client and server repos.

Quick start

  1. Clone this repo:

    git clone https://github.com/Maddily/brew-inventory.git
    cd brew-inventory
  2. Create your environment file:

    cp .env.example .env
  3. Edit .env and replace the placeholder values (see Configuration).

  4. Build and start everything:

    docker compose up --build
  5. Open http://localhost:8080.

The first build takes a few minutes. Later starts are much faster.

Configuration

All settings live in .env. Compose refuses to start if any of them is missing.

Variable Description
POSTGRES_USER Database user
POSTGRES_PASSWORD Database password
POSTGRES_DB Database name
ADMIN_PASSWORD Password the app asks for before editing or deleting a product

Note: The brew123 password shown in the client and server READMEs is only for the public live demo. In this local stack, the admin password is whatever you set as ADMIN_PASSWORD in .env.

What happens on startup

  1. db starts and passes its healthcheck.
  2. db-setup runs node db/setup.js, which creates the tables, then loads the category, attribute and sample product data only if the database is empty.
  3. server starts once db-setup has finished successfully.
  4. client starts.

Because of the empty-database check, restarting the stack keeps your data. If you see database already seeded, skipping in the db-setup logs, that's expected.

Ports

URL What
http://localhost:8080 Frontend
http://localhost:3000 API (used by the app)

The database isn't exposed to your machine, only to the other containers.

Common commands

Stop the stack and keep your data:

docker compose down

Stop the stack and delete all data (the next up reseeds from scratch):

docker compose down -v

View logs:

docker compose logs -f           # everything
docker compose logs db-setup     # table creation and seeding
docker compose logs server

Updating to the latest code

The client and server are built from the default branch of their GitHub repos, and Docker caches the result. To pick up new commits, rebuild without cache:

docker compose build --no-cache
docker compose up

Troubleshooting

set POSTGRES_USER in .env (or a similar message) on startup: your .env file is missing or incomplete. Check that you copied .env.example to .env and that every variable has a value.

The app loads but shows no products or errors: check docker compose logs db-setup and docker compose logs server. If setup failed, the server never starts.

Port already in use: something else on your machine is using port 3000 or 8080. Stop it, or change the left side of the ports mapping in compose.yaml (for example "8081:8080"). If you change the API port, also update VITE_API_URL and FRONTEND_URL to match, and rebuild.

Project structure

brew-inventory/
├── .env              # your local settings (not committed)
├── .env.example
├── .gitignore
├── compose.yaml
└── README.md

About

One-command Docker Compose setup for Brew Inventory, a full-stack coffee and tea inventory app.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors