Files
termi-blog/README.md
limitcool 92a85eef20 feat: Refactor service management scripts to use a unified dev script
- Added package.json to manage development scripts.
- Updated restart-services.ps1 to call the new dev script for starting services.
- Refactored start-admin.ps1, start-backend.ps1, start-frontend.ps1, and start-mcp.ps1 to utilize the dev script for starting respective services.
- Enhanced stop-services.ps1 to improve process termination logic by matching command patterns.
2026-03-29 21:36:13 +08:00

122 lines
2.1 KiB
Markdown

# termi-blog
Monorepo for the Termi blog system.
## Structure
```text
.
├─ admin/ # React + shadcn admin workspace
├─ frontend/ # Astro blog frontend
├─ backend/ # Loco.rs backend APIs and legacy Tera admin
├─ mcp-server/ # Streamable HTTP MCP server for articles/categories/tags
├─ .codex/ # Codex workspace config
└─ .vscode/ # Editor workspace config
```
## Run
### Recommended
From the repository root:
```powershell
npm run dev
```
This starts `frontend + admin + backend` in a single Windows Terminal window with multiple tabs.
Common shortcuts:
```powershell
npm run dev:mcp
npm run dev:frontend
npm run dev:admin
npm run dev:backend
npm run dev:mcp-only
npm run stop
npm run restart
```
### PowerShell entrypoint
If you prefer direct scripts, use the single root entrypoint:
```powershell
.\dev.ps1
.\dev.ps1 -WithMcp
.\dev.ps1 -Only frontend
.\dev.ps1 -Only admin
.\dev.ps1 -Only backend
.\dev.ps1 -Only mcp
```
If you want a single service to be opened as a new Windows Terminal tab instead of running in the current shell:
```powershell
.\dev.ps1 -Only frontend -Spawn
```
Legacy aliases are still available and now just forward to `dev.ps1`:
```powershell
.\start-frontend.ps1
.\start-backend.ps1
.\start-admin.ps1
.\start-mcp.ps1
```
### Frontend
```powershell
cd frontend
npm install
npm run dev
```
### Admin
```powershell
cd admin
npm install
npm run dev
```
### Backend
```powershell
cd backend
$env:DATABASE_URL="postgres://postgres:postgres%402025%21@10.0.0.2:5432/termi-api_development"
cargo loco start 2>&1
```
### MCP Server
```powershell
.\dev.ps1 -Only mcp
```
Default MCP endpoint:
```text
http://127.0.0.1:5151/mcp
```
Default local development API key:
```text
termi-mcp-local-dev-key
```
The MCP server wraps real backend APIs for:
- Listing, reading, creating, updating, and deleting Markdown posts
- Listing, creating, updating, and deleting categories
- Listing, creating, updating, and deleting tags
- Reading and updating public site settings
- Rebuilding the AI index
## Repo Name
Recommended repository name: `termi-blog`