Setup
If you only want to use Img2Num (e.g. via npm), see the relevant documentation from the links below instead.
This page explains how to build the project for development.
0. Before you begin
If you intend to contribute to Img2Num, fork the repository first and clone your fork instead of the main repository.
If you're only experimenting with the codebase or building the project locally, you can clone the main repository directly.
The complete contribution workflow is explained in the Pull Requests guide.
0.1. Prerequisites
- Git
- Docker Desktop (recommended) or Docker Engine
Verify Prerequisite Installations:
git --version
docker --version
We recommend using our prebuilt Docker dev environment. Setting up the environment locally adds unnecessary complexity, so we recommend against it.
If you choose to develop locally, you are responsible for configuring and maintaining your own environment.
0.2. Quick Start
This section will help you get started quickly so you don't have to read everything below.
Clone and setup
- Linux / macOS
- Windows CMD
- PowerShell
# Clone the repository
git clone https://github.com/<your-username>/Img2Num.git
cd Img2Num/
# Open Docker container
./img2num sh
# Initialize and build the project
just init
# Clone the repository
git clone https://github.com/<your-username>/Img2Num.git
cd Img2Num/
# Open Docker container
.\img2num.bat sh
# Initialize and build the project
just init
# Clone the repository
git clone https://github.com/<your-username>/Img2Num.git
cd Img2Num/
# Open Docker container
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
.\img2num.ps1 sh
# Initialize and build the project
just init
Test that everything works
See Test that everything works below.
See the other documentation
We recommend that you read the documentation below as well as the Docker Script and Just pages to understand how the development environment works.
1. Clone the repository
git clone https://github.com/<your-username>/Img2Num.git
cd Img2Num/
2. Start the dev container
The command below opens the Docker development container's Bash shell.
The img2num script manages the container.
- Linux / macOS
- Windows CMD
- PowerShell
./img2num sh
.\img2num.bat sh
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
After that, .\img2num.ps1 will work normally.
This only needs to be done once and allows locally created PowerShell scripts (like
img2num.ps1) to run without prompting again.
.\img2num.ps1 sh
See the Img2Num Docker Script page for more information about this.
3. Initialise and build everything
Img2Num uses Just to make it easier to manage the repository. It allows us to consolidate our scripting with a single tool.
The purpose of the command below is to give you a clean, working checkout. You won't need to use it again.
just init
As mentioned in Step 1 just init:
- Installs dependencies (shallow Git submodule pull,
pnpm install, etc.) - Compiles all code (C++, C, JavaScript, Python package, etc.) via
just build all.
See Img2Num's Just documentation page for more information.
4. Test that everything works
To test that you have built everything properly, we recommend running just build all from above
and testing each example app. You can find out how to use the example app on
our Just documentation page.
DONE!
Congrats! You're now good to go.
You'll probably want to check out one of these sections next, though:
- Building the project
- Cleaning the project
- What to do when you forget a command