Server
Status
Disclaimer
This is an early alpha release, not meant for use in production! We're working to stabilise the 2.0 API, and until then there will be breaking changes. You have been warned!
Introduction
This is the Speckle Server 2.0. It consists of two distinct parts:
- The server application itself, which is a nodejs app exposing a GraphQL API,
- The frontend application, which is a static vuejs app.
For example usage, do check out the tests! We'll be also adding preliminary documentation on our forum.
Developing and Debugging
To get started, first clone this repo.
Setup
Server
To run the Server in debug mode:
- Duplicate and rename
.env-exampleto.env& fill it in! - Make sure a postgres instance is running locally, with two databases present, named
speckle2_devandspeckle2_test(or whatever needed to match your .envPOSTGRES_URLvariable). - Make sure a redis instance is running locally.
- Run
npm install - Run
npm run dev:server🚀
Frontend
To run the Frontend locally in debug mode:
- Switch your working directory to
/frontend - Run
npm install - Run
npm run dev:frontendfrom the Server root folder, ornpm run servefrom/frontend.
To build the frontend, simply run npm run build:frontend.
Tips:
Postgres: For getting postgres, check out postgres.app, and the classic pgadmin.
Redis: you can use the redis.app.
Windows
Some extra tips if you come across issues on Windows:
Redis isn't officially supported for Windows, but you can get a slightly out of date version here which should work just fine.
For postgres, pgAdmin and Postbird are both good options for a GUI.
If starting up postgres isn't working, check your environment variables to make sure C:\Program Files\PostgreSQL\<version>\bin has been added to your system Path. You can also add variables PGUSER and PGPASSWORD here so you can skip logging in each time.
Make sure you're on node version 12 as newer versions of node may have problems connecting to the db.
Testing
The Server is quite thoroughly covered by tests. Once you have followed the setup steps above, you can run all the tests by hitting npm run test:server.
For testing specific functionality, check out the npm scripts in package.json - they are breaking down the tests piecemeal. When working on the Server, we've always found useful to run in watch mode only the tests pertaining to what we were working on (e.g., npm run test:server:objects).
Contributing
Please make sure you read the contribution guidelines for an overview of the best practices we try to follow.
When pushing commits to this repo, please follow the following guidelines:
- Install commitizen globally (
npm i -g commitizen). - When ready to commit, type in the commandline
git cz& follow the prompts. - Install eslint globally
npm i -g eslint - VS code: install the
eslintextension - VS code: we also recommend setting it to run on save by adding the following VS Code setting
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
Community
The Speckle Community hangs out in two main places, usually:
Do join and introduce yourself!
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.