NextCP/2 is a web-based UPnP control point written in Java and Typescript.
Documentation is available at GitHub Pages.
- Download prebuild binaries from the release page (JAR files) and put them in a directory with write permissions.
- start the application (with optional more memory by adding "-Xms256m -Xmx512m")
java [-Xms256m -Xmx512m] -jar [-DconfigFile=path_to_config_file] nextcp2.jar
If no config file is given or found, a config-file will be generated next to the JAR file on the first startup. In this case the application might complain about incorrect or missing (default) configuration items. In this case adopt the config to your system by navigating to `App setting' and restart the application.
- minimum JDK 17
- maven 3.8
- yarn
- GIT client
- Web browser needs support for server-sent-events. Current Chromium based browser should work.
Call ./build_dependencies.sh script for installing dependent libraries from source into local maven repository.
For manual installation clone the following repositories :
git clone https://github.com/sf666/musicbrainz.git- call
build.sh
Build artifacts are located in the build directory.
! The frontend has to be packaged before the backend is build.cd frontend/nextcp-ui
./ng buildUI will be build into the backend folder : backend/nextcp2-runtime/src/main/resources/static
! Since this directory contains generated content, do not add it to the repository.cd backend/
mvn clean
mvn install
mvn packageBuild artifacts are located in the maven target directories.
- The runnable application jar is build in the module
backend/nextcp2-assembly/target - Device Driver are build in the modules below
backend/nextcp2-device-driver
After a successful build, the main application build artifact will be located here backend/nextcp2-assembly/target
This device driver controls (bi-directional) a McIntosh device connected to a RS232/TCP-IP transceiver like this on: USR-TCP232-302.
Current implemented features:
- power control
- volume control
- input source control
After a successful build, the device driver (tested with McIntosh MA9000 and MA12000 amplifier) is located here: backend/nextcp2-device-driver/nextcp2-ma9000/target/.
To run the snapshot call :
java -Xms256m -Xmx512m -jar [-DconfigFile=path_to_config_file] nextcp2.jarBy default the application will start on the current interface on port 8085.
Open your browser and connect to the application:
http://localhost:8085
If nextcp runs on a server or remote machine, replace localhost by the IP address of your device.
The application tries to load the config file from the following locations in this order:
- file provided by system-property 'configFile'
- file located '/etc/nextcp2/nextcp2Config.json'
- file located 'USER_HOME/nextcp2Config.json'
- file located 'WORK_DIR/nextcp2Config.json'
If no config file is found, a config file will be generated at this location : WORK_DIR/nextcp2Config.json.
For debugging within an IDE start the backend first. The main Spring-Boot startup class is
backend/nextcp2-assembly/src/main/java/nextcp/NextcpApplicationStartup
For having a frontend build, yarn has to be installed in the build environment.
To start the front-end in Visual Studio Code switch to TERMINAL, change into the directory nextcp2/frontend/nextcp-ui and start the front-end by typing
yarn start -c dev
Launch your favorite chromium browser from the Visual Studio Code debug perspective.
Generatied classes are located in the package codegen within the maven module nextcp2-codegen.
DTOs for Java and Typescript are generated to keep data exchange between the rest and SSE interface (Java) consistent with the consuming Typescript code.
The class DtoModelGen generates Java-DTO classes configured by the file dto.yaml located in the resource folder src/main/resources/yaml.
This file has many elements of
[CLASS_NAME]:
[PROPERTY]: [TYPE]
Call DtoModelGen each time you modify the yaml file. Generate the file into the maven project nextcp2-modelgen in the package nextcp.dto by pointing to this absolute path as first parameter.
! ATTENTION: Never modify the generated DTOs files since changes to them will be overwritten by the next call to the generator.After generating Java DTOs, Typescript DTO's are automatically generated by the maven build process.
To manually start the Typescript DTO generation, enter the maven project nextcp2-modelgen and call mvn process-classes.
Typescript DTO's will be generated in the file nextcp-ui/src/app/service/dto.d.ts.
! ATTENTION: Never modify the generated DTO file since changes will be overwritten by the next maven build.If activated in the configuration file, java code (service classes, input and output classes, event consumer) will be generated for all discovered UPnP services. The generated code uses jupnp as UPnP stack.