Giter VIP home page Giter VIP logo

enterstudio / forge-rcdb.nodejs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from autodesk-forge/forge-rcdb.nodejs

0.0 0.0 0.0 48.38 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/

License: MIT License

JavaScript 84.25% Shell 0.01% CSS 15.65% HTML 0.09%

forge-rcdb.nodejs's Introduction

Forge Responsive Connected Database

Node.js npm License

oAuth2 Data-Management OSS Model-Derivative

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 project is based on the cool React Redux Starter Kit

thumbnail

Prerequisites

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

Project Setup

In development, the client is dynamically built by the webpack-dev-middleware, so just run:

* `npm install`    *(downloads project dependencies locally)*

* `NODE_ENV=development HOT_RELOADING=true npm start`      *(builds client on the fly and run server)*

* open [http://localhost:3000](http://localhost:3000) in your favorite browser

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

* `npm install` *(not required if you already run at previous step)*

* `npm run build-prod && NODE_ENV=production npm start` *(builds client and run server)*

* open [http://localhost:3000](http://localhost:3000) in your favorite browser
  • To see your project open your browser http://localhost:3000

For database configuration, refer to config/

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 https://mlab.com. You can set up an account and run a DB with 500MB storage 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

Live Demo

https://forge-rcdb.autodesk.io

forge-rcdb

License

MIT License

Written by

Written by Philippe Leefsma

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

forge-rcdb.nodejs's People

Contributors

leefsmp avatar yaxian avatar cyrillef avatar kimekeunkyung avatar jaylimboonkiat avatar shiya avatar

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.