Skip to content

Instantly share code, notes, and snippets.

@BolajiAyodeji
Last active September 28, 2023 04:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BolajiAyodeji/43c93382879b475116c927e54dc618b1 to your computer and use it in GitHub Desktop.
Save BolajiAyodeji/43c93382879b475116c927e54dc618b1 to your computer and use it in GitHub Desktop.
Pre-workshop instructions / software requirements for React Alicante 2023 "Deploying Machine Learning Models to the Web" workshop attendees.

🛠 Prerequisites and Installation Guide

Generally, you need the following:

  • A curious mind and desire to learn.
  • An understanding of or familiarity with the first five phases of the CRISP-DM data-mining framework.
  • A working laptop running on any operating system (Windows, Linux, or macOS).
  • Ability to navigate through the command-line interface (CLI).
  • Some existing machine learning model development knowledge (or an interest at least).
  • Some basic understanding of the Python programming language.
  • Some basic understanding of the JavaScript programming language.
  • Experience using Reactjs and Nextjs frameworks.

To make the workshop a smooth process, we will use Google Colab for the machine learning model development. This will enable us to run a hosted Jupyter Notebook on the cloud (with GPU and TPU computing resources) and avoid issues with installing all the Python packages locally (the future is cloud!). All you have to do is create a free Google account if you don't have one already and open the Notebook in Google Colab.

But if you prefer local (I strongly advise against this; at least for this workshop), you should install Anancoda to use Jupyter Notebook on your local computer. You will need to install and import all the required packages yourself too and resolve any conflicts that might arise.

Note

Jupyter Notebooks allow you to combine executable code and rich text in a single document, along with images, HTML, LaTeX, and more.


You should have the following software and packages installed on your computer. Kindly follow the guide in each toggle to install them.

Git and GitHub

We will install/use the following packages:

  • Git: a free and open-sourced distributed version control system.
  • GitHub: a code hosting platform for version control and collaboration.

Download and install Git from this website for all operating systems or follow this installation guide.

Once installed successfully, confirm the version using the command:

git --version

Next, create a free GitHub account if you don't have one already.

[!NOTE]

Bonus: If you're a student, you should check out the GitHub Student Developer Pack, which gives students free access to the best developer tools (paid tools/services/courses for free) in one place so they can learn by doing.

Postman Desktop App or VSCode Extension

We will install any of the following:

Download and install the Postman Desktop Client or VSCode Extension from this website for all operating systems.

Python and PIP

We will install the following packages:

  • Python: a general-purpose programming language that lets you work quickly and integrate systems more effectively.
  • PIP: a package manager for installing Python packages or modules.

Download and install Python 3 (>3.10.12) from this website for all operating systems (this will come with PIP in-built).

[!IMPORTANT]

Please specifically download and install a version 3.10.12 or higher (I'm using 3.11.5). Google Colab will install version 3.10.12 which we will use to develope a machine learning model and anything less on your local machine will result in errors when using the serilized model.

Once installed successfully, confirm the version using the command:

python3 --version

If Python is installed correctly, you should have PIP installed. If it isn't, follow the steps in this guide to install PIP.

Other Python Packages

We will install the following packages:

  • Python Dotenv: a package that reads key-value pairs from a .env file and can set them as environment variables.
  • Scikit-Learn: a free software machine learning library for the Python programming language, including various classification, regression, and clustering algorithms.
  • Flask: a lightweight Python micro framework for building web applications.
  • Gunicorn: a Python WSGI HTTP Server for UNIX.

[!IMPORTANT]

Eventually, we will install the above mentioned libraries in a virtual environment to ensure we use independent groups of Python libraries for each project. This is a recommended practice when building Python aplications in both development and production.

In the project directory, create the environment with the command python3 -m venv .venv and activate the envirnment with the command source .venv/bin/activate.

Now, install all of the packages using the command below:

pip3 install python-dotenv scikit-learn flask gunicorn

Once installed successfully, confirm the version using the command:

pip3 show python-dotenv

pip3 show scikit-learn

pip3 show flask

pip3 show gunicorn
Nodejs and NPM

We will install the following packages:

  • Nodejs: an open-source, cross-platform JavaScript runtime environment.
  • NPM: a package manager for installing JavaSript packages or modules.

Download and install Nodejs and NPM from this website for all operating systems or follow this installation guide.

Once installed successfully, confirm the version using the command:

node --version

npm --version
Reactjs and Nextjs

We will install the following packages:

  • Reactjs: an open-source web and native JavaScript library for building user interfaces.
  • Nextjs: an open-source React web development framework.

Automatically create a project with the latest version of Reactjs18 and Nextjs13 using the create-next-app command below:

npx create-next-app@latest

Consider reading Reactjs's installation guide to learn more.

Flyctl and Vercel

We will install the following packages:

  • Flyctl: the command-line utility that lets you work on Fly from your terminal locally.
  • Vercel: a frontend cloud platform for deploying web apps.

Sign up for a free account on Fly.io and Vercel if you haven't yet. Next, read this guide to install flyctl for any operating system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment