Real-time system log and image viewer - Next.js version
nextjs-app/
βββ app/ # Next.js app directory
β βββ layout.tsx # Page layout
β βββ page.tsx # Homepage
β βββ globals.css # Global styles
β
βββ components/ # React components
β βββ MainContent.tsx # Main container
β βββ Sidebar.tsx # Sidebar (4 cards)
β βββ Card.tsx # Card component
β βββ DisplayArea.tsx # Content display area
β βββ LogViewer.tsx # Log viewer
β βββ VersionViewer.tsx # Image version viewer
β βββ WeatherViewer.tsx # Weather forecast
β βββ RotateButton.tsx # Rotate button
β βββ *.module.css # Component styles
β
βββ public/ # Static files
β βββ logs/ # Log files
β βββ favicon.ico # Website icon
β
βββ logs/ # PM2 logs
β
βββ ecosystem.config.js # PM2 configuration
βββ package.json # Project dependencies
βββ next.config.js # Next.js configuration
βββ README.md # This file
npm installnpm run build# Start with PM2
pm2 start ecosystem.config.js
# Check status
pm2 list- Local: http://localhost:3000
- Online: https://www.yusteven.com
# Start application
pm2 start ecosystem.config.js
# Stop application
pm2 stop nextjs-app
# Restart application
pm2 restart nextjs-app
# Check status
pm2 list
# View logs
pm2 logs nextjs-app
# Real-time monitoring
pm2 monitnpm run dev
# Access http://localhost:3000After modifying code, rebuild and restart:
# 1. Rebuild
npm run build
# 2. Restart application
pm2 restart nextjs-app| Feature | Description |
|---|---|
| π Regular Logs | View system operation logs |
| View error messages | |
| π SOSRFF | SHM/SRF/SRA image viewer |
| π¦οΈ Weather Forecast | ECMWF weather forecast |
- Runtime: Production environment
- Process Manager: PM2 (auto-start configured)
- Web Server: Nginx (reverse proxy)
- Domain: https://www.yusteven.com
- Ports: 3000 (internal), 443 (HTTPS)
-
Local Development
npm run dev
-
Modify Code
- Edit components in
components/ - Modify pages in
app/
- Edit components in
-
Deploy to Production
npm run build pm2 restart nextjs-app
| Mode | Command | Hot Reload | Performance | Purpose |
|---|---|---|---|---|
| Development | npm run dev |
β | Slow | Local debugging |
| Production | pm2 start ecosystem.config.js |
β | Fast | Online runtime |
# 1. Check PM2 status
pm2 list
# 2. View logs
pm2 logs nextjs-app --lines 50
# 3. Restart application
pm2 restart nextjs-app# Rebuild (required!)
npm run build
# Restart application
pm2 restart nextjs-app# Check port usage
sudo lsof -i :3000
# Stop application
pm2 stop nextjs-app- PM2 Configuration:
ecosystem.config.js - Nginx Configuration:
/home/yusteven/html/default - PM2 Process List:
/home/yusteven/.pm2/dump.pm2
- Weather API: Port 3001
- Image API: Port 3002
Application is configured for automatic startup on boot:
# View auto-start configuration
pm2 startup
# Save current process list
pm2 save
# Disable auto-start
pm2 unstartup systemdβ Production Environment Running
- Framework: Next.js 16.0.1
- Version: 0.1.0
- Last Updated: 2025-11-12
Β© 2025 yusteven