Speckle Server
Status
Disclaimer
We're working to stabilize the 2.0 API, and until then there will be breaking changes.
Introduction
The Speckle Server is a node application. To start it locally, simply:
- ensure you have a local instance of postgres & redis running
- create a postgres db called
speckle2_dev - then run
npm install - finally
npm run devwill start the server. - check
localhost:3000/graphqlout!
You can customise your local deployment by editing and filling in a .env file. To do so:
- copy the
.env-examplefile to.env - open and edit the
.envfile.
Developing
The server consists of several semi-related components, or modules. These can be found in /modules. Module composition:
- an
index.jsfile that exposes two functions,initandfinalize(mandatory) - a
graphfolder, with two subfolders, namelyresolversandschemas(optional - these will be picked up and merged).
Server & Apps
Frontend
-
In development mode, the Speckle Server will proxy the frontend from
localhost:8080tolocalhost:3000. If you don't see anything, ensure you've runnpm run devin the frontend package. -
In production mode, the Speckle Server will statically serve the frontend app from
../packages/frontend/dist.
GraphIQL
A GraphIQL app is available for authenticated api exploration at localhost:3000/explorer. Note that for the authentication flow to work, you need to have the frontend running first.
GraphQL Playground
For non-authenticated api exploration, you can use the Graphql Playground which is available by default at localhost:3000/graphql.
Testing
To run all tests, simply run npm run test. To run specific tests, use the mocha --grep @subset syntax. For example:
mocha --grep @auth --watchto run tests pertaning to the auth module only in watch mode.mocha --grep @core-streams --watchto run tests pertaining to stream related services.
Community
If in trouble, the Speckle Community hangs out in two main places, usually:
Do join and introduce yourself! We're happy to help.
License
Unless otherwise described, the code in this repository is licensed under the Apache-2.0 License. Please note that some modules, extensions or code herein might be otherwise licensed. This is indicated either in the root of the containing folder under a different license file, or in the respective file's header. If you have any questions, don't hesitate to get in touch with us via email.