GithubHelp home page GithubHelp logo

autodesk-forge / forge-rcdb.nodejs Goto Github PK

View Code? Open in Web Editor NEW
271.0 35.0 178.0 51.14 MB

Forge Responsive Connected Database: A responsive React-based web application that showcases the use of Autodesk Forge Viewer and Forge web services ...

Home Page: https://forge-rcdb.autodesk.io/

JavaScript 84.37% CSS 0.78% HTML 0.04% SCSS 14.76% EJS 0.05%

forge-rcdb.nodejs's Introduction

Node.js npm Platforms License

Viewer React Redux Standard Build

Description

This is Forge Responsive Connected Database: A responsive React-based web application that showcases the use of Autodesk Forge Viewer and Forge web services, working in a connected environment with integrated data from multiple databases.

This sample uses Viewer v7, Babel v7, React v16, Redux v4, Bootstrap v3, jQuery v3, and Webpack v4, and serves as a reference sample for building Viewer apps with popular front end stacks like React/Bootstrap/Webpack etc. as well.

** If you are only interested in the extensions/plugins alone or would like to run this sample w/o MongoDB, see library-javascript-viewer-extensions **

thumbnail

Live Demo

https://forge-rcdb.autodesk.io

Prerequisites

To run these samples, you need your own Forge API credentials:

Project Setup

Download/Clone the Project

  • git clone <ProjectURL> --single-branch

MongoDB database

Install MongoDB, start an instance locally and create a database - we recommend to follow the tutorial here for detailed instructions.

Import the four data collections using the JSON files here to your database, we recommend to use MongoDB Compass or Studio3T as client tools for this task. See here and here for instructions to import data. Note: if you use MongoDB Compass to import the data you will need to minify the JSON objects into one lines otherwise the tool wouldn't be able to parse the JSON objects correctly

Make sure your database collections look like below:

   YourDatabase
   |
   |-------------rcdb.models
   |-------------rcdb.materials
   |-------------gallery.models
   |-------------configurator.models  

Once you are done, be sure to specify the connection string or in the configuration JSON file or as environment variables - see instructions in the next section for details.

If you would like run the sample w/o setting up MongoDB, see how to run the Extension Gallery as the backend in tips and tricks section later.

Environment Setup

Fill out the configuration JSON file here that matches your targeted environment mode (development or production).

For the production mode you can set up the below environment variables and will pick up.

  • RCDB_CONNECTION_STRING // Specify the MongoDB connection string here
  • RCDB_DBHOST //Specify the MongoDB host name
  • RCDB_DBNAME //Specify the MongoDB database name, leave empty if using connection string
  • RCDB_USER //Specify the MongoDB user name, leave empty if using connection string
  • RCDB_PASS //Specify the MongoDB password, leave empty if using connection string
  • RCDB_PORT //Specify the MongoDB host port, leave empty if using connection string

Client and Server

In development, the client is dynamically built by the webpack-dev-middleware and both the backend and client needs to run in parallel in separate sessions:

  • npm install (downloads project dependencies locally)
  • npm run dev or node ./src/server/dev.js (builds/runs server on the fly with or w/o monitoring code changes)
  • Start a new CLI session and run npm run serve (builds/runs client on the fly and monitors code changes)
  • navigate to http://localhost:8080

In production, the client requires a build step, so run:

  • npm install (not required if you already run at previous step)
  • npm run build (builds client)
  • npm start (run the server)
  • navigate to http://localhost:3000

References

  • Model Schema:
    {
      "_id" : "mongoDB Id",
      "urn" : "model URN",
      "name" : "Model name",
      "path" : "...path of local svf for dev env ...",
      "env" : "AutodeskProduction" || "Local",
      "materialCategories": ["Material"],
      "sequence" : [],
      "states" : [],
      "options" : {
      //extensions options
      },
      "thumbnail" : "... base64 encoded thumbnail ... "
    }
  • Material Schema:
    {
      "_id" : ObjectId("57ee6b26dfda94c109157449"),
      "name" : "Steel",
      "supplier" : "Autodesk",
      "currency" : "USD",
      "price" : 2.5
    }

An export of my database records is provided in /resources/db

Cloud Deployment

It may be a bit tricky to deploy that sample in the Cloud because it requires two steps in order to be run:

  • 1/ You need to translate at least one model using your own Forge credentials, so it can be loaded by your app. In order to do that take a look at the step-by-step tutorial from the Model Derivative API to understand exactly what this is about.

If you want to skip that manual process you can use one of our live sample: https://models.autodesk.io. This app lets you put your credentials and translate a model on your behalf. Another option would be to deploy to heroku the Forge boiler plate sample #5. Make sure you deploy Project #5. This set up is more straightforward since it doesn't require any Cloud database or pre-translated models. It will let you upload, translate and manage further models as well.

Once you have translated at least one model, take note of its URN, that's the base64 encoded objectId. You also need a model which has some "Material" properties to be compatible with forge-rcdb because it is expecting components with that property. You can use Engine.dwf placed in the resource/models directory of this project.

  • 2/ You need valid credentials to a MongoDB Cloud database that holds materials and models records. I suggest MongoDB Atlas or Compose MongoDB. With Atlas you can set up an account for free, that's way enough for running multiple samples. Creating the database, with one user, will give you the credentials you need: dbname, dbhost, user, password and dbport. Important: your database name needs to be "forge-rcdb", it is currently hardcoded in the sample, or you need to change that accordingly in the project config.

