Skip to content

334456777/myfirstnextapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

99 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌐 yusteven Monitoring System

Real-time system log and image viewer - Next.js version


πŸ“ Project Structure

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

πŸš€ Quick Start

1. Install Dependencies (first time)

npm install

2. Build Project

npm run build

3. Start Application

# Start with PM2
pm2 start ecosystem.config.js

# Check status
pm2 list

4. Access Website


πŸ”§ Common Commands

PM2 Process Management

# 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 monit

Development Mode (with hot reload)

npm run dev
# Access http://localhost:3000

πŸ”„ Update Code

After modifying code, rebuild and restart:

# 1. Rebuild
npm run build

# 2. Restart application
pm2 restart nextjs-app

πŸ“‹ Main Features

Feature Description
πŸ“‹ Regular Logs View system operation logs
⚠️ Error Logs View error messages
πŸ“œ SOSRFF SHM/SRF/SRA image viewer
🌦️ Weather Forecast ECMWF weather forecast

🌐 Deployment Information

  • Runtime: Production environment
  • Process Manager: PM2 (auto-start configured)
  • Web Server: Nginx (reverse proxy)
  • Domain: https://www.yusteven.com
  • Ports: 3000 (internal), 443 (HTTPS)

πŸ“ Development Notes

Development Workflow

  1. Local Development

    npm run dev
  2. Modify Code

    • Edit components in components/
    • Modify pages in app/
  3. Deploy to Production

    npm run build
    pm2 restart nextjs-app

Development vs Production

Mode Command Hot Reload Performance Purpose
Development npm run dev βœ… Slow Local debugging
Production pm2 start ecosystem.config.js ❌ Fast Online runtime

πŸ” Troubleshooting

Application Not Accessible

# 1. Check PM2 status
pm2 list

# 2. View logs
pm2 logs nextjs-app --lines 50

# 3. Restart application
pm2 restart nextjs-app

Code Changes Not Taking Effect

# Rebuild (required!)
npm run build

# Restart application
pm2 restart nextjs-app

Port Already in Use

# Check port usage
sudo lsof -i :3000

# Stop application
pm2 stop nextjs-app

πŸ“ž Help

Important Files

  • PM2 Configuration: ecosystem.config.js
  • Nginx Configuration: /home/yusteven/html/default
  • PM2 Process List: /home/yusteven/.pm2/dump.pm2

Backend Services

  • Weather API: Port 3001
  • Image API: Port 3002

PM2 Auto-Start

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

πŸ“Š Current Status

βœ… Production Environment Running

  • Framework: Next.js 16.0.1
  • Version: 0.1.0
  • Last Updated: 2025-11-12

Β© 2025 yusteven

About

Website Real-time monitoring dashboard for system logs and weather forecasts

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors