|
|
1 月之前 | |
|---|---|---|
| .. | ||
| src | 1 月之前 | |
| test | 1 月之前 | |
| .prettierrc | 1 月之前 | |
| README.md | 1 月之前 | |
| eslint.config.mjs | 1 月之前 | |
| nest-cli.json | 1 月之前 | |
| package.json | 1 月之前 | |
| tsconfig.build.json | 1 月之前 | |
| tsconfig.json | 1 月之前 | |
A progressive Node.js framework for building efficient and scalable server-side applications.
<p align="center">
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
This service uses a single SQLite database for all settings and configuration, located at:
<repo-root>/data/config.db
All persistent settings, file records, and configuration are stored in this database. This ensures a single source of truth for the backend API, CLI, and web apps.
If you move or rename the database, update the path in src/db.service.ts and any other relevant locations.
This service includes WebSocket support for real-time communication with the web interface. The WebSocket server runs on the same port as the HTTP server.
The service emits the following WebSocket events:
taskUpdate: Emitted when task status changesfileUpdate: Emitted when files are added, changed, or removed by the watcherwatcherUpdate: Emitted when the file watcher starts, stops, or encounters errorsWeb clients can connect using Socket.IO client:
import { io } from 'socket.io-client';
const socket = io('http://localhost:3000');
// Listen for events
socket.on('fileUpdate', (data) => {
console.log('File update:', data);
});
socket.on('watcherUpdate', (data) => {
console.log('Watcher update:', data);
});
Clients can join/leave rooms for targeted messaging:
// Join a room
socket.emit('join', { room: 'dashboard' });
// Leave a room
socket.emit('leave', { room: 'dashboard' });
Nest framework TypeScript starter repository.
$ pnpm install
# development
$ pnpm run start
# watch mode
$ pnpm run start:dev
# production mode
$ pnpm run start:prod
# unit tests
$ pnpm run test
# e2e tests
$ pnpm run test:e2e
# test coverage
$ pnpm run test:cov
When you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the deployment documentation for more information.
If you are looking for a cloud-based platform to deploy your NestJS application, check out Mau, our official platform for deploying NestJS applications on AWS. Mau makes deployment straightforward and fast, requiring just a few simple steps:
$ pnpm install -g @nestjs/mau
$ mau deploy
With Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure.
Check out a few resources that may come in handy when working with NestJS:
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
Nest is MIT licensed.
A modern NestJS API for managing files, settings, watcher, and tasks, all backed by a unified SQLite database.
http://localhost:3000GET /files — List available datasetsPOST /files/:dataset/:file — Create file recordPOST /files/:dataset/:file/update — Update file recordGET /files/:dataset/:file — Get file recordDELETE /files/:dataset/:file — Delete file recordGET /files/:dataset/status/:status — List files by statusGET /files/:dataset/deleted-older-than/:isoDate — List deleted files older than datePOST /files/expire — Delete expired filesPOST /files/migrate — Migrate legacy JSON to SQLite
GET /config/settings — Get all settings
GET /config/settings?key=... — Get setting by key
POST /config/settings — Update setting
DELETE /config/settings/:key — Delete setting
GET /watcher/status — Get watcher status
POST /watcher/start — Start watcher
POST /watcher/stop — Stop watcher
GET /tasks — List tasks
POST /tasks — Create task
DELETE /tasks/:id — Delete task
GET / — API root
GET /ready — Readiness probe
GET /health — Health check
flowchart TD
A[Client (Web/CLI)] -->|REST| B(API Service)
B -->|SQL| C[(SQLite database)]
B --> D[Watcher]
B --> E[HandBrake]
B --> F[Maintenance]
POST /files/movies/myfile.mp4
{
"output": "output.mp4",
"status": "success",
"date": "2025-12-30T12:00:00Z"
}
See ../docs/README.md for full project documentation.