With those credentials you can use a tool such as http://3t.io/mongochef a mongoDB GUI which lets you easily connect remotely to the database from your machine in order to administrate it. With Mongochef you can easily import the two sample collections I placed in the resources/db directory

Import the two collections as 'rcdb.materials' and 'rcdb.models', then edit rcdb.model to replace the URN of your custom translated Engine.dwf model from step 1/

You should be ready to deploy to heroku, providing the same Forge credentials used to translate the model and valid credentials of the database when prompted for the environment settings.

Deploy

Tips and Tricks

How to run the sample without the trouble of setting up MongoDB?

Run the Gallery app from the Extension Library project, then start up a new CLI session and just run npm run serve to start the client app alone.

Why am I getting the error "Unexpected end of input JSON" when importing the data with MongoDB Compass?

You will need to minify the JSON objects into one lines otherwise the tool wouldn't be able to parse the JSON objects correctly. Alternatively use Studio3T to import the data instead.

What should I do if I get the error Module build failed: Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (64) when I tried to build the front end?

Rebuild node-ass with the command npm rebuild node-sass and build to production again.

Error: ENOENT: no such file or directory, scandir 'F:\Projects\forge-rcdb\node_modules\node-sass\vendor'

Run node ./node_modules/node-sass/scripts/install.js

Various errors when building modules with 'node-gyp' on Windows

Install Python ^2.7 and the build tools with npm install --global --production windows-build-tools

Starting the application in production hangs at "Cleaning Dir"?

The log output is misleading - actually it's your MongoDB Atlas Cluster taking time to pin up.

How should I migrate from mLab to MongoDB Atlas?

See here for their official guide. Also pull the latest changes from forge-rcdb and follow the instructions to set up your connection strings.

What connection string should I use for my MongoDB instance?

If you are using MongoDB version earlier than 3.4 (default version as this sample), use the sharded schema: mongodb://<username>:<password>@cluster0-shard-00-00-u9dtd.mongodb.net:27017,cluster0-shard-00-01-u9dtd.mongodb.net:27017,cluster0-shard-00-02-u9dtd.mongodb.net:27017/test?ssl=true&replicaSet=Cluster0-shard-0&authSource=admin&retryWrites=true

Otherwise go with the service schema which is much simpler: mongodb+srv://<username>:<password>@cluster0-u9dtd.mongodb.net/test?retryWrites=true

See here for details on connection string schema.

Written by

Forge Partner Development - http://forge.autodesk.com

forge-rcdb.nodejs's People

Contributors

augustogoncalves avatar cyrillef avatar dependabot[bot] avatar dukedhx avatar libvarun avatar vpavel04 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

forge-rcdb.nodejs's Issues

bundle.js:784 ReferenceError: Autodesk is not defined

I am getting this error on my browser console.
Also,
PS D:\W&W\forge-rcdb.nodejs-master> npm start

[email protected] start D:\W&W\forge-rcdb.nodejs-master
node bin/start.js

Server listening on PORT: 3000
ENV: undefined
Connected to MongoDB Database: forge-rcdb
Cleaning Dir: D:\W&W\forge-rcdb.nodejs-master\TMP
Socket connected: I-a50mUi9DJcHk95AAAA
why do I see this ENV:undefined. The app is not running, just a blank page with autodesk error in the console.
Please respond asap.
Thanks.

questions

Hi

Thanks,

I am an absolutely newbee of this , i have very limited Knowledge of Node JS, my first goal is two view the example on my local machine, i did every step according to the instruction, but only got a page header as forge RCDB and an empty page, there are some errors in the installation process, also errors from the build section. i am guessing do i need filling my autodesk forge app credentials to get this project running locally ? couse the final errors says mongobase errors and The client_id specified does not have access to the api product

could you please help me check the message in the CMD below ?


Child html-webpack-plugin for "index.html":
Asset Size Chunks Chunk Names
index.html 547 kB 0
Child worker:
Asset Size Chunks Chunk Names
ed09e033731a0e3eb521.worker.js 814 kB 0 [emitted] [big] main

[email protected] start C:\forge-rcdb.nodejs
node bin/start.js

