Add integration info to docs
This commit is contained in:
13
docs/docs/general-cadhub/integrations.mdx
Normal file
13
docs/docs/general-cadhub/integrations.mdx
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
title: Integrations
|
||||
---
|
||||
|
||||
In order for CadHub to be able to host multiple different Cad packages (OpenSCAD, CadQuery, JSCAD etc) we have to keep the IDE architecture agnostic, which is achieved by adding a light wrapper to each package to force it to have uniform inputs and ouputs, namely it's expected to take code and optionally customizer values as inputs and to return a 3d-artifact, logs and optionally customizer params. Here's how it interact with the IDE visually.
|
||||
|
||||

|
||||
|
||||
## Wrapper entry points
|
||||
The entry points of the wrappers are in `app/web/src/helpers/cadPackages/<package-name>/<package-name>Controller.tsx` it's this typescript file that is responsible for enforcing the uniform inputs and outputs, but within the file it's able to do whatever it needs todo, i.e. spin up a worker in the case of JSCAD or make a server call in the case of OpenSCAD and CadQuery. The file should export a render function and in order to help with the inputs and outputs for those looking to add a new integration, there is `demoController.ts` as an example and typing for the render function.
|
||||
|
||||
## ServerSide Packages
|
||||
OpenSCAD and CaqQuery packages by using each of the packages respective CLIs deployed with docker on AWS's container lambdas using the serverless framework, the endpoint that these deployments make is what the wrappers above send requests to. For more information as to how this is setup see [this readme](https://github.com/Irev-Dev/cadhub/tree/main/app/api/src/docker).
|
||||
@@ -29,6 +29,7 @@ module.exports = {
|
||||
},
|
||||
'general-cadhub/external-resource-url',
|
||||
'general-cadhub/openscad-previews',
|
||||
'general-cadhub/openscad-fonts'
|
||||
'general-cadhub/openscad-fonts',
|
||||
'general-cadhub/integrations',
|
||||
],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user