fix pm2 and readme

This commit is contained in:
eewing
2026-02-02 21:58:53 +00:00
parent e36ae92441
commit a2e58b4292
3 changed files with 306 additions and 30 deletions
+51 -12
View File
@@ -1,20 +1,59 @@
# 🚀 TasGrid Server Management
## 🚀 Getting Started
This project uses **PM2** (via Bun) to stay online 24/7. The app runs on port `4000` and is managed by the scripts in `package.json`.
This project uses **Bun** as the package manager and runtime. Ensure you have Bun and PM2 installed globally before proceeding.
## 🛠 Quick Commands
### Development
| Action | Command | Description |
| :--- | :--- | :--- |
| **Check Status** | `bun status` | See if the site is online/how much memory it's using. |
| **Update Site** | `bun run deploy` | Pulls latest code, builds, and restarts the server. |
| **Stop Server** | `bun stop` | Shuts down the site (use for maintenance). |
| **View Logs** | `bun logs` | See real-time errors or console output (Ctrl+C to exit). |
To spin up the development server with Hot Module Replacement (HMR):
## 🔄 Deployment Workflow
To push new changes live, simply run:
```bash
bun deploy
bun run dev
```
> The dev server runs on `port 4001` and is accessible across your local network via `0.0.0.0`.
### Production Build
To type-check the project and compile it for production:
```bash
bun run build
```
---
## 🏗️ Deployment & PM2 Management
We use **PM2** to manage the production process, ensuring the application stays online and restarts automatically if it crashes.
| Command | Description |
| --- | --- |
| `bun run start-prod` | Launches the production preview via PM2 under the name **tasgrid**. |
| `bun run status` | View the status of the running PM2 processes. |
| `bun run logs` | Tail the live logs for the **tasgrid** process. |
| `bun run stop` | Stops the production process. |
| `bun run deploy` | **Full Cycle:** Pulls latest code, builds, and restarts the process. |
### Quick Deploy
If you have updated the code on your server, simply run:
```bash
bun run deploy
```
---
## 🛠️ Port Reference
* **Development:** `4001`
* **Production (Preview):** `4000`
---