Installation Guide
This guide will help you set up the complete Salonnz development environment.
Prerequisites
Ensure you have the following installed:
- PHP 8.0 or higher
- Node.js 18 or higher
- MySQL/MariaDB 8.0 or higher
- Composer (PHP package manager)
- npm or yarn
- Expo CLI (for mobile development)
- Git
Database Setup
Important
Salonnz uses a multi-tenant architecture with a database-per-tenant model. You need to set up:
- Master Database - Central database for all tenants
- Tenant Database(s) - Individual databases for each salon
1. Create Databases
# Create master database
mysql -u root -p -e "CREATE DATABASE client_database;"
# Create sample tenant database
mysql -u root -p -e "CREATE DATABASE client_82637;"
2. Import Database Schemas
cd /path/to/REACT-NATIVE_USER_APP
# Import master database (MUST BE FIRST)
mysql -u root -p client_database < Database/client_database.sql
# Import sample tenant database
mysql -u root -p client_82637 < Database/client_82637.sql
Backend Setup (Laravel API)
1. Install Dependencies
cd Backend-Laravel
composer install
2. Configure Environment
# Copy example environment file
cp .env.example .env
Edit .env and configure database connections:
.env
# Master Database Configuration
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=client_database
DB_USERNAME=your_username
DB_PASSWORD=your_password
# Tenant Database Configuration
TENANT_DB_CONNECTION=mysql
DEFAULT_TENANT_DB_DATABASE=client_82637
# Stripe Configuration
STRIPE_KEY=your_stripe_publishable_key
STRIPE_SECRET=your_stripe_secret_key
# AWS S3 Configuration (optional)
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
# Application URL
APP_URL=http://localhost:8000
3. Generate Application Key
php artisan key:generate
4. Run Migrations (if needed)
php artisan migrate
5. Start Development Server
php artisan serve
The API will be available at http://localhost:8000
Frontend Admin Panel (Nuxt.js)
1. Install Dependencies
cd Frontend-Admin-Panel
npm install
2. Configure Environment
Create .env file:
.env
API_BASE_URL=http://localhost:8000/api
3. Start Development Server
npm run dev
Admin panel will be available at http://localhost:3000
Web User App (Next.js)
1. Install Dependencies
cd Frontend-Userapp-Web
npm install
2. Configure Environment
Create .env.local file:
.env.local
NEXT_PUBLIC_API_URL=http://localhost:8000/api
NEXT_PUBLIC_STRIPE_KEY=your_stripe_publishable_key
3. Start Development Server
npm run dev
Web app will be available at http://localhost:3001
Mobile App (React Native)
1. Install Dependencies
cd Frontend-User-App-React-Native
npm install
2. Configure Environment
Update API URL in your configuration files.
3. Start Expo Development Server
npx expo start
Use Expo Go app on your device or emulator to run the mobile app.
Verify Installation
Backend API
Test the API by visiting:
http://localhost:8000/api/health
Import Postman Collection
Import Salonnz-api-collection.json into Postman to test all endpoints.
Common Issues
Database Connection Failed
- Verify MySQL is running:
mysql -u root -p - Check credentials in
.envfile - Ensure databases exist:
SHOW DATABASES;
Port Already in Use
Change the port in your respective configuration:
# Laravel
php artisan serve --port=8001
# Nuxt
PORT=3002 npm run dev
# Next.js
PORT=3003 npm run dev
Composer Dependencies Error
# Clear composer cache
composer clear-cache
# Update dependencies
composer update
Next Steps
- Quick Start Guide - Learn the basics
- Architecture Overview - Understand the system
- Admin Panel Guide - Configure your salon
Need help? Check the Troubleshooting guide.