Timothy Pomeroy 7b7c4f0ac9 Initial commit hace 1 mes
..
src 7b7c4f0ac9 Initial commit hace 1 mes
test 7b7c4f0ac9 Initial commit hace 1 mes
.prettierrc 7b7c4f0ac9 Initial commit hace 1 mes
README.md 7b7c4f0ac9 Initial commit hace 1 mes
eslint.config.mjs 7b7c4f0ac9 Initial commit hace 1 mes
nest-cli.json 7b7c4f0ac9 Initial commit hace 1 mes
package.json 7b7c4f0ac9 Initial commit hace 1 mes
tsconfig.build.json 7b7c4f0ac9 Initial commit hace 1 mes
tsconfig.json 7b7c4f0ac9 Initial commit hace 1 mes

README.md

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

<p align="center">

NPM Version Package License NPM Downloads CircleCI Discord Backers on Open Collective Sponsors on Open Collective Donate us

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

Follow us on Twitter

Centralized Configuration & Data

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.

WebSocket Support

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.

Events

The service emits the following WebSocket events:

  • taskUpdate: Emitted when task status changes
  • fileUpdate: Emitted when files are added, changed, or removed by the watcher
  • watcherUpdate: Emitted when the file watcher starts, stops, or encounters errors

Client Connection

Web 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);
});

Room Support

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.

Project setup

$ pnpm install

Compile and run the project

# development
$ pnpm run start

# watch mode
$ pnpm run start:dev

# production mode
$ pnpm run start:prod

Run tests

# unit tests
$ pnpm run test

# e2e tests
$ pnpm run test:e2e

# test coverage
$ pnpm run test:cov

Deployment

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.

Resources

Check out a few resources that may come in handy when working with NestJS:

  • Visit the NestJS Documentation to learn more about the framework.
  • For questions and support, please visit our Discord channel.
  • To dive deeper and get more hands-on experience, check out our official video courses.
  • Deploy your application to AWS with the help of NestJS Mau in just a few clicks.
  • Visualize your application graph and interact with the NestJS application in real-time using NestJS Devtools.
  • Need help with your project (part-time to full-time)? Check out our official enterprise support.
  • To stay in the loop and get updates, follow us on X and LinkedIn.
  • Looking for a job, or have a job to offer? Check out our official Jobs board.

Support

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.

Stay in touch

License

Nest is MIT licensed.

Watch Finished API Service

A modern NestJS API for managing files, settings, watcher, and tasks, all backed by a unified SQLite database.

API Overview

  • Base URL: http://localhost:3000
  • Authentication: None (local network only by default)

Main Endpoints

  • GET /files — List available datasets
  • POST /files/:dataset/:file — Create file record
  • POST /files/:dataset/:file/update — Update file record
  • GET /files/:dataset/:file — Get file record
  • DELETE /files/:dataset/:file — Delete file record
  • GET /files/:dataset/status/:status — List files by status
  • GET /files/:dataset/deleted-older-than/:isoDate — List deleted files older than date
  • POST /files/expire — Delete expired files
  • POST /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

Database Structure

  • settings: All config and datasets (JSON)
  • files: All file records
  • task: Task queue and progress

API Flow (MermaidJS)

flowchart TD
    A[Client (Web/CLI)] -->|REST| B(API Service)
    B -->|SQL| C[(SQLite database)]
    B --> D[Watcher]
    B --> E[HandBrake]
    B --> F[Maintenance]

Example: File CRUD

POST /files/movies/myfile.mp4
{
  "output": "output.mp4",
  "status": "success",
  "date": "2025-12-30T12:00:00Z"
}

Error Handling

  • All endpoints return JSON
  • 4xx for client errors, 5xx for server errors

See ../docs/README.md for full project documentation.