Server listening on PORT: 3000
ENV: undefined
Unhandled Rejection at: Promise Promise {
{ developerMessage: 'The client_id specified does not have access to the api product',
userMessage: '',
errorCode: 'AUTH-001',
'more info': 'http://developer.api.autodesk.com/documentation/v1/errors/AUTH-001' } } reason: { developerMessage: 'The client_id specified does not have access to the api product',
userMessage: '',
errorCode: 'AUTH-001',
'more info': 'http://developer.api.autodesk.com/documentation/v1/errors/AUTH-001' }
Unhandled Rejection at: Promise Promise {
{ developerMessage: 'The client_id specified does not have access to the api product',
userMessage: '',
errorCode: 'AUTH-001',
'more info': 'http://developer.api.autodesk.com/documentation/v1/errors/AUTH-001' } } reason: { developerMessage: 'The client_id specified does not have access to the api product',
userMessage: '',
errorCode: 'AUTH-001',
'more info': 'http://developer.api.autodesk.com/documentation/v1/errors/AUTH-001' }
Unhandled Rejection at: Promise Promise {
{ MongoError: failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]
at Pool. (C:\forge-rcdb.nodejs\node_modules\mongodb-core\lib\topologies\server.js:336:35)
at emitOne (events.js:116:13)
at Pool.emit (events.js:211:7)
at Connection. (C:\forge-rcdb.nodejs\node_modules\mongodb-core\lib\connection\pool.js:280:12)
at Object.onceWrapper (events.js:317:30)
at emitTwo (events.js:126:13)
at Connection.emit (events.js:214:7)
at Socket. (C:\forge-rcdb.nodejs\node_modules\mongodb-core\lib\connection\connection.js:187:49)
at Object.onceWrapper (events.js:315:30)
at emitOne (events.js:116:13)
name: 'MongoError',
message: 'failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]' } } reason: { MongoError: failed to
connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]
at Pool. (C:\forge-rcdb.nodejs\node_modules\mongodb-core\lib\topologies\server.js:336:35)
at emitOne (events.js:116:13)
at Pool.emit (events.js:211:7)
at Connection. (C:\forge-rcdb.nodejs\node_modules\mongodb-core\lib\connection\pool.js:280:12)
at Object.onceWrapper (events.js:317:30)
at emitTwo (events.js:126:13)
at Connection.emit (events.js:214:7)
at Socket. (C:\forge-rcdb.nodejs\node_modules\mongodb-core\lib\connection\connection.js:187:49)
at Object.onceWrapper (events.js:315:30)
at emitOne (events.js:116:13)
name: 'MongoError',
message: 'failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]' }
uncaughtException
{ MongoError: failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]
at Pool. (C:\forge-rcdb.nodejs\node_modules\mongodb-core\lib\topologies\server.js:336:35)
at emitOne (events.js:116:13)
at Pool.emit (events.js:211:7)
at Connection. (C:\forge-rcdb.nodejs\node_modules\mongodb-core\lib\connection\pool.js:280:12)
at Object.onceWrapper (events.js:317:30)
at emitTwo (events.js:126:13)
at Connection.emit (events.js:214:7)
at Socket. (C:\forge-rcdb.nodejs\node_modules\mongodb-core\lib\connection\connection.js:187:49)
at Object.onceWrapper (events.js:315:30)
at emitOne (events.js:116:13)
name: 'MongoError',
message: 'failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]' }
MongoError: failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]
at Pool. (C:\forge-rcdb.nodejs\node_modules\mongodb-core\lib\topologies\server.js:336:35)
at emitOne (events.js:116:13)
at Pool.emit (events.js:211:7)
at Connection. (C:\forge-rcdb.nodejs\node_modules\mongodb-core\lib\connection\pool.js:280:12)
at Object.onceWrapper (events.js:317:30)
at emitTwo (events.js:126:13)
at Connection.emit (events.js:214:7)
at Socket. (C:\forge-rcdb.nodejs\node_modules\mongodb-core\lib\connection\connection.js:187:49)
at Object.onceWrapper (events.js:315:30)
at emitOne (events.js:116:13)
Cleaning Dir: C:\forge-rcdb.nodejs\TMP
Error: Not connected
at Promise (C:\forge-rcdb.nodejs\node_modules\connect-mongo\src\index.js:170:18)
at new Promise ()
at MongoStore.collectionReady (C:\forge-rcdb.nodejs\node_modules\connect-mongo\src\index.js:163:19)
at MongoStore.set (C:\forge-rcdb.nodejs\node_modules\connect-mongo\src\index.js:239:32)
at Session.save (C:\forge-rcdb.nodejs\node_modules\express-session\session\session.js:72:25)
at Session.save (C:\forge-rcdb.nodejs\node_modules\express-session\index.js:381:15)
at ServerResponse.end (C:\forge-rcdb.nodejs\node_modules\express-session\index.js:330:21)
at ReadStream.onend (_stream_readable.js:595:10)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)
Error: Not connected
at Promise (C:\forge-rcdb.nodejs\node_modules\connect-mongo\src\index.js:170:18)
at new Promise ()
at MongoStore.collectionReady (C:\forge-rcdb.nodejs\node_modules\connect-mongo\src\index.js:163:19)
at MongoStore.set (C:\forge-rcdb.nodejs\node_modules\connect-mongo\src\index.js:239:32)
at Session.save (C:\forge-rcdb.nodejs\node_modules\express-session\session\session.js:72:25)
at Session.save (C:\forge-rcdb.nodejs\node_modules\express-session\index.js:381:15)
at ServerResponse.end (C:\forge-rcdb.nodejs\node_modules\express-session\index.js:330:21)
at ReadStream.onend (_stream_readable.js:595:10)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)
Error: Not connected
at Promise (C:\forge-rcdb.nodejs\node_modules\connect-mongo\src\index.js:170:18)
at new Promise ()
at MongoStore.collectionReady (C:\forge-rcdb.nodejs\node_modules\connect-mongo\src\index.js:163:19)
at MongoStore.set (C:\forge-rcdb.nodejs\node_modules\connect-mongo\src\index.js:239:32)
at Session.save (C:\forge-rcdb.nodejs\node_modules\express-session\session\session.js:72:25)
at Session.save (C:\forge-rcdb.nodejs\node_modules\express-session\index.js:381:15)
at ServerResponse.end (C:\forge-rcdb.nodejs\node_modules\express-session\index.js:330:21)
at ReadStream.onend (_stream_readable.js:595:10)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)

