Event Planner is a React/Next.js web application developed by XB Software for event organizers. Centralize events, track real-time metrics, and manage attendees from a single hub. The modular architecture enables seamless integration and customization, helping streamline workflows with minimal effort.
Complete guide for deploying Event Planner on a fresh Ubuntu server.
- Ubuntu 20.04+ (tested on Ubuntu 22.04)
- Minimum 1GB RAM (512MB possible but requires swap)
- 10GB+ free disk space
- Root or sudo access
# Update system packages
sudo apt update && sudo apt upgrade -y
# Install essential packages
sudo apt install -y curl wget git unzip software-properties-common# Add NodeSource repository
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
# Install Node.js
sudo apt install -y nodejs
# Verify installation
node --version # Should show v20.x.x
npm --version # Should show 10.x.x# Install MySQL Server
sudo apt install -y mysql-server
# Secure MySQL installation
sudo mysql_secure_installation- VALIDATE PASSWORD:
y(Yes) - Password Policy:
1(MEDIUM) - Root Password: Set a strong password
- Confirm Password: Re-enter same password
- Continue:
y - Remove anonymous users:
y - Disallow root remote login:
y - Remove test database:
y - Reload privileges:
y
# Start and enable MySQL
sudo systemctl start mysql
sudo systemctl enable mysql
# Create application database and user
sudo mysql -u root -pExecute these SQL commands:
CREATEDATABASExbs_events;
CREATEUSER 'xbs_user'@'localhost' IDENTIFIED BY 'your_secure_password_here';
GRANT ALL PRIVILEGES ON xbs_events.* TO 'xbs_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;Test database connection:
mysql -u xbs_user -p xbs_events
# Enter password, then EXIT;# Clone repository
git clone https://github.com/xbsoftware/event-planner.git
cd xbs-events
# Install dependencies
npm installCreate production environment file:
nano .envAdd this content (replace password with your MySQL password):
# Production EnvironmentDB_PROVIDER="mysql"DATABASE_URL="mysql://xbs_user:your_secure_password_here@localhost:3306/xbs_events"# Generate a secure JWT secret (see command below)JWT_SECRET="your_secure_jwt_secret_here"NODE_ENV="production"Generate a secure JWT secret:
node -e "console.log('JWT_SECRET=\"' + require('crypto').randomBytes(64).toString('hex') + '\"')"# Copy the output and replace JWT_SECRET in .env file# Create database tables
npm run db:push
# Seed initial data (creates admin users)
npm run db:seed
# Verify setup
mysql -u xbs_user -p xbs_events -e "SHOW TABLES; SELECT email, role FROM users;"npm run build# Build on local machine and transfer# On your local machine:
npm run build
COPYFILE_DISABLE=1 tar -czf next-build.tar.gz .next
# Transfer to server:
scp next-build.tar.gz root@your-server-ip:~/xbs-events/
# On server:
tar -xzf next-build.tar.gz
rm next-build.tar.gz# Install PM2 globally
sudo npm install -g pm2
# Create PM2 configuration file
nano ecosystem.config.jsAdd this content (adjust path as needed):
module.exports={apps: [{name: "xbs-events",script: "npm",args: "start",cwd: "/root/xbs-events",// Adjust to your actual pathenv: {NODE_ENV: "production",},instances: 1,autorestart: true,watch: false,max_memory_restart: "400M",error_file: "./logs/err.log",out_file: "./logs/out.log",log_file: "./logs/combined.log",time: true,},],};# Create logs directory
mkdir logs
# Start application with PM2
pm2 start ecosystem.config.js
# Save PM2 configuration
pm2 save
# Setup auto-start on boot
pm2 startup
# Follow the instructions shown (run the suggested command)# Install Nginx
sudo apt install -y nginx
# Create Nginx configuration
sudo nano /etc/nginx/sites-available/xbs-eventsAdd this content (replace YOUR_SERVER_IP with your actual server IP):
server{listen80;server_name YOUR_SERVER_IP; # Replace with your domain or server IP
location / {proxy_passhttp://localhost:3000;proxy_http_version 1.1;proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection 'upgrade';proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Proto $scheme;proxy_cache_bypass$http_upgrade;proxy_redirect off;}}# Enable site and remove default
sudo ln -s /etc/nginx/sites-available/xbs-events /etc/nginx/sites-enabled/
sudo rm /etc/nginx/sites-enabled/default
# Test configuration
sudo nginx -t
# Start and enable Nginx
sudo systemctl restart nginx
sudo systemctl enable nginx