Getting a development version of Condict up and running is a slightly involved process. Keep in mind Condict is a work in progress, and many features are missing, including documentation.
- Node.js version 16 or higher with npm
- Yarn is not recommended for this project
- A working C++ compiler for building native modules
- node-gyp is installed as a dependency where needed – see its documentation for setup instructions
- On Windows, you must install Visual Studio Build Tools or a version of Visual Studio – version 2019 or later is strongly recommended
The @condict/server package relies on a few packages with native bindings, and contains a native package of its own. These must be rebuilt separately for Node and Electron. When running the server directly (or through @condict/http-server), you cannot start the app. When developing the app, you cannot start the server directly.
When you use npm run dev:server
or npm run dev:app
, the build scripts automatically recompile native dependencies for the correct platform if necessary.
If you're using Git, first run this in the repo root: git update-index --skip-worktree packages/*/dist/cli.js
These cli.js
files are provided so that subsequent commands work on Windows without any extra faff. They will be replaced when the respective packages are rebuilt, so we need to tell Git to ignore changes to them.
Run initial setup: npm run setup
This will install all dependencies, bootstrap packages with Lerna and build everything. It may take a few minutes.
- In the repo root, run
npm run dev:ui
- Open
http://localhost:3000
in a web browser for a component playground
Source files for the UI component playground are in dev/.
Note: If another process is listening on port 3000, this command will fail. Close the process that is listening on port 3000.
- In the repo root, run
npm run dev:server
- In a different terminal:
cd packages/http-server
- First time only:
cp config.json.example config.json
- Please edit
config.json
file if you wish to customize logging and the database location. npm start
When the server is running, a GraphQL sandbox will be accessible at http://localhost:4000
. If you have set a different port in the config, connect to that port instead of 4000.
Important: The GraphQL sandbox is not served locally. It's an embedded version of Apollo Sandbox. You must be connected to the internet to use it. If you do not wish to use it, you can query the server from any GraphQL client of your choice.
The server does not automatically reload on recompilation. You must restart it manually when you make changes. Additionally, if you edit the native code in src-cpp/, you must run npm run build:native
to recompile the native bindings.
npm run dev:app
- In a different terminal:
cd packages/app
npm start
The app does not automatically reload on recompilation. You must manually reload the server when you make changes (Ctrl+R or ⌘ Command+R).
Now you should have a Condict window. Have fun!
If these instructions don't work, that's considered a documentation bug. Please consider filing an issue to get help!