Book Image

Full Stack Web Development with Raspberry Pi 3

By : Soham Kamani
Book Image

Full Stack Web Development with Raspberry Pi 3

By: Soham Kamani

Overview of this book

Modern web technology and portable computing together have enabled huge advances in the Internet of Things (IoT) space,as well as in areas such as machine learning and big data. The Raspberry Pi is a very popular portable computer for running full stack web applications. This book will empower you to master this rapidly evolving technology to develop complex web applications and interfaces. This book starts by familiarizing you with the various components that make up the web development stack and that will integrate into your Raspberry Pi-powered web applications. It also introduces the Raspberry Pi computer and teach you how to get up and running with a brand new one. Next, this book introduces you to the different kinds of sensor you’ll use to make your applications; using these skills, you will be able to create full stack web applications and make them available to users via a web interface. Later, this book will also teach you how to build interactive web applications using JavaScript and HTML5 for the visual representation of sensor data. Finally, this book will teach you how to use a SQLite database to store and retrieve sensor data from multiple Raspberry Pi computers. By the end of this book you will be able to create complex full stack web applications on the Raspberry Pi 3 and will have improved your application’s performance and usability.
Table of Contents (13 chapters)
Getting Up-and-Running with Web Development on the Raspberry Pi

Setting up our Raspberry Pi

So far, we've been reading a lot of theory. Now let's actually get our Raspberry Pi working. Before we get started, here is a list of things you need at the bare minimum to get your Pi up-and-running:

  • The Raspberry Pi (duh)
  • An SD card (8 GB or higher)
  • A micro USB power source (many phone chargers are of this type so you might have one already)
  • A keyboard and mouse
  • Any screen or display with an HDMI port and cable
  • A laptop (optional)

Have everything? Awesome! Let's move on...

There are lots of operating systems and lots of ways to install them on the Pi. However, the easiest way by far is to use the official NOOBS installer. NOOBS, which stands for New Out Of Box Software, is the officially recommended way to install a fresh OS on the Pi for newcomers, and it's terribly easy.

Download the NOOBS archive from official website ( Once the archive is downloaded, unzip it into a new folder anywhere on your computer.

If you are using NOOBS v2.3.0, the directory structure, once you unzip the archive, should look like this:


Most of these files have no meaning to us except the INSTRUCTIONS-README.txt file. Open this file in any text editor (such as Notepad), and you will find instructions on how to format your SD card.

After formatting your SD card, transfer all these files and folders to the root directory of the SD card. As described in the instructions, all files and folders should be copied in such a way that the INSTRUCTIONS-README.txt file is at the root.

Once your SD card is ready and loaded, connect everything to your Pi:

  1. Insert the SD card into the slot.
  2. Using the HDMI cable, connect the HDMI port of the Pi with the external display.
  3. Connect the keyboard and mouse to the USB ports of the Pi
  4. Connect the power cable to the Micro USB port of the Pi

Once all the connections are made, switch on the power supply to your Pi. You should now see the monitor light up. After a few boot screens, you should see a friendly little GUI that will lead you to this:

It's here that you can select the OS you want in order to install to your Pi. For this book, we will be working with Raspbian.

Raspbian is a port of the Debian Linux OS, that has been optimized for the Pi. It is currently the most popular OS that runs on the Pi. Follow the installation wizard, and you should be done with the installation in a few minutes.

Once your installation is done, your Pi will boot into the OS, and you should now see a complete desktop on your monitor screen, something that looks like this:

Congratulations! You have successfully set up your Raspberry Pi computer. Amazingly, there are a lot of things you can do like you're using a regular desktop computer. The Raspberry Pi, along with the Raspbian OS, comes with a variety of programs, such as a text editor, a file explorer, and even an HTML5 web browser!