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 for deployment:
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
- builds and pushes the container image on
master
- 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.