Skip to main content

ClassCAD Server

Prerequisites#

ClassCAD application file (ccapp)#

Regardless of the host platform you use, you need the ClassCAD application package, the so-called class file (ccapp). This file contains the ClassCAD business logic. Without it you will not be able to start the ClassCAD server.

Go to the member area on this page and you will find the download links.

⚠️ The ccapp file contains personalised data and should therefore be treated confidentially. Please do not include it in the version management and do not pass it on to third parties.

Node and npm#

  • To install the ClassCAD binaries, npm must be installed.
  • To be able to run the server afterwards, node.js is required.

Recommendations#

The following system properties should be fulfilled in order for the server to operate properly.

  • >20GB disk space, ClassCAD requires disk memory for local, temporary states.
  • >2GB of memory per ClassCAD Instance
  • 1 CPU Core per ClassCAD Instance

Windows#

By running the following commands in a directory of your choice the required Windows binaries will be installed. Make sure your console window points to the intended working directory.

npm init -y
npm i @classcad/windows-x64

To test the installation please execute the following command in a terminal window and you should see the help message. The current working directory needs to be the root of your package.

npx classcad --help

Now, you're ready to start the ClassCAD Server. Make sure to provide the proper ccapp package path to the --ccappfile option. The path can be either relative to the package root or absolute.

npx classcad --ip localhost --port 9091 --instances 5 --ccappfile <PATH-TO-CCAPP-FILE>.ccapp

Check the status of the ClassCAD server.

http://localhost:9091/status

That's it, now you can connect your first client to the Windows server.

Linux#

We recommend using Docker to set up the server on Linux. If you still want to install ClassCAD directly on a Linux machine, please follow the instructions below.

We assume no liability for the following instructions. To use ClassCAD, additional packages must be installed via apt. You are responsible for ensuring that your system is not affected by this.

Ubuntu 20.04, 22.04 -- x64
# Install ClassCAD dependencies
apt install libarchive-dev libgomp1 libglu1-mesa-dev ocl-icd-opencl-dev curl
# Create the npm package
npm init -y
npm i @classcad/linux-x64
chmod +x node_modules/\@classcad/linux-x64/ClassCADInstance
npx classcad --ip 0.0.0.0 --port 9091 --instances 1 --ccappfile <PATH-TO-CCAPP-FILE>.ccapp

Ubuntu 20.04, 22.04 -- arm64
# Install ClassCAD dependencies
apt install libarchive-dev libgomp1 libglu1-mesa-dev ocl-icd-opencl-dev curl
# Create the npm package
npm init -y
npm i @classcad/linux-arm64
chmod +x node_modules/\@classcad/linux-arm64/ClassCADInstance
npx classcad --ip 0.0.0.0 --port 9091 --instances 1 --ccappfile <PATH-TO-CCAPP-FILE>.ccapp

@classcad/linux-arm64 does not support DXF/SVG export!

Mac OS#

Please use Docker and the package @classcad/linux-arm64 to get started.

Docker#

The following dockerfile gives you instructions about all steps needed to get a running ClassCAD server on Ubuntu.

Dockerfile Ubuntu 22.04
FROM ubuntu:22.04
RUN apt update
# Install linux dependencies
RUN apt install -y libarchive-dev libgomp1 libglu1-mesa-dev ocl-icd-opencl-dev curl
# Language settings
ENV LANG C
ENV LANGUAGE C
ENV LC_ALL C
# Install node and npm by using nvm
ENV NODE_VERSION v18.18.2
ENV NVM_DIR /usr/local/nvm
ENV NODE_PATH $NVM_DIR/$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/$NODE_VERSION/bin:$PATH
RUN mkdir $NVM_DIR
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
RUN echo "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION && nvm alias default $NODE_VERSION && nvm use default" | bash
# Install ClassCAD
RUN mkdir -p /classcad
WORKDIR /classcad
RUN npm init -y
RUN arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/x64/) && \
npm i "@classcad/linux-${arch}" && \
chmod +x "./node_modules/@classcad/linux-${arch}/ClassCADInstance"
# Copy the .ccapp downloaded from buerli.io.
# Replace <PATH-TO-CCAPP-FILE> with the path pointing to the downloaded .ccapp file.
COPY <PATH-TO-CCAPP-FILE>.ccapp modeling.ccapp
# Start the server
# In multi-user scenarios you can run multiple ClassCAD instances by setting the instances parameter
EXPOSE 9091/tcp
CMD npx classcad --ip 0.0.0.0 --port 9091 --instances 2 --ccappfile modeling.ccapp
  • Please do not forget to replace PATH-TO-CCAPP-FILE with the path to your downloaded class file.
  • Please do not forget to bind the port when starting the docker container
  • @classcad/linux-arm64 does not support DXF/SVG export!

Optionally you can use the following docker-compose file to start the ClassCAD server.

Docker-compose
version: "3.5"
services:
server:
build:
context: ./
dockerfile: dockerfile
image: classcad/server
container_name: classcad-server
tty: true
stdin_open: true
ports:
- 9091:9091
restart: unless-stopped

After starting a docker container with the docker file from above, the ClassCAD server should be online. Check the status of the ClassCAD server.

http://localhost:9091/status

That's it, now you can connect your first client to the docker container server.