Skip to content
julien-infra-jokers logo

Jokers Hockey - Infrastructure Management

julien-infra-jokers

Complete management for Jokers Hockey website - deployment, build checks, database migrations (Drizzle ORM), and PM2 process management. Use for any Jokers site operation.

SKILL.md

Full skill instructions

Jokers Hockey - Infrastructure Management

Complete infrastructure management for the Jokers Hockey website.

Quick Reference

ComponentDetails
Serversrv759970.hstgr.cloud (69.62.108.82)
Userautomation
Path/​var/​www/​jokers
PM2 Processjokers-hockey
Port5020
URLhttps://jokers.srv759970.hstgr.cloud
DatabasePostgreSQL (localhost:5432/​jokers_prod)
ORMDrizzle

1. Deployment

Quick Deploy (Git)

ssh [email protected]
cd /​var/​www/​jokers
git pull origin main
npm install
npm run db:push
npm run build
pm2 restart jokers-hockey

Pre-Deployment Checks

# Local: verify build works
npm run check
npm run build
ls -la dist/

Verify Deployment

pm2 status jokers-hockey
pm2 logs jokers-hockey --lines 50
curl -I https://jokers.srv759970.hstgr.cloud

Rollback

git log --oneline -5
git checkout <previous-commit>
npm install && npm run build
pm2 restart jokers-hockey

2. Build Verification

Full Build Check

# TypeScript compilation
npm run check

# Clean build
rm -rf dist/ && npm run build

# Verify output
ls -la dist/
ls -la dist/​public/​assets/

Expected Structure

dist/
├── index.js        (server ~5KB)
└── public/
    ├── index.html
    └── assets/
        ├── index-[hash].css  (~70KB)
        └── index-[hash].js   (~350KB)

Quality Checks

# No debug code
grep -r "console.log\|debugger" client/​src/ || echo "Clean"

# Security audit
npm audit --production

# Bundle sizes (should be < 500KB JS, < 100KB CSS)
du -sh dist/​public/​assets/​*.js
du -sh dist/​public/​assets/​*.css

3. Database (Drizzle ORM)

Schema Location

  • Schema: shared/​schema.ts
  • Config: drizzle.config.ts

Push Schema Changes

# Development (direct apply)
npm run db:push

# Production
ssh [email protected]
cd /​var/​www/​jokers
git pull origin main
npm run db:push
pm2 restart jokers-hockey

Schema Example

import { pgTable, serial, text, timestamp } from "drizzle-orm/​pg-core";

export const news = pgTable("news", {
  id: serial("id").primaryKey(),
  title: text("title").notNull(),
  content: text("content").notNull(),
  publishedAt: timestamp("published_at").defaultNow(),
});

Backup Before Changes

docker exec postgresql-shared pg_dump -U postgres jokers_prod > backup_$(date +%Y%m%d).sql

Verify Database

ssh [email protected]
docker exec -it postgresql-shared psql -U postgres -d jokers_prod
\dt  # list tables
\d table_name  # describe table
\q

4. PM2 Management

Status & Monitoring

ssh [email protected]
pm2 status jokers-hockey
pm2 show jokers-hockey
pm2 monit  # live dashboard

Logs

pm2 logs jokers-hockey --lines 100
pm2 logs jokers-hockey --err  # errors only
pm2 flush jokers-hockey  # clear logs

Process Control

pm2 restart jokers-hockey
pm2 stop jokers-hockey
pm2 start jokers-hockey
pm2 reload jokers-hockey  # zero-downtime

PM2 Config

File: /​var/​www/​jokers/​ecosystem.config.cjs

module.exports = {
  apps: [{
    name: 'jokers-hockey',
    script: './​dist/​index.js',
    instances: 1,
    env: { NODE_ENV: 'production', PORT: 5020 },
    max_memory_restart: '500M',
  }]
}

Save Configuration

pm2 save  # after any changes

5. Troubleshooting

Site Down

pm2 status jokers-hockey
pm2 logs jokers-hockey --lines 100
pm2 restart jokers-hockey
curl -I https://jokers.srv759970.hstgr.cloud

Build Fails

npm run check  # TypeScript errors
rm -rf node_modules/​.vite && npm install
npm run build

Database Connection

echo $DATABASE_URL
docker exec postgresql-shared psql -U postgres -d jokers_prod -c "SELECT version();"

Port Conflict

netstat -tulpn | grep :5020

502 Bad Gateway

pm2 restart jokers-hockey
sudo nginx -t
sudo tail -f /​var/​log/​nginx/​jokers_ssl_error.log

6. Health Check Script

#!/​bin/​bash
echo "=== Jokers Health Check ==="
pm2 status jokers-hockey | grep online && echo "PM2: OK"
curl -sI https://jokers.srv759970.hstgr.cloud | grep "200\|301" && echo "HTTP: OK"
netstat -tulpn | grep :5020 && echo "Port: OK"
docker exec postgresql-shared psql -U postgres -d jokers_prod -c "SELECT 1;" && echo "DB: OK"

Security Notes

  • Never commit .env files
  • DATABASE_URL stored server-side only
  • SSL auto-renews via Let's Encrypt
  • Always test locally before deploying

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View