Skip to main content

πŸš€ Getting Started

Getting Started​

This section covers how to run the application for the first time - from installation to first run.

Requirements​

tip

We highly recommend that you consider both options below (the Docker route and the local route) in case you run into problems at a later stage.

The Docker route is the fastest and easiest to set up, so you should definitely start with that!

Before you start installing anything, make sure you have the below installed.

  • Git: Used to download the code and make contributions.

Installing Docker​

The section below will guide you through installing Docker on your operating system.

  1. Install a POSIX environment

    We highly recommend using WSL2.

    While Docker Desktop can run without it, WSL2 gives a much smoother experience and works best with the POSIX-oriented scripts in Img2Num. WSL, in general, is much faster than Hyper-V is with Docker.

    Run This in Powershell
    wsl --install

    This will install Ubuntu by default. You can use other distributions if you prefer. See Microsoft's documentation to find out more about installing WSL.

  2. Download and install Docker Desktop from https://www.docker.com/products/docker-desktop.

    During installation, make sure:

    • "Use WSL2 instead of Hyper-V" is selected.
    • Your preferred Linux distribution (e.g., Ubuntu) is enabled.
  3. Verify the installation in your WSL terminal or Git Bash:

    docker --version
    docker compose version
Docker not working?

Make sure to keep Docker Desktop open while you're using Docker because it needs to be open to run containers.

Cloning the repository​

This step will guide you through downloading (cloning) the repository's code into a folder, named Img2Num.

Clone the repository into a folder named Img2Num
# Clone the repository into a folder named `Img2Num`
git clone https://github.com/Ryan-Millard/Img2Num.git

Installing dependencies​

This section will help you install all the required dependencies.

You can choose to only install the dependencies for one portion of the app, but it is recommended that you install the dependencies for both if you want all the functionality.

Your Current Working Directory Matters!

In order to call the img2num script that we will be using for Docker in the following sections, you need to stay in the root directory of the project since that is where the file is.

For Experienced Docker users

You can skip using the img2num script if you prefer using plain Docker commands - the script is intended to help developers who don't want to use Docker directly.

It is recommended that you read the contents of the file for examples of the commands you can use.

Install all dependencies
cd Img2Num
chmod +x ./img2num
./img2num npm install

./img2num npm install --prefix ./docs
info
Try passing -h or --help as an argument to see the list of available script arguments
./img2num -h    # or --help (they are are the same)

Docs Search (Algolia DocSearch)​

The documentation site ships with Algolia DocSearch already configured. You do not need Algolia credentials to run the docs locally. If you do not provide credentials, the search box will be inactive in local development, which is expected.

info

You can ignore this feature as it only affects production builds.

Environment variables (.env.example)​

The docs site includes a docs/.env.example file to document the optional Algolia environment variables. For local development, you can safely leave these values blank, and you should never commit real secrets to the repository.

Running the app for the first time​

This section will help you run both the main application and the documentation site for the first time.

From the project's root, run:

Concurrently run both the Vite development and Docs servers
./img2num dev:all
tip

You can always run ./img2num -h or ./img2num --help to see a full list of available commands and scripts.

It is a wrapper script that allows you to use scripts defined in package.json and docs/package.json.

Further Information​

You may want to have a look at the Project Scripts section now, but make sure that you understand and agree with Img2Num's License and guidelines first.