* ci(pre-commit): add pre-commit ci badge * ci(pre-commit ci): add eslint extra dependencies * test(server test): remove to short timeout from rest tests * ci(pre-commit ci): add eslint as dependenency * ci(circle ci): remove linting from circle ci since its moved to pre-commit ci
4.4 KiB
Speckle Server
Status
Disclaimer
We're working to stabilize the 2.0 API, and until then there will be breaking changes.
Documentation
Comprehensive developer and user documentation can be found in our:
📚 Speckle Docs website
Introduction
The Speckle Server is a node application tested against v12.
The external dependencies are PostgreSQL and Redis. To get the dependencies running without any hassle, you can run them in docker containers as described in our Server deployment instructions (chapter Run your speckle-server fork, step 1)
NOTE: If you install PostgreSQL yourself or use an existing PostgreSQL instance, make sure to create a database and a user that can access it
After you have PostgreSQL and Redis running, in the packages/server folder:
- copy the
.env-examplefile to.env, - (if you plan to run tests) copy the
.env.test-examplefile to.env.test - If you have a custom setup, open and edit the
.env&.env.testfiles, filling in the required variables, - run
npm install, - finally
npm run dev, - check
localhost:3000/graphqlout!
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:3000tolocalhost:8080. If you don't see anything, ensure you've runnpm run devin the frontend package. -
In production mode, the frontend is served by an
nginxcontainer that proxy server requests to the server (depending on the requested path). For more information about making a production deployment, check out our detailed guide
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
The Speckle Community hangs out on the forum, do join and introduce yourself & feel free to ask us questions!
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.