This guide covers deploying your Limitless Infotech website to production.
Pros:
Steps:
npm install -g vercel
vercel login
vercel
# In Vercel dashboard or CLI
vercel env add JWT_SECRET
vercel env add DATABASE_URL
vercel env add SMTP_HOST
# ... add all required variables
vercel --prod
Steps:
npm install -g netlify-cli
npm run build
netlify deploy --prod --dir=.next
Requirements:
Steps:
# Update system
sudo apt update && sudo apt upgrade -y
# Install Node.js
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
# Install PostgreSQL
sudo apt install postgresql postgresql-contrib
# Install Nginx
sudo apt install nginx
# Install PM2
sudo npm install -g pm2
# Clone repository
git clone https://github.com/your-repo/limitless-infotech.git
cd limitless-infotech
# Install dependencies
npm install
# Set up environment
cp .env.production.example .env.production
# Edit .env.production with your values
# Build application
npm run build
# Start with PM2
pm2 start npm --name "limitless-infotech" -- start
pm2 save
pm2 startup
# /etc/nginx/sites-available/limitlessinfotech.com
server {
listen 80;
server_name limitlessinfotech.com www.limitlessinfotech.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_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;
}
}
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d limitlessinfotech.com -d www.limitlessinfotech.com
postgresql://postgres:[password]@[host]:5432/postgres
# Set DATABASE_URL in .env.local
npm run db:setup
sudo apt install postgresql postgresql-contrib
sudo -u postgres createdb limitless_infotech
sudo -u postgres createuser --interactive
DATABASE_URL=postgresql://username:password@localhost:5432/limitless_infotech
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-password
SENDGRID_API_KEY=SG.your-api-key
SMTP_HOST=smtp.mailgun.org
SMTP_PORT=587
SMTP_USER=your-username
SMTP_PASS=your-password
# Security
JWT_SECRET=your-strong-secret
# Database
DATABASE_URL=postgresql://...
# Email
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-password
# Site
NEXT_PUBLIC_SITE_URL=https://limitlessinfotech.com
CONTACT_EMAIL=info@limitlessinfotech.com
# Analytics
NEXT_PUBLIC_GA_ID=G-XXXXXXXXXX
# Social
NEXT_PUBLIC_TWITTER_HANDLE=@limitlessinfotech
NEXT_PUBLIC_LINKEDIN_URL=https://linkedin.com/company/limitlessinfotech
# API Keys
GOOGLE_MAPS_API_KEY=your-key
RECAPTCHA_SITE_KEY=your-key
NEXT_PUBLIC_GA_ID=G-XXXXXXXXXX
https://limitlessinfotech.com/sitemap.xmlVercel/Netlify:
Self-Hosted:
# Let's Encrypt
sudo certbot --nginx -d limitlessinfotech.com
Add to next.config.js:
module.exports = {
async headers() {
return [
{
source: '/(.*)',
headers: [
{
key: 'X-Frame-Options',
value: 'DENY'
},
{
key: 'X-Content-Type-Options',
value: 'nosniff'
},
{
key: 'Referrer-Policy',
value: 'origin-when-cross-origin'
}
]
}
]
}
}
# Install dependencies
npm install
# Set up database
npm run db:setup
# Build application
npm run build
# Test production build
npm start
# Check for errors
npm run type-check
# Deploy to production
vercel --prod
# Check deployment status
vercel ls
# Pull latest changes
git pull origin main
# Install dependencies
npm install
# Build application
npm run build
# Restart PM2
pm2 restart limitless-infotech
pm2 logs limitless-infotech
# Lighthouse audit
npx lighthouse https://limitlessinfotech.com --view
# Check broken links
npx broken-link-checker https://limitlessinfotech.com
# Security headers
curl -I https://limitlessinfotech.com
# Automated daily backups
pg_dump $DATABASE_URL > backup_$(date +%Y%m%d).sql
# Update dependencies
npm update
npm audit fix
Build Fails
# Clear cache and rebuild
rm -rf .next node_modules
npm install
npm run build
Database Connection Error
Email Not Sending
Admin Login Not Working
# Enable debug logging
NODE_ENV=development npm run dev
# Check database connection
npm run db:test
# View PM2 logs
pm2 logs limitless-infotech
For deployment assistance:
Last Updated: November 2024