Install instructions not working

HI Phillipe,

Thanks for the great work done on this app so far. I am in the process of trying to write a dockerize it so that I can easily deploy it to any infrastructure but first I am trying to deploy it locally.

I have followed your steps to build the app i.e clone, npm install I get nothing. npm run dev and npm run build-dev throws missing script errors.

So, I have setup mongo on my machine to listen on port 27017 and run npm start and I get a connection timed warning.

Can you help me get setup please?

GET / 404 on Heroku

Hello,

When I deploy to Heroku, a have the folling error:

Cannot GET /

The error on heroku log is:

2019-02-02T18:04:31.494157+00:00 heroku[router]: at=info method=GET path="/" host=bim-explorer.herokuapp.com request_id=03ffff27-6b39-4c13-8bbd-de1d76873ca7 fwd="170.254.135.152" dyno=web.1 connect=1ms service=1495ms status=404 bytes=641 protocol=https

My Procfile is:
web: npm run build-server && NODE_ENV=production npm start

And Heroku says that the deplay wass success.

how to set the Client ID and Client Secret for this project?

sorry, I am a total new guy,
when I started the server (no db connected), and the go to the "localhost:3000" in chrome.
I try to login , the the browser throw an error like this:
2017-09-29_1-33-42
I did applied the client ID for my app in the forge platform:
2017-09-29_1-34-45

My question is : where to set the client ID and Client Secret for the project with my personal forge key?

error after setup

HI Phillipe,
I try to use your great work.
The setup of the environment is really very very difficult.
I installed nodejs, gtk, python and mongodb.
After many errors and checks, npm start seems to be finally in place now
but when I launch the browser I only see the error:
Can not GET /
I searched the string "Can not GET" by enabling the match case in the whole source without finding it.
Can you help me please?
andrea

when npm start , there is erroor api_key is a required parameter

/Users/wangzheng/threejs/forge-rcdb.nodejs/node_modules/webpurify/dist/configuration.js:51
throw new Error('api_key is a required parameter');
^

Error: api_key is a required parameter
at Configuration.get api_key [as api_key] (/Users/wangzheng/threejs/forge-rcdb.nodejs/node_modules/webpurify/dist/configuration.js:51:13)
at Configuration.get config [as config] (/Users/wangzheng/threejs/forge-rcdb.nodejs/node_modules/webpurify/dist/configuration.js:38:23)
at new WebPurify (/Users/wangzheng/threejs/forge-rcdb.nodejs/node_modules/webpurify/dist/webpurify.js:23:34)
at module.exports (/Users/wangzheng/threejs/forge-rcdb.nodejs/src/server/api/endpoints/materials.js:40:14)
at Object. (/Users/wangzheng/threejs/forge-rcdb.nodejs/src/server/index.js:170:27)
at Module._compile (module.js:653:30)
at loader (/Users/wangzheng/threejs/forge-rcdb.nodejs/node_modules/babel-register/lib/node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (/Users/wangzheng/threejs/forge-rcdb.nodejs/node_modules/babel-register/lib/node.js:154:7)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)

npm start failed in windows 10

hello, all,
after a hard compiling with "npm install", I did finished it with obvious error
then I try to run with "npm start", it get failed , and report "Error: ENOENT: no such file or directory, scandir 'D:_h5_work\forge-rcdb.nodejs0927\dist' "

what is that "dist"?

**D:_h5_work\forge-rcdb.nodejs0927>npm start

[email protected] start D:_h5_work\forge-rcdb.nodejs0927
node bin/start.js

fs.js:953
return binding.readdir(pathModule._makeLong(path), options.encoding);
^

