Skip to content

Commit

Permalink
Merge pull request #122 from digisomni-syndicate/vircadia_metaverse_v2
Browse files Browse the repository at this point in the history
Merge in-progress v2 to master.
  • Loading branch information
digisomni authored Jan 26, 2024
2 parents 42c7486 + f6b76aa commit 321a9d6
Show file tree
Hide file tree
Showing 459 changed files with 53,872 additions and 39 deletions.
28 changes: 4 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,10 @@
# Iamus

## ⚠️ New version incoming ⚠️
### This version of Iamus is depracated and will soon be replaced.
***We are in the middle of development and a version transition! Here's the [new version](https://github.com/digisomni-syndicate/vircadia-metaverse/tree/vircadia_metaverse_v2/vircadia_metaverse_v2_api) if you want to try it before it is released. Use at your own risk!***
Metaverse server for [Vircadia], implemented with [NodeJS]/[ExpressJS]/[FeathersJS]/[TypeScript].
This supports the basic inter-domain operations for a [Vircadia] open source metaverse project: accounts, servers, etc.

Metaverse server for [Vircadia Project] implemented in [NodeJS]/[ExpressJS]/[TypeScript].
This supports the basic inter-domain operations for a
[Vircadia Project] grid: accounts, etc.

For building, refer to [Building](docs/Building.md).

For how the metaverser-server fits in with the other services,
refer to [Notes On Development](docs/NotesOnDevelopment.md).

For some notes on internal structure of the Iamus metaverse-server, refer to
[Design](docs/Design.md).

For running a metaverse-server as a Docker image, refer to [Running A Docker Image](docs/RunningDockerImage.md).

## The Name

The original metaverse-server project is named "Project Apollo".
"Iamus" is one of the Greek god Apollo's many sons.
See https://en.wikipedia.org/wiki/Iamus .

[Vircadia Project]: https://vircadia.com/
[Vircadia]: https://vircadia.com/
[NodeJS]: https://nodejs.org/
[ExpressJS]: https://expressjs.com/
[FeathersJS]: https://feathersjs.com/
[TypeScript]: https://www.typescriptlang.org/
2,197 changes: 2,187 additions & 10 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"name": "iamus-metaverse-server",
"version": "2.4.10",
"name": "vircadia-metaverse-server",
"version": "3.0.0",
"private": true,
"description": "metaverse-server for Vircadia",
"author": "Robert Adams <[email protected]>",
"description": "Metaverse server for Vircadia. (Project Iamus)",
"repository": {
"type": "git",
"url": "https://github.com/vircadia/Iamus"
Expand All @@ -14,7 +13,8 @@
"homepage": "https://github.com/vircadia/Iamus",
"keywords": [
"Vircadia",
"virtual world"
"virtual world",
"open source metaverse"
],
"license": "Apache-2.0",
"main": "dist/index.js",
Expand Down Expand Up @@ -55,6 +55,7 @@
"morgan": "~1.9.1",
"multer": "^1.4.2",
"nodemailer": "^6.6.0",
"ts-eager": "^2.0.2",
"unique-names-generator": "^4.5.0",
"uuid": "^8.3.2",
"winston": "^3.3.3"
Expand Down
4 changes: 4 additions & 0 deletions vircadia_metaverse_v2_api/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
./node_modules
Dockerfile
.dokerignore
docker-compose.yml
13 changes: 13 additions & 0 deletions vircadia_metaverse_v2_api/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
end_of_line = crlf
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions vircadia_metaverse_v2_api/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blockchain
24 changes: 24 additions & 0 deletions vircadia_metaverse_v2_api/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"root": true,
"env": {
"es6": true,
"node": true,
"jest": true
},
"parserOptions": {
"parser": "@typescript-eslint/parser",
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"extends": ["plugin:@typescript-eslint/recommended"],
"rules": {
"indent": ["error", 4, { "SwitchCase": 1 }],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "single"],
"semi": ["error", "always"],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-empty-interface": "off"
}
}

116 changes: 116 additions & 0 deletions vircadia_metaverse_v2_api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# Commenting this out is preferred by some people, see
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
node_modules

# Users Environment Variables
.lock-wscript

# IDEs and editors (shamelessly copied from @angular/cli's .gitignore)
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### OSX ###
*.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

# Others
lib/
data/

.env.local
package-lock.json
goobie/temp/
3 changes: 3 additions & 0 deletions vircadia_metaverse_v2_api/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
5 changes: 5 additions & 0 deletions vircadia_metaverse_v2_api/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"prettier.singleQuote": true,
"files.insertFinalNewline": false
}

14 changes: 14 additions & 0 deletions vircadia_metaverse_v2_api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM ubuntu:latest
ENV DEBIAN_FRONTEND noninteractive
WORKDIR /usr/src/api
RUN apt-get update -yq \
&& apt-get install curl gnupg -yq \
&& curl -sL https://deb.nodesource.com/setup_18.x | bash \
&& apt-get install nodejs -yq

RUN apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev

COPY ./ ./
RUN npm install

CMD ["npm","run","start"]
93 changes: 93 additions & 0 deletions vircadia_metaverse_v2_api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# vircadia-metaverse-v2


## Getting Started

Getting up and running is easy.

1. Make sure you have [NodeJS](https://nodejs.org/) and [npm](https://www.npmjs.com/) installed.

2. Install docker (https://docs.docker.com/engine/install)

3. Go to the project root path
```
cd path/to/vircadia-metaverse-v2
```
4. Install etherium dlt dependencies
```
cd ethereum/dlt/
npm install
cd ..
```
5. open `conf.d/vircadia_conf.conf` file and change `server_name`
6. Copy env file
```
cp env.default .env
```
7. Open .env file
- Change following env params SERVER_HOST,
METAVERSE_SERVER_URL,
DEFAULT_ICE_SERVER_URL,
DASHBOARD_URL,
APP_LOGO,
APP_URL,
SMTP_USER,
SMTP_PASS,
SMTP_EMAIL_FROM etc...
- Blockchain params
MINTER_PRIVATE_KEY,
ETH_RPC_URL
8. Run Following docker commands for deploy into docker (Same commands for redeploy)
```
docker compose build
docker compose up -d
```
9. Run Following command for stop docker (Optional)
```
docker compose down
```
10. Remove docker cached images (Optional)
```
docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
```
## Testing
Run `npm test` and all your tests in the `test/` directory will be run.
*Note: DLT is not a required component for the metaverse.*
Spin up a test chain:
`npm run localchain`
## Scaffolding
Feathers has a powerful command line interface. Here are a few things it can do:
```
$ npm install -g @feathersjs/cli # Install Feathers CLI

$ feathers generate service # Generate a new Service
$ feathers generate hook # Generate a new Hook
$ feathers help # Show all commands
```
## Generate Doc
```
npx typedoc expand ./src/services/**/*.class.ts
```
31 changes: 31 additions & 0 deletions vircadia_metaverse_v2_api/build_scripts/createVersion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

const fse = require('fs-extra');
var gitVer = require('child_process').execSync('git rev-parse --short HEAD').toString().trim();
var gitVerFull = require('child_process').execSync('git rev-parse HEAD').toString().trim();
var packageVersion = process.env.npm_package_version;
const filePath = './lib/metaverse_info.json';

console.log('Found package version', packageVersion);
console.log('Found Git commit short hash', gitVer);
console.log('Found Git commit long hash', gitVerFull);

function yyyymmdd() {
var x = new Date();
var y = x.getFullYear().toString();
var m = (x.getMonth() + 1).toString();
var d = x.getDate().toString();
(d.length == 1) && (d = '0' + d);
(m.length == 1) && (m = '0' + m);
var yyyymmdd = y + m + d;
return yyyymmdd;
}

var jsonToWrite = {
npm_package_version: packageVersion,
git_commit: gitVerFull,
version_tag: (packageVersion + '-' + yyyymmdd() + '-' + gitVer)
};

jsonToWrite = JSON.stringify(jsonToWrite);

var attemptFileWrite = fse.outputFileSync(filePath, jsonToWrite);
Loading

0 comments on commit 321a9d6

Please sign in to comment.