Personal homeserver application built with NestJS and Angular.
This repository is organized as a small monorepo:
server/: NestJS backend API, business logic, Swagger generation, and server-side testsclient/: Angular frontend, generated API client, and UI assetsscripts/: root-level development helpers for running the stack and starting the local databasemock/: sample mounted content used by the app and Docker runs
The app is structured around a few core domains:
- authentication
- file browsing and uploads
- ebooks and Calibre integration
- torrent management
- settings and update flows
- health and status reporting
- Node.js version from
.nvmrc - npm
- MongoDB or Podman/Docker for a local database
Optional:
- Calibre, if ebook features are configured to use it
- Docker, for container builds and deployment
Install dependencies separately for the server and client:
cd server && npm install
cd ../client && npm install
cd ..npm run start:watchThis starts:
- the NestJS server in watch mode
- the Angular client build in watch mode
- Swagger regeneration and client API code generation after the server starts
npm run start:dbThis helper starts a MongoDB container using Podman and ports/volumes from the server config.
Backend:
cd server
npm run start:watchFrontend:
cd client
npm startBuild everything:
npm run buildBuild only the backend:
npm run build:serverBuild only the frontend:
npm run build:clientProduction build:
npm run build:prodServer tests:
cd server
npm testNote: run server tests outside the sandbox in this repository. Some e2e tests bind a local listener and can fail under sandbox restrictions with listen EPERM or null supertest port errors even when the tests are otherwise valid.
Build the container image:
npm run docker:buildRun the image locally:
npm run docker:startRun the image with Node inspector enabled:
npm run docker:debugTag and push manually for troubleshooting:
npm run docker:tag
npm run docker:pushOr use:
npm run deployGitHub Actions in .github/workflows/build.yml currently:
- installs dependencies for
server/andclient/ - builds the server
- builds the production client
- runs the server test suite
- audits production dependencies at the critical severity gate
Ordinary pushes do not publish or deploy an image. To release, dispatch the
Publish image workflow with the full reviewed master commit SHA. It repeats
tests, production builds, and audits before publishing immutable
sha-<commit> and latest tags. After publication succeeds, deploy that exact
revision from the host:
deploy/deploy-host.sh <full-commit-sha>The deploy helper validates and installs the tracked systemd unit, pulls the immutable image, restarts the service, checks the local HTTP root, verifies the running OCI revision, and attempts to restore the previous image digest if verification fails.
- The root scripts coordinate the two subprojects, but each app keeps its own
package.json. - The Angular client uses generated API bindings from the backend Swagger document.
- The root
startscript expects a built server entry file.