Book Image

Vue.js 2 and Bootstrap 4 Web Development

Book Image

Vue.js 2 and Bootstrap 4 Web Development

Overview of this book

In this book, we will build a full stack web application right from scratch up to its deployment. We will start by building a small introduction application and then proceed to the creation of a fully functional, dynamic responsive web application called ProFitOro. In this application, we will build a Pomodoro timer combined with office workouts. Besides the Pomodoro timer and ProFitOro workouts will enable authentication and collaborative content management. We will explore topics such as Vue reactive data binding, reusable components, routing, and Vuex store along with its state, actions, mutations, and getters. We will create Vue applications using both webpack and Nuxt.js templates while exploring cool hot Nuxt.js features such as code splitting and server-side rendering. We will use Jest to test this application, and we will even revive some trigonometry from our secondary school! While developing the app, you will go through the new grid system of Bootstrap 4 along with Vue.js’ directives. We will connect Vuex store to the Firebase real-time database, data storage, and authentication APIs and use this data later inside the application’s reactive components. Finally, we will quickly deploy our application using the Firebase hosting mechanism.
Table of Contents (19 chapters)
Vue.js 2 and Bootstrap 4 Web Development
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
Index

Preface

This book is about web development using Vue.js, Bootstrap, and Firebase. We will start with a simple tutorial, followed by the detailed explanation of it, and then, we will create a fully functional application from scratch. The application itself is a simple Pomodoro timer with integrated office workouts during the Pomodoro breaks. Throughout the book, you will go through the whole software development process, starting from the definition of requirements, user stories, and mockups, proceeding to the basic scaffolding, and followed by enriching the application with complex features such as authentication, routing, collaborative content, and finishing thorough testing and deployment. You will learn how to use Firebase to implement the authentication and storage for your Vue application and, in the end, how to deploy it. You will enjoy using Bootstrap along with your Vue application in order to easily implement complex components and achieve their responsiveness. You will revisit your trigonometry knowledge by having fun in using it with SVG and Vue.js to build a reactive timer component. So, technology-wise, we will cover as the following topics:

  • Vue.js data binding and single file components

  • Routing using vue-router

  • Server-side rendering and code splitting using nuxt.js

  • Testing with jest

  • Real-time databases with Firebase

  • Authentication using Firebase Authentication

  • Deployment using Firebase

  • Combining SVG, trigonometry, and Vue.js in reactive components

In the end, you will have your fully functional and fun Pomodoro application ready to use on a daily basis and to keep you fit at your workplace.

What this book covers

Chapter 1, Please Introduce Yourself, covers a tutorial that implements a "Hello, I am <name>" page. It uses Vue.js, combined with Bootstrap, for the basic form and Firebase for basic storage.

Chapter 2, Under the Hood - Tutorial Explained, explains the technologies used in the first chapter—Vue.js, Bootstrap, and Firebase. Not only does it cover each framework or service but it also explains how these tools can work together.

Chapter 3, Let's Get Started, describes what is going to be implemented during the course of the book. It describes the application and its requirements. It contains some user stories and defines the functionality of the application.

Chapter 4, Let It Pomodoro!, covers the bootstrapping phase of the Vue.js application using the Webpack loader. It adds the basic functionality to the Pomodoro timer. It also explains how to use Bootstrap's grid along with basic Vue.js directives.

Chapter 5, Configuring Your Pomodoro, enriches the application with configuration and personalization. It also covers data storage and retrieval mechanisms using the Firebase database and the Vuex state management architecture. It covers the usage of Bootstrap modals and forms along with the component system of Vue.js.

Chapter 6, Please Authenticate!, adds the authentication based on the Firebase auth API to the application. On the visualization layer, it explains how to build forms powered by Bootstrap.

Chapter 7, Adding a Menu and Routing Functionality Using vue-router and Nuxt.js, explains how to embed the navigation menu into the application using Bootstrap's elements and a routing functionality with the Vue router. It also describes how to use nuxt.js in order to achieve server-side rendering, code splitting, and routing in Vue applications.

Chapter 8, Let's Collaborate – Adding New Workouts Using Firebase Data Storage and Vue.js, adds collaborative content to the application. Again, it uses Bootstrap-powered forms, Vue.js to add reactivity to these forms, and Firebase to store the collaborative content.

Chapter 9, Test Test and Test, describes how to add unit and end-to-end tests to the Vue.js application.

Chapter 10, Deploying Using Firebase, covers the process of deployment of the application using the Firebase hosting solution.

What you need for this book

The requirements for this book are as follows:

  • A computer with an active internet connection

  • Text editor/IDE

  • Node.js

Who this book is for

This book is for web developers or for someone who wants to become one. You will build a full-stack web application from scratch until its deployment. Even if you are an experienced programmer, you will probably find something new for yourself. If you are working with Vue.js, you will find out how to connect a Vue.js application to the Google Firebase backend. If you work with Bootstrap, you will learn how nicely it plays along with a Vue.js application. If you already work with Vue.js, Bootstrap, and Firebase, you will find out how to leverage the power of these three things to easily build complex applications. If you already use these technologies together, you will have fun building yet another application during the course of this book.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: " Now run npm install inside the newly created directory "

A block of code is set as follows:

//LandingPage.vue
export default {
  components: {
    Logo,
    Authentication,
    GoToAppLink,
    Tagline
  }
}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

//LandingPage.vue
export default {
  components: {
    Logo,
    Authentication,
GoToAppLink,
    Tagline
  }
}

Any command-line input or output is written as follows:

# npm install sass-loader node-sass --save-dev

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Clicking the Next button moves you to the next screen."

Note

Warnings or important notes appear in a box like this.

Note

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

You can download the code files by following these steps:

  1. Log in or register to our website using your e-mail address and password.

  2. Hover the mouse pointer on the SUPPORT tab at the top.

  3. Click on Code Downloads & Errata.

  4. Enter the name of the book in the Search box.

  5. Select the book for which you're looking to download the code files.

  6. Choose from the drop-down menu where you purchased this book from.

  7. Click on Code Download.

You can also download the code files by clicking on the Code Files button on the book's webpage at the Packt Publishing website. This page can be accessed by entering the book's name in the Search box. Please note that you need to be logged in to your Packt account.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows

  • Zipeg / iZip / UnRarX for Mac

  • 7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Vue.js-2-and-Bootstrap-4-Web-Development. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/Vuejs2andBootstrap4WebDevelopment_ColorImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.