Error: ENOENT: no such file or directory, scandir 'D:_h5_work\forge-rcdb.nodejs0927\dist'
at Error (native)
at Object.fs.readdirSync (fs.js:953:18)
at findAllCompressionFiles (D:_h5_work\forge-rcdb.nodejs0927\node_modules\express-static-gzip\index.js:127:24)
at expressStaticGzip (D:_h5_work\forge-rcdb.nodejs0927\node_modules\express-static-gzip\index.js:28:9)
at Object. (D:/_h5_work/forge-rcdb.nodejs0927/src/server/index.js:230:11)
at Module._compile (module.js:570:32)
at loader (D:_h5_work\forge-rcdb.nodejs0927\node_modules\babel-register\lib\node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (D:_h5_work\forge-rcdb.nodejs0927\node_modules\babel-register\lib\node.js:154:7)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (D:_h5_work\forge-rcdb.nodejs0927\bin\start.js:24:3)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "D:\programfiles\nodejs\node.exe" "D:\programfiles\nodejs\node_modules\npm\bin\npm-cli.js" "start"
npm ERR! node v6.11.3
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node bin/start.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node bin/start.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the forge-rcdb package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node bin/start.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs forge-rcdb
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls forge-rcdb
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! D:_h5_work\forge-rcdb.nodejs0927\npm-debug.log

D:_h5_work\forge-rcdb.nodejs0927>**

setup in ubuntu failed

bro this is my steps:

Create my app:

pantallazo-0400

git clone https://github.com/Autodesk-Forge/forge-rcdb.nodejs.git

cd forge-rcdb.nodejs/

npm install

export NODE_ENV=development

sudo nano /home/felipe/forge-rcdb.nodejs/config/development.config.js

##
const PORT = 3012
##

sudo nano /home/felipe/forge-rcdb.nodejs/src/server/index.js

##
	const server = app.listen(
	  process.env.PORT || 3012, () => {
##

export FORGE_CLIENT_ID=ls......5R
export FORGE_CLIENT_SECRET=K........5

when compile show me this:

felipe@devpythonodejs:~/forge-rcdb.nodejs$ npm start

> [email protected] start /home/felipe/forge-rcdb.nodejs
> node bin/start.js

fs.js:953
  return binding.readdir(pathModule._makeLong(path), options.encoding);
				 ^

Error: ENOENT: no such file or directory, scandir '/home/felipe/forge-rcdb.nodejs/dist'
	at Error (native)
	at Object.fs.readdirSync (fs.js:953:18)
	at findAllCompressionFiles (/home/felipe/forge-rcdb.nodejs/node_modules/express-static-gzip/index.js:127:24)
	at expressStaticGzip (/home/felipe/forge-rcdb.nodejs/node_modules/express-static-gzip/index.js:28:9)
	at Object.<anonymous> (/home/felipe/forge-rcdb.nodejs/src/server/index.js:230:11)
	at Module._compile (module.js:570:32)
	at loader (/home/felipe/forge-rcdb.nodejs/node_modules/babel-register/lib/node.js:144:5)
	at Object.require.extensions.(anonymous function) [as .js] (/home/felipe/forge-rcdb.nodejs/node_modules/babel-register/lib/node.js:154:7)
	at Module.load (module.js:487:32)
	at tryModuleLoad (module.js:446:12)
	at Function.Module._load (module.js:438:3)
	at Module.require (module.js:497:17)
	at require (internal/module.js:20:19)
	at Object.<anonymous> (/home/felipe/forge-rcdb.nodejs/bin/start.js:24:3)
	at Module._compile (module.js:570:32)
	at Object.Module._extensions..js (module.js:579:10)

npm ERR! Linux 4.4.0-31-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! node v6.11.4
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `node bin/start.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node bin/start.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the forge-rcdb package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node bin/start.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs forge-rcdb
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls forge-rcdb
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/felipe/forge-rcdb.nodejs/npm-debug.log

show me how solve that issue

connect the db error ? in windows 10

hello, all,
I did startup the project with "npm run build-prod && npm start"
and I did startup the mongodb, and created the database according to ".\config\production.config.js"
the mongodb has no the authentication limitation. it runs like this
2017-09-29_1-29-22

but the system throws the error to connect the mongodb

====:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

[email protected] start D:_h5_work\forge-rcdb.nodejs0927
node bin/start.js

Server listening on PORT: 3000
ENV: undefined
uncaughtException
{ MongoError: failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]
at Pool. (D:_h5_work\forge-rcdb.nodejs0927\node_modules\mongodb-core\lib\topologies\server.js:336:35)
at emitOne (events.js:96:13)
at Pool.emit (events.js:188:7)
at Connection. (D:_h5_work\forge-rcdb.nodejs0927\node_modules\mongodb-core\lib\connection\pool.js:280:12)
at Connection.g (events.js:292:16)
at emitTwo (events.js:106:13)
at Connection.emit (events.js:191:7)
at Socket. (D:_h5_work\forge-rcdb.nodejs0927\node_modules\mongodb-core\lib\connection\connection.js:187:49)
at Socket.g (events.js:292:16)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at emitErrorNT (net.js:1277:8)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
name: 'MongoError',
message: 'failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]' }
MongoError: failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]
at Pool. (D:_h5_work\forge-rcdb.nodejs0927\node_modules\mongodb-core\lib\topologies\server.js:336:35)
at emitOne (events.js:96:13)
build [============= build [================= ] 86% (65.2 sec build [====================] 100% (173.6 seconds)
at Connection.g (events.js:292:16)

Error on connect

Hi! Nice work!

I am doing something wrong and I really want to figure it out. Here's my steps (in details):

  1. I downloaded the zipped forge-rcdb.nodejs-master and extracted it

  2. I opened the command line using Node.js command prompt and run npm install from this location

/c/users/tgrim/downloads/forge-rcdb.nodejs-master/forge-rcdb.nodejs-master

It runs the install and then it returns this error:

`

C:\Users\tgrim\Downloads\new1\new2\webpack>npm install
[email protected] install C:\Users\tgrim\Downloads\new1\new2\node_modules\canvas
node-gyp rebuild
C:\Users\tgrim\Downloads\new1\new2\node_modules\canvas>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack at PythonFinder. (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\tgrim\Downloads\new1\new2\node_modules\canvas
gyp ERR! node -v v8.2.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
[email protected] install C:\Users\tgrim\Downloads\new1\new2\node_modules\node-sass
node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-57_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-57_binding.node":
HTTP error 404 Not Found
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
npm config set proxy http://example.com:8080
[email protected] postinstall C:\Users\tgrim\Downloads\new1\new2\node_modules\node-sass
node scripts/build.js
Building: C:\Program Files\nodejs\node.exe C:\Users\tgrim\Downloads\new1\new2\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\Program Files\nodejs\node.exe',
gyp verb cli 'C:\Users\tgrim\Downloads\new1\new2\node_modules\node-gyp\bin\node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb which failed Error: not found: python2
gyp verb which failed at getNotFoundError (C:\Users\tgrim\Downloads\new1\new2\node_modules\which\which.js:13:12)
gyp verb which failed at F (C:\Users\tgrim\Downloads\new1\new2\node_modules\which\which.js:68:19)
gyp verb which failed at E (C:\Users\tgrim\Downloads\new1\new2\node_modules\which\which.js:80:29)
gyp verb which failed at C:\Users\tgrim\Downloads\new1\new2\node_modules\which\which.js:89:16
gyp verb which failed at C:\Users\tgrim\Downloads\new1\new2\node_modules\isexe\index.js:42:5
gyp verb which failed at C:\Users\tgrim\Downloads\new1\new2\node_modules\isexe\windows.js:36:5
gyp verb which failed at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb which failed python2 { Error: not found: python2
gyp verb which failed at getNotFoundError (C:\Users\tgrim\Downloads\new1\new2\node_modules\which\which.js:13:12)
gyp verb which failed at F (C:\Users\tgrim\Downloads\new1\new2\node_modules\which\which.js:68:19)
gyp verb which failed at E (C:\Users\tgrim\Downloads\new1\new2\node_modules\which\which.js:80:29)
gyp verb which failed at C:\Users\tgrim\Downloads\new1\new2\node_modules\which\which.js:89:16
gyp verb which failed at C:\Users\tgrim\Downloads\new1\new2\node_modules\isexe\index.js:42:5
gyp verb which failed at C:\Users\tgrim\Downloads\new1\new2\node_modules\isexe\windows.js:36:5
gyp verb which failed at FSReqWrap.oncomplete (fs.js:152:21) code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb which failed Error: not found: python
gyp verb which failed at getNotFoundError (C:\Users\tgrim\Downloads\new1\new2\node_modules\which\which.js:13:12)
gyp verb which failed at F (C:\Users\tgrim\Downloads\new1\new2\node_modules\which\which.js:68:19)
gyp verb which failed at E (C:\Users\tgrim\Downloads\new1\new2\node_modules\which\which.js:80:29)
gyp verb which failed at C:\Users\tgrim\Downloads\new1\new2\node_modules\which\which.js:89:16
gyp verb which failed at C:\Users\tgrim\Downloads\new1\new2\node_modules\isexe\index.js:42:5
gyp verb which failed at C:\Users\tgrim\Downloads\new1\new2\node_modules\isexe\windows.js:36:5
gyp verb which failed at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb which failed python { Error: not found: python
gyp verb which failed at getNotFoundError (C:\Users\tgrim\Downloads\new1\new2\node_modules\which\which.js:13:12)
gyp verb which failed at F (C:\Users\tgrim\Downloads\new1\new2\node_modules\which\which.js:68:19)
gyp verb which failed at E (C:\Users\tgrim\Downloads\new1\new2\node_modules\which\which.js:80:29)
gyp verb which failed at C:\Users\tgrim\Downloads\new1\new2\node_modules\which\which.js:89:16
gyp verb which failed at C:\Users\tgrim\Downloads\new1\new2\node_modules\isexe\index.js:42:5
gyp verb which failed at C:\Users\tgrim\Downloads\new1\new2\node_modules\isexe\windows.js:36:5
gyp verb which failed at FSReqWrap.oncomplete (fs.js:152:21) code: 'ENOENT' }
gyp verb could not find "python". checking python launcher
gyp verb could not find "python". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\Users\tgrim\Downloads\new1\new2\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack at PythonFinder. (C:\Users\tgrim\Downloads\new1\new2\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at C:\Users\tgrim\Downloads\new1\new2\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\tgrim\Downloads\new1\new2\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\tgrim\Downloads\new1\new2\node_modules\node-sass
gyp ERR! node -v v8.2.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\canvas):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: node-gyp rebuild
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\tgrim\AppData\Roaming\npm-cache_logs\2017-07-26T20_56_49_072Z-debug.log
`

I would highly appreciate if you would guide me a little if you see what I am doing wrong. There's many errors here but also some error including Python.. I think I really need some guiding.

Kind regards,

No access token is provided

When accesing the models the console gives the error:
"No access token is provided, but authorization requested. This is a problem."

But the viewer lets you continue viewing it. ¿Why?

In the code the accesstoken parameter is commented out.

const viewerEnv = await this.initialize({ useConsolidation: true, env: dbModel.env, // getAccessToken: function(onGetAccessToken) { // onGetAccessToken(accessToken, expireTimeSeconds) // } })

Not able to run on dev env

http://localhost:3000/
says
Cannot GET /

Console:
NODE_ENV=development npm start

node bin/start.js
Server listening on PORT: 3000
ENV: development
Connected to MongoDB Database: forge-rcdb
Cleaning Dir: /Users/aman/forgetest/forge-rcdb.nodejs/TMP

No error in console as well.

Cannot build on Windows

I built it in development mode successfully on MacOS. Now I tried to do it with same steps on Windows, by setting NODE_ENV=development and HOT_RELOADING=true, but it shows the following errors:

> [email protected] start D:\Documents\forge-rcdb.nodejs
> node bin/start.js

internal/modules/cjs/loader.js:583
    throw err;
    ^

Error: Cannot find module '../../config/developement.config.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (D:\Documents\forge-rcdb.nodejs\node_modules\c0nfig\index.js:10:14)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.require.extensions.(anonymous function) [as .js] (D:\Documents\forge-rcdb.nodejs\node_modules\babel-register\lib\node.js:152:7)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node bin/start.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\yangdihan\AppData\Roaming\npm-cache\_logs\2018-12-28T21_12_28_942Z-debug.log

Might this be a problem due to Windows is using back slash?

Forge and iot

Hi guys, i need some helps.
I need to understend the powers of forge and iot. So, where is the best way to take some measure from real building (es arduino that send data to database X) and allow viewer of forge to read this data?
I have for exemple a IFC model, is the ifc that shuld containe IFCSensora and DB source? My target is a project similar to this:

https://forge-rcdb.autodesk.io/configurator?id=58adee163e6f342cf1e92dae

1 - Where are defined the sensors dots?
2 - It's an IFC file that?
3 - Which db are supported?
4 - How can i link the dots with the source datastream?
5 - Ho can find more docs/example about this?

Thanks a lot!

Model load forever

dear Philippe,
I have a model in Revit2016 about 450MB I uploaded on my A360 and I am not able to visualize it here in RCDB. Also when I try to create New Scenes for VR/AR it keeps load forever, could you please point me in the right direction?!
Thanks a lot for your attention

Thumbnail urn?

I tried to use urn and base

Original:
urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YWRzay1tYXJyaW90dC9xdWVlbi5ydnQ/output/Resource/3D_View/_3D_ 22975074/_3D_2.png

Base64:
YWRzay52aWV3aW5nOmZzLmZpbGU6ZFhKdU9tRmtjMnN1YjJKcVpXTjBjenB2Y3k1dlltcGxZM1E2WVdSemF5MXRZWEp5YVc5MGRDOXhkV1ZsYmk1eWRuUS9vdXRwdXQvUmVzb3VyY2UvM0RfVmlldy9fM0RfIDIyOTc1MDc0L18zRF8yLnBuZw==

screen shot 2017-03-22 at 3 52 47 pm

Which urn should I be using?

npm i error

gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\mujtaba.ahmed\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:219:12)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\mujtaba.ahmed\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd D:\W&W\forge-rcdb.nodejs-master\node_modules\canvas
gyp ERR! node -v v6.11.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

I am constantly getting this error while doing npm install
Any help please respond ASAP

npm start failed in production mode

npm run build-prod ----> successfully
but npm start failed, the server say:

D:_h5_work\forge-rcdb.nodejs0927 ([email protected])
λ npm start

[email protected] start D:_h5_work\forge-rcdb.nodejs0927
node bin/start.js

module.js:471
throw err;
^

Error: Cannot find module './static'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (D:_h5_work\forge-rcdb.nodejs0927\bin\start.js:15:3)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "D:\programfiles\nodejs\node.exe" "D:\programfiles\nodejs\node_modules\npm\bin\npm-cli.js" "start"
npm ERR! node v6.11.3
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node bin/start.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node bin/start.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the forge-rcdb package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node bin/start.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs forge-rcdb
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls forge-rcdb
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! D:_h5_work\forge-rcdb.nodejs0927\npm-debug.log

What is static module?? there is no such a module in the source.
How to do?

Production error: No module './static'

I am trying to build and run this project in production env. I work on Windows Powershell, but the following commands:

npm run build-prod
 $env:NODE_ENV ="production"
npm start

but I got the following errors:

> node bin/start.js

internal/modules/cjs/loader.js:583
    throw err;
    ^

Error: Cannot find module './static'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (C:\Users\dyang\Documents\forge-rcdb.nodejs\bin\start.js:15:3)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node bin/start.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I tried to do
npm install node-static
but the error is still the same. Can someone help me with this? what is the ./static for?

Login

I open http://localhost:3000 in my browser and try to tap the button "Login".
After this a window opens for giving permissions to my ForgeApp ,.. I tap the button "Allow" there. But then nothing happens but I see the page http://localhost:3000 again. The button Login is still there which means I do not login by pressing it.

Could you tell, please, how to fix this?

DbIds to isolateFull

in:

Where does it gets the dbids data from?

I see the data prop is set like this:

But where is that data extracted from the model? Is there a {"property name" : dbid} map?

What is the difference between the instruction under the line

What is the difference between the instruction under the line "In development, the client is dynamically built by the webpack-dev-middleware, so just run:" and the instruction under the line "In production, should be done like everything that is written under the first instruction, and under the second, right? Thx

a certain model can't be downloaded , it model related?

hello, leefsmp

today, I can't download the villa model successfully shown as below. I think this model is uploaded by me (not sure, I did upload a similar villa model several days ago). maybe it contains some Chinese characters.
the other models seem OK to be downloaded.

2017-11-02_10-24-30

can you check that behavior? I did that in Edge and Chrome, and act the same.

ruixi

Markups disappear when zooming in

Hi,

There is an issue I have, which also happens on the live demo.
When you zoom too close to one or several marks, they are not rendered anymore.
In my own implementation, I don't use user interaction and use code to place marks inside a big building model. The marks disappear when I zoom too close to the building, which is long before I am inside near whatever objects are marked.

Is there any way to work around this ?

Live demo is down

The live demo for this project is down. It would be useful to help understand the source code if you could stand it up again

Dual Viewer extention

Hi @leefsmp ,

thank you for you demo! I have a doubt...

I'm new about Forge development so I followed some tutorials like these:

I understood (I hope :) ) the approach to devel a Viewer Application and how to use the API/SDK.

Now I would like to import in my Viewer Application your Dual Viewer Extention (link) that i saw in this demo and here.

I noticed the approach followed in the Forge tutorials are different from the Extentions that I find in the demos (forge-rcdb.nodejs).

PS I'm developing my App in nodejs/javascript/html.

Could you suggest me how to import that kind of extentions in a Viewer Application (as showed in the official Forge tutorials)?

Nicola

Cannot read property 'bgColorGradient' of undefined at a.setLightPreset

Windows 10 / Chrome Version 64.0.3282.119 (Official Build) (64-bit) / Node.js 9.4

The application starts without any errors but when I navigate to one of the pages which load the viewer the following error is thrown:

THREE.WebGLRenderer 71
Viewer.Configurator.js:802 Viewer Initialization Error:
Viewer.Configurator.js:803 TypeError: Cannot read property 'bgColorGradient' of undefined
at a.setLightPreset (https://developer.api.autodesk.com/derivativeservice/v2/viewers/viewer3D.min.js?v=3.3:23:24618)
at a.e.setLightPreset (https://developer.api.autodesk.com/derivativeservice/v2/viewers/viewer3D.min.js?v=3.3:30:13054)
at ViewerConfigurator._callee4$ (http://localhost:3000/3.js:4225:24)
at tryCatch (http://localhost:3000/bundle.js:76650:40)
at Generator.invoke [as _invoke] (http://localhost:3000/bundle.js:76884:22)
at Generator.prototype.(anonymous function) [as next] (http://localhost:3000/bundle.js:76702:21)
at step (http://localhost:3000/bundle.js:22882:30)
at http://localhost:3000/bundle.js:22900:14
at new Promise ()
at new F (http://localhost:3000/bundle.js:2078:28)
at ViewerConfigurator. (http://localhost:3000/bundle.js:22879:12)
at ViewerConfigurator.onViewerCreated (http://localhost:3000/3.js:4323:22)
at ViewerConfigurator.onViewerCreated (http://localhost:3000/bundle.js:55530:30)
at Object.onViewerCreated (http://localhost:3000/3.js:4420:19)
at Viewer.componentDidMount (http://localhost:3000/3.js:3125:20)
at Viewer.proxiedComponentDidMount (http://localhost:3000/bundle.js:55552:40)

On line 716 a reference to viewerTheme.lightPreset return undefined.
viewer.setLightPreset(viewerTheme.lightPreset)

I'm not seeing a lightPreset under appState.storage.theme.viewer - Should it be here?

lightpreseterror

My temporary workaround is to just test for null and allow the viewer to continuing loading:

if (viewerTheme.lightPreset) { viewer.setLightPreset(viewerTheme.lightPreset) }

In development.config.js I'm referencing viewer version 3.3 and and source code is from a new clone today.

viewer: {
  //viewer3D: '/resources/libs/lmv/viewer3D.js',
  viewer3D: 'https://developer.api.autodesk.com/derivativeservice/v2/viewers/viewer3D.min.js?v=3.3',

  //threeJS: '/resources/libs/lmv/three.js',
  threeJS: 'https://developer.api.autodesk.com/derivativeservice/v2/viewers/three.min.js?v=3.3',

  //style: '/resources/libs/lmv/style.css'
  style: 'https://developer.api.autodesk.com/derivativeservice/v2/viewers/style.min.css?v=3.3'
}

getting 401 unauthorized

getting 401 unauthorised error for endpoint
/modelderivative/v2/designdata/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bGVlZnNtcC1mb3JnZS9WOC5mM2Q%3D/manifest?domain=http%3A%2F%2Flocalhost%3A3000

unable to load models in UI. Any suggestions to resolve this error?

Don't know how to setup the project

HI
Thanks for creating this great project. I wanted to figure out how to use the various cool extensions in the project but failed in the first step... And I also want to know that if I setup correctly, will there be any samples with extensions in the configurator?


I downloaded and ran

npm install
set NODE_ENV=development
set HOT_RELOADING=true
set FORGE_DEV_CLIENT_SECRET=xxx
set FORGE_DEV_CLIENT_ID=xxx
npm start

But when I opened http://localhost:3000, it was empty (the UI appeared but there were no models) and the console showed:

Failed to load resource: the server responded with a status of 404 (Not Found) :3000/api/forge/user
or
GET http://localhost:3000/api/forge/user 404 (Not Found)

pic2


It had been like this.

pic3

I changed \config\development.config.js and loaded three.js, viewer3D.js and style.css. (I changed nothing else)
But I still couldn't setup the project.

Did I do anything wrong?

npm install Fails to install trianglify

I'm trying to build this project but I'm getting the following error:


> [email protected] postinstall /Users/rodrigo/Projects/forge-rcdb.nodejs/node_modules/trianglify
> node scripts/postinstall.js

nodejs 5.11.1 not installed
npm WARN @sucrase/[email protected] requires a peer of sucrase@^1.12.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-dom@^16.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/postinstall.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/rodrigo/.npm/_logs/2018-08-22T13_23_30_523Z-debug.log

I'm ignoring the message nodejs 5.11.1 not installed as I suppose this lib doesn't require this old version of node.

What are the required dependencies to get this project running?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.