Skip to main content

System Requirements

Before installing Beils Dashboard, ensure your system meets these requirements:

Minimum Requirements

Server Requirements

  • OS: Linux (Ubuntu 20.04+), macOS 10.15+, or Windows 10+
  • RAM: 2GB minimum, 4GB recommended
  • Storage: 5GB free space
  • CPU: 2 cores minimum

Software Requirements

  • Node.js: v18.0.0 or higher (v20.x recommended)
  • pnpm: v8.0.0 or higher
  • MariaDB/MySQL: v10.6 or higher
  • Git: v2.20 or higher

Prerequisites Installation

# Update package list
sudo apt update

# Install Node.js 20.x
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs

# Install pnpm
npm install -g pnpm

# Install MariaDB
sudo apt install -y mariadb-server mariadb-client

# Secure MariaDB installation
sudo mysql_secure_installation

# Install Git
sudo apt install -y git
Verify installations by running:
  • node --version (should be v18+)
  • pnpm --version
  • mysql --version or mariadb --version
  • git --version

Development Installation

1

Clone the Repository

Get the source code from your repository:
git clone <your-repository-url> beils-dashboard
cd beils-dashboard
2

Install Dependencies

Install all required npm packages:
pnpm install
This installs the following key dependencies:
  • bcryptjs@^3.0.3 - Password hashing
  • jsonwebtoken@^9.0.3 - JWT token generation/verification
  • [email protected] - Schema validation
  • [email protected] - Internationalization
  • echarts@^6.0.0 - Data visualization charts
  • vue-echarts@^8.0.1 - Vue wrapper for ECharts
  • html2pdf.js@^0.14.0 - PDF generation
  • [email protected] - Scroll animations
3

Database Setup

Create a new MariaDB/MySQL database:
# Connect to MariaDB
sudo mysql -u root -p
-- Create database
CREATE DATABASE transpallet_plus_db 
CHARACTER SET utf8mb4 
COLLATE utf8mb4_unicode_ci;

-- Create dedicated user (recommended for production)
CREATE USER 'beils_user'@'localhost' IDENTIFIED BY 'secure_password_here';

-- Grant privileges
GRANT ALL PRIVILEGES ON transpallet_plus_db.* TO 'beils_user'@'localhost';
FLUSH PRIVILEGES;

-- Exit
EXIT;
For production, use a strong password and consider limiting privileges to only what’s needed (SELECT, INSERT, UPDATE, DELETE).
4

Environment Configuration

Create a .env file in the project root:
.env
# ===========================================
# DATABASE CONFIGURATION
# ===========================================
# MariaDB/MySQL connection settings
DATABASE_HOST=localhost
DATABASE_USER=beils_user
DATABASE_PASSWORD=secure_password_here
DATABASE_NAME=transpallet_plus_db
DATABASE_PORT=3306

# ===========================================
# AUTHENTICATION
# ===========================================
# JWT secret for token signing (use a long random string)
JWT_SECRET=your-super-secret-jwt-key-min-32-characters-long

# ===========================================
# APPLICATION SETTINGS
# ===========================================
NODE_ENV=development

# Optional: Custom port for dev server (default 3000)
# PORT=3000

# Optional: Base URL for production
# BASE_URL=https://yourdomain.com
Generate a secure JWT secret using:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
5

Prisma Setup

Initialize Prisma and generate the client:
# Generate Prisma Client based on schema
pnpm prisma:generate
The Prisma schema is located at prisma/schema.prisma and includes:
  • User management with roles (ADMIN, USER)
  • Client CRM (consents, questionnaires, revokes)
  • Product catalog (brands, categories, subcategories, tags)
  • Services and packs
  • Marketing tools (coupons, bonuses, gift cards)
  • Point of sale (carts, cart items, debts)
  • Appointment booking system
6

Database Migration

Apply the schema to your database:
pnpm prisma:migrate
This creates all tables, indexes, foreign keys, and constraints defined in the schema.
Migration name will be “init” by default. The migration files are stored in prisma/migrations/.
7

Database Seeding

Populate the database with initial data:
pnpm seed
The seed script (seeds/seed-db.ts) creates:Users (25 total)
  • 1 Admin: [email protected] / password123
  • 2 Staff members (ADMIN role)
  • 22 Clients (USER role)
Brands
  • Masglo
  • Bioline Jato
Client Data
  • 0-3 consent forms per client
  • 0-2 questionnaires per client
  • 0-5 bookings per client (past and future)
The seed script will delete all existing data before seeding. Only run this in development!
8

Start Development Server

Launch the application:
pnpm dev
The server will start at http://localhost:3000 with:
  • Hot module replacement (HMR)
  • TypeScript type checking
  • Automatic compilation
  • API routes at /api/*
Access the dashboard and login with:

Production Installation

1

Environment Setup

Create a production .env file:
.env
# Production database configuration
DATABASE_HOST=your-db-host.com
DATABASE_USER=production_user
DATABASE_PASSWORD=strong-production-password
DATABASE_NAME=beils_production_db
DATABASE_PORT=3306

# Strong JWT secret (64+ characters recommended)
JWT_SECRET=<64-character-random-string>

# Production settings
NODE_ENV=production
BASE_URL=https://yourdomain.com
2

Build the Application

Create an optimized production build:
pnpm build
This generates:
  • Minified JavaScript bundles
  • Optimized CSS
  • Pre-rendered pages
  • Server-side code in .output/
3

Database Migration

Run migrations on production database:
pnpm prisma:migrate
Always backup your production database before running migrations!
4

Start Production Server

Run the production build:
node .output/server/index.mjs
Or use the preview command for local testing:
pnpm preview

Deployment Options

Option 1: Traditional Server (VPS/Dedicated)

1

Server Setup

# Install Node.js and PM2 process manager
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
npm install -g pm2
2

Deploy Application

# Clone and build
git clone <repo> /var/www/beils-dashboard
cd /var/www/beils-dashboard
pnpm install
pnpm build

# Start with PM2
pm2 start .output/server/index.mjs --name beils-dashboard
pm2 save
pm2 startup
3

Configure Nginx

server {
    listen 80;
    server_name yourdomain.com;
    
    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

Option 2: Docker Deployment

Create a Dockerfile:
FROM node:20-alpine

WORKDIR /app

# Copy package files
COPY package.json pnpm-lock.yaml ./

# Install pnpm and dependencies
RUN npm install -g pnpm
RUN pnpm install --frozen-lockfile

# Copy application files
COPY . .

# Generate Prisma client
RUN pnpm prisma:generate

# Build application
RUN pnpm build

EXPOSE 3000

# Start application
CMD ["node", ".output/server/index.mjs"]
Create docker-compose.yml:
version: '3.8'

services:
  app:
    build: .
    ports:
      - "3000:3000"
    environment:
      - DATABASE_HOST=db
      - DATABASE_USER=beils
      - DATABASE_PASSWORD=secure_password
      - DATABASE_NAME=beils_db
      - JWT_SECRET=${JWT_SECRET}
      - NODE_ENV=production
    depends_on:
      - db
  
  db:
    image: mariadb:10.11
    environment:
      - MYSQL_ROOT_PASSWORD=root_password
      - MYSQL_DATABASE=beils_db
      - MYSQL_USER=beils
      - MYSQL_PASSWORD=secure_password
    volumes:
      - db_data:/var/lib/mysql
    ports:
      - "3306:3306"

volumes:
  db_data:
Deploy with Docker:
# Build and start
docker-compose up -d

# Run migrations
docker-compose exec app pnpm prisma:migrate

# View logs
docker-compose logs -f app

Option 3: Platform-as-a-Service

# Install Vercel CLI
npm install -g vercel

# Deploy
vercel

# Configure environment variables in Vercel dashboard
# Set DATABASE_* and JWT_SECRET variables
Ensure your database is accessible from Vercel’s infrastructure (may require whitelisting IPs or using managed database).

Database Management

Prisma Commands

CommandDescription
pnpm prisma:generateGenerate Prisma Client
pnpm prisma:migrateCreate and apply migrations
pnpm prisma:pullPull schema from existing database
pnpm prisma:resetReset database (delete all data)
pnpx prisma studioOpen Prisma Studio (database GUI)

Backup and Restore

Backup database:
mysqldump -u beils_user -p transpallet_plus_db > backup.sql
Restore database:
mysql -u beils_user -p transpallet_plus_db < backup.sql
Schedule regular backups using cron:
# Daily backup at 2 AM
0 2 * * * mysqldump -u user -p'password' db > /backups/$(date +\%Y\%m\%d).sql

SSL/TLS Configuration

For production, always use HTTPS:
1

Obtain SSL Certificate

# Using Let's Encrypt (free)
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d yourdomain.com
2

Configure Nginx for HTTPS

server {
    listen 443 ssl http2;
    server_name yourdomain.com;
    
    ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
    
    location / {
        proxy_pass http://localhost:3000;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Host $host;
    }
}

# Redirect HTTP to HTTPS
server {
    listen 80;
    server_name yourdomain.com;
    return 301 https://$server_name$request_uri;
}
3

Auto-renewal

# Test renewal
sudo certbot renew --dry-run

# Certificates auto-renew via cron

Performance Optimization

Database Optimization

-- Add indexes for frequently queried fields
CREATE INDEX idx_users_email ON users(email);
CREATE INDEX idx_bookings_date ON bookings(booking_date);
CREATE INDEX idx_products_sku ON products(sku);

-- Optimize tables
OPTIMIZE TABLE users, bookings, products;

Application Optimization

// nuxt.config.ts - Production optimizations
export default defineNuxtConfig({
  vite: {
    build: {
      minify: 'terser',
      cssMinify: true,
    },
  },
  nitro: {
    compressPublicAssets: true,
    minify: true,
  },
})

Monitoring and Logs

Application Logs

# PM2 logs
pm2 logs beils-dashboard
pm2 logs beils-dashboard --lines 100

# Save logs to file
pm2 logs beils-dashboard > logs.txt

Database Logs

-- Enable query logging (MariaDB)
SET GLOBAL general_log = 'ON';
SET GLOBAL general_log_file = '/var/log/mysql/query.log';

Troubleshooting

# Clear Prisma cache and regenerate
rm -rf node_modules/.prisma
pnpm prisma:generate
pnpm build
  • Check firewall rules allow port 3306
  • Verify database host is reachable: ping your-db-host
  • Increase connection timeout in prisma.config.ts
  • Check database user permissions
# Find and kill process using port 3000
lsof -ti:3000 | xargs kill -9

# Or use a different port
PORT=3001 pnpm dev
  • Ensure JWT_SECRET is set in .env
  • Verify token hasn’t expired (24h default)
  • Check for special characters in secret that need escaping
  • Clear browser cookies/localStorage and re-login
# Increase Node.js memory limit
NODE_OPTIONS="--max-old-space-size=4096" node .output/server/index.mjs

# Or in PM2
pm2 start .output/server/index.mjs --name beils --node-args="--max-old-space-size=4096"

Security Checklist

1

Environment Variables

  • Use strong JWT_SECRET (64+ characters)
  • Never commit .env to version control
  • Use different credentials for dev/prod
  • Rotate secrets periodically
2

Database Security

  • Use strong database passwords
  • Limit database user privileges
  • Enable SSL for database connections
  • Regular backups and backup testing
3

Application Security

  • Enable HTTPS with valid SSL certificate
  • Keep dependencies updated: pnpm update
  • Configure CORS properly
  • Implement rate limiting on API routes
  • Regular security audits: pnpm audit
4

Server Security

  • Configure firewall (UFW/iptables)
  • Disable root SSH login
  • Set up fail2ban for brute-force protection
  • Keep OS and packages updated

Next Steps

API Reference

Explore the complete API documentation

Administration

Learn how to configure and manage your Beils Dashboard
Join our community for support, updates, and best practices for running Beils Dashboard in production.

Build docs developers (and LLMs) love