This document provides detailed instructions for configuring the local server that powers the collaborative AR experience.
Before proceeding, ensure you are working within the correct Server directory:
CollabAR/
└── App/
├── Assets/
├── *Server/*
| ├── src/
| │ └── lib/
| │ ├── MatchMaking/
| │ ├── models/
| │ ├── Utils/
| │ ├── views/
| │ ├── database.ts
| │ ├── index.ts
| | └── Server.ts # Main server configuration file
| ├── package.json # Node.js dependencies
| ├── package-lock.json
| ├── tsconfig.json
| ├── .gitignore
| └── README.md
└── README.md
All commands in this guide must be executed from the CollabAR/Server/ directory unless otherwise specified.
After installation, verify that Node.js, npm, and MongoDB are properly added to your system PATH:
- Open Command Prompt
- Run the following commands:
node --version
npm --version
mongod --versionExpected output: Each command should return a version number (e.g., v24.14.1, v11.11.0, v8.2.6).
If any command fails ("not recognized as an internal or external command"):
- The software was not added to your PATH during installation
- You will need to add it manually or reinstall with the Add to PATH option selected
- Refer to the installation guides for PATH configuration instructions
MongoDB requires a dedicated directory to store database files:
-
By default, MongoDB looks for data at C:/data/db
-
From a Command Prompt create this directory manually:
mkdir C:\data\db- If you prefer a different location, you can specify it when starting MongoDB:
mongod --dbpath "D:\a\custom\path"Navigate to the server directory and install the required packages:
cd CollabAR/Server
npm installWhat this does:
- Reads the
package.jsonfile - Downloads and installs all required dependencies
- Creates the
node_modules/folder
First-time only: This command needs to be executed only once. You do not need to run it again unless:
- You pull a new version from the repository with updated dependencies
- You manually modify package.json
If you see warnings about outdated packages:
- npm may suggest updating specific packages
- You can safely update them if no breaking changes occur
- If issues persist, feel free to open a GitHub issue to request dependency updates
- Open a Command Prompt window
- Start the MongoDB service:
mongod- Keep this terminal open - closing it will terminate the database service
Successful startup: You should see a log message: "ctx":"initandlisten","msg":"mongod startup complete"
Optional: Install MongoDB Compass for a graphical interface to manage your databases.
- Open a second Command Prompt window
- Navigate to the server directory:
cd CollabAR/Server- Start the server:
npm startSuccessful startup: You should see the log message: "Waiting for connections..."
- Terminal 1: MongoDB service (
mongod) - Terminal 2: Node.js server (
npm start)
To stop the servers safely: Press Ctrl + C in each terminal.
To modify server behavior, edit src/Server.ts:
| Parameter | Description |
|---|---|
| PORT | Connection port (default: 8080) |
| USERS_PER_ROOM | Minimum clients required to start experience |
| databaseConfig | MongoDB connection settings |
After making changes, restart the server:
- Press
Ctrl + Cto stop - Run
npm startagain