macOS Setup Guide

Installation and configuration for Salon Management on macOS

Prerequisites

Before installing Salon Management on macOS, ensure you have:

  • macOS 11 (Big Sur) or later recommended
  • An administrator account for installing software
  • At least 4GB of RAM (8GB recommended)
  • Free disk space for Node, MySQL, and project dependencies
  • Internet access for downloads
  • Xcode Command Line Tools (often prompted automatically when you use git or compilers)

Step 1: Install Homebrew

1

Install Homebrew

Homebrew is a convenient way to install Node.js and MySQL on macOS:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
2

Add Homebrew to your PATH

# Apple Silicon (M1/M2/M3…)
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

# Intel Mac
echo 'eval "$(/usr/local/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/usr/local/bin/brew shellenv)"

Open a new terminal window if brew is not found.

3

Verify Homebrew

brew --version

Step 2: Install Node.js

1

Install Node.js

brew install node
2

Verify

node --version
npm --version

Note

Salon Management works best with Node.js 18 or newer.

1

Download the installer

Download the LTS macOS .pkg from https://nodejs.org and run it.

2

Verify

node --version
npm --version
1

Install NVM

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
2

Reload the shell

source ~/.zshrc
3

Install Node.js 20 LTS (example)

nvm install 20
nvm use 20
nvm alias default 20

Step 3: Install MySQL

1

Install and start MySQL

brew install mysql
brew services start mysql
2

Harden installation (recommended)

mysql_secure_installation
1

Download MySQL Community Server

Use the macOS installer from MySQL downloads (choose Apple Silicon or Intel as appropriate).

2

Complete the wizard

Set a root password and optionally install MySQL as a system service. Use the same credentials in server/.env if you connect as root for development.

3

Create database and user

Align names and passwords with server/.env:

mysql -u root -p

CREATE DATABASE salon_management CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

CREATE USER 'salon'@'localhost' IDENTIFIED BY 'your_secure_password';
GRANT ALL PRIVILEGES ON salon_management.* TO 'salon'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 4: Install Salon Management (server)

The application is a single Express server with EJS views—no separate frontend dev server is required.

1

Open the server folder

cd /path/to/pdma_envato_salon_management/server
2

Install dependencies

npm install
3

Configure environment

cp .env-example .env
open -e .env

Or use nano .env from Terminal. Set MySQL and JWT values to match your setup.

Example server/.env

NODE_ENV=development
PORT=3000

DB_HOST=127.0.0.1
DB_PORT=3306
DB_NAME=salon_management
DB_USER=salon
DB_PASSWORD=your_secure_password

JWT_SECRET=your-strong-secret-change-in-production
JWT_EXPIRES_IN=7d

# Optional demo showcase
# DEMO_SEED_CRON_ENABLED=true
# DEMO_SEED_CRON_TZ=UTC

Security

Never commit real secrets. Use a strong JWT_SECRET in production.

4

Migrate and seed

npm run db:migrate
npm run db:seed
5

Start the application

npm run dev

Default URL: http://127.0.0.1:3000 (or your PORT). The home route redirects to /auth/login.

Demo credentials (after seeding)

Password for all demo accounts: Admin@1234

  • Admin: admin@salon.com
  • Receptionist: reception@salon.com
  • Staff: staff@salon.com, staff02@salon.com, staff03@salon.com

Important

Change these passwords before production. Overview: Home.

Step 5: Production with PM2

1

Install PM2 globally

npm install -g pm2

On macOS you typically do not need sudo if npm’s global prefix is in your home directory.

2

Example ecosystem.config.js (in server/)

module.exports = {
  apps: [{
    name: 'salon-management',
    cwd: __dirname,
    script: './bin/www',
    instances: 1,
    autorestart: true,
    watch: false,
    max_memory_restart: '1G',
    env: {
      NODE_ENV: 'production',
      PORT: 3000
    }
  }]
};
3

Start and persist

cd /path/to/pdma_envato_salon_management/server
pm2 start ecosystem.config.js
pm2 save
pm2 startup

Run the command pm2 startup prints so the app restarts after reboot.

4

Useful PM2 commands

pm2 list
pm2 logs salon-management
pm2 restart salon-management

Reverse proxy

Behind nginx or Apache, terminate TLS and forward to 127.0.0.1:3000. See server configuration guide.

Troubleshooting

  • Command not found: Ensure Homebrew is on your PATH; restart Terminal.
  • Port in use: lsof -i :3000, then stop the process or change PORT.
  • MySQL will not start: brew services list and brew services restart mysql for Homebrew installs.
  • Cannot connect to DB: Check DB_USER, DB_PASSWORD, and that the database exists.

More help

See the troubleshooting guide.