- Prerequisites
- Understanding the directory structure
- Development Setup
- Local setup
- Other commands
- Contributing
Before you get started, please make sure you have the following setup -
- Node.js v18 (use nvm if already using a different Node version).
pnpm
npm i -g pnpm
- Python >=3.6 (But less than 3.10)
- Download and install the latest Python version.
- Run
npm config set python /path/to/executable/python
to configure.
- Install and set up node-gyp -
npm i -g node-gyp
to install.- For Windows, follow an additional step -
- Install Visual C++ 2017 Build Environment: Visual Studio Build Tools (using "Visual C++ build tools" workload) or Visual Studio Community (using the "Desktop development with C++" workload).
- For more details, please refer to the node-gyp documentation.
- Dependencies for MacOS
brew install pkg-config pixman cairo pango
- If you are using linux, run the following command to configure usb.
wget -q -O - https://raw.githubusercontent.com/Cypherock/cysync-scripts/main/configure-usb.sh | sudo bash
├── apps # Contains all the applications
│ └── desktop # CySync desktop application, contains all electron code
│ └── cli # CySync cli application
│
├── packages # All packages required for apps
│ └── ui # UI library for cysync containing all components
│ └── interfaces # Contains all `types` which needs to be shared between packages
│ └── desktop-ui # Renderer part of desktop application
│ └── coins # Static coin information
│ └── coin-support-* # Coin support functionalities
│ └── cysync-core # Contains all business logic of cysync, like pages,context etc
│ └── db-interfaces # Interface for `database`
│ └── database # Database implementation for electron
│ └── util-* # Common utilities shared between packages
│
├── submodules # Packages used by cysync but exist on different repository
│ └── sdk # SDK for communicating with Cypherock hardware
│
├── scripts # Contains scripts to be used by the build system
├── package.json
The repository contains submodules, which need to be downloaded as well. Clone the repository along with its submodules using -
git clone git@github.com:Cypherock/cypherock-cysync.git --recurse-submodules
Once you have cloned the repository, follow these steps -
pnpm i # Install packages
pnpm start # Start desktop application
pnpm start -s # Start desktop application with short log format
-
pnpm test
: Run all tests -
pnpm lint
: Lint all files -
pnpm pretty
: Prettify all files -
pnpm build:submodules
: Build submodules if you are changing them -
Desktop App
pnpm start
: Start desktop application (Hot reload enabled)pnpm make
: Created packaged desktop application
-
CLI App
pnpm dev:cli -- <ARGS>
: Run cli applicationpnpm make:cli
: Created packaged cli application- NOTE: You need to install
pkg
vianpm i -g pkg
before runningpnpm make:cli
- NOTE: You need to install
- Submodules are contains in
submodules
folder. - Submodules are packages which are used by
CySync
but are managed in a different repository. (Example:sdk
) - When you edit something in the
submodules
, you'll need to runpnpm build:submodues
to see the changes on cysync apps. - You may have to delete the
./apps/desktop/node_modules/.vite
folder if the changes does not reflect on cysync apps.
- Create a new file
.turbo/config.json
and add the following content -{ "teamid": "team_<TEAMID>", "apiurl": "<CACHE API URL>" }
- Set the
TURBO_TOKEN=yourToken
environment variable
Please consider making a contribution to the project. Contributions can include bug fixes, feature proposal, or optimizations to the current code.