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
gitor compilers)
Step 1: Install Homebrew
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)"
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.
Verify Homebrew
brew --version
Step 2: Install Node.js
Install Node.js
brew install node
Verify
node --version npm --version
Note
Salon Management works best with Node.js 18 or newer.
Download the installer
Download the LTS macOS .pkg from https://nodejs.org and run it.
Verify
node --version npm --version
Install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
Reload the shell
source ~/.zshrc
Install Node.js 20 LTS (example)
nvm install 20 nvm use 20 nvm alias default 20
Step 3: Install MySQL
Install and start MySQL
brew install mysql brew services start mysql
Harden installation (recommended)
mysql_secure_installation
Download MySQL Community Server
Use the macOS installer from MySQL downloads (choose Apple Silicon or Intel as appropriate).
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.
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.
Open the server folder
cd /path/to/pdma_envato_salon_management/server
Install dependencies
npm install
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.
Migrate and seed
npm run db:migrate npm run db:seed
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
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.
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
}
}]
};
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.
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 changePORT. - MySQL will not start:
brew services listandbrew services restart mysqlfor Homebrew installs. - Cannot connect to DB: Check
DB_USER,DB_PASSWORD, and that the database exists.
More help
See the troubleshooting guide.