Developing Multi-Platform Apps with Visual Studio Code

Book description

Redefine your software development experience by understanding the extensive features and rich functionalities offered by Visual Studio Code

Key Features

  • Leverage the power of the free, cross-platform, and highly customizable code editor to build modern web and cloud applications
  • Edit, debug and deploy on Microsoft Azure with Visual Studio Code
  • Learn how to customize features and install a wide variety of third-party extensions

Book Description

Microsoft Visual Studio Code is a powerful, lightweight code editor for modern web and cloud development. It is a source code editor that can be used with a variety of programming languages, which works on multiple platforms such as Linux, Windows, and macOS. This book provides extensive coverage of the tools, functionalities, and extensions available within the VS Code environment that will help you build multi-platform apps with ease.

You’ll start with the installation of VS Code and learn about various tools and features that are essential for development. Progressing through the chapters, you'll explore the user interface while understanding tips and tricks for increasing productivity. Next, you’ll delve into VS Code extensions and discover how they can make life easier for developers. Later, the book shows you how to develop a sample application with different programming languages, tools, and runtimes to display how VS code can be used effectively for development, before helping you get to grips with source code version management and deployment on Azure with VS Code. Finally, you’ll build on your skills by focusing on remote development with VS Code.

By the end of this book, you’ll have the knowledge you need to use Visual Studio Code as your primary tool for software development.

What you will learn

  • Explore various editing, formatting, and navigational features of VS Code
  • Understand how to add, delete, and configure extensions in VS Code
  • Develop web APIs using Node.js, Java, and Python in VS Code
  • Develop background service in .NET Core and explore Dapr
  • Delve into debugging techniques such as breakpoints, log points, and data inspection
  • Use Git with Azure DevOps to share and synchronize code with VS Code
  • Create custom extensions in VS Code to increase developer productivity
  • Understand the concepts of remote development using VS Code

Who this book is for

This book is for software developers, web developers and polyglot programmers, who are working with any language or framework such as Python, Java, Node.js, or .NET and are looking to learn how they can create multi-platform, microservices based, cloud-native applications while effectively using Visual Studio Code for editing, debugging, version management and deployment. Basic software development skills are a must to grasp the concepts covered in this book.

Table of contents

  1. Developing Multi-Platform Apps with Visual Studio Code
  2. Why subscribe?
  3. Contributors
  4. About the authors
  5. About the reviewer
  6. Packt is searching for authors like you
  7. Foreword
  8. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Download the color images
    6. Conventions used
    7. Get in touch
    8. Reviews
  9. Section 1: Introduction to Visual Studio Code
  10. Chapter 1: Getting Started with Visual Studio Code
    1. Discussing editors and IDEs
    2. Discussing basic features of VS Code
      1. Files and folders
      2. Workspace
      3. IntelliSense
      4. Tasks
      5. Debugging
      6. Version control
      7. Keyboard shortcuts
    3. Setting up VS Code
    4. Launching VS Code
      1. Setting up the command line for macOS
      2. Status Bar
      3. Quick Links
      4. Panel
      5. Integrated terminal
      6. Split Editor
      7. Command palette
      8. Themes
    5. Basic editing in VS Code
      1. Generating HTML
      2. Multi-cursor editing
      3. Code refactoring
      4. Snippets
    6. Editing and code navigation in VS Code
      1. Go to symbol
      2. Using commands for navigation
      3. Navigating between files
      4. Commenting code
    7. Summary
  11. Chapter 2: Extensions in Visual Studio Code
    1. Managing and configuring extensions
      1. Extension packs
      2. Installing extensions from VSIX
      3. Extension information
    2. Extension filters
      1. View commands to filter extensions
      2. Extension identifiers
      3. Filtering extensions using categories
      4. Creating a list for recommended extensions
    3. Client-side framework extensions
      1. Code snippet extensions for client-side frameworks
    4. Visual adjustment extensions
      1. Shades of Purple
      2. Linux Themes for VS Code
      3. C/C++ Themes
    5. Productivity extensions
      1. Visual Studio IntelliCode
      2. Live Share
      3. Prettier
    6. Summary
  12. Section 2: Developing Microservices-Based Applications in Visual Studio Code
  13. Chapter 3: Building a Multi-Platform Backend Using Visual Studio Code
    1. Technical requirements
    2. Overview of our application architecture
    3. Brief introduction to Azure platform services
      1. Resource group and resources
      2. Creating an Azure resource group
      3. Creating Azure Cosmos DB's API for Mongo DB
      4. Creating the database collections
      5. Creating a new Express.JS API project in VS Code
    4. Building a schedule API in Java using VS Code
      1. Creating a new Java Spring Boot API project in VS Code
    5. Building a notification API in Python using VS Code
    6. Summary
  14. Chapter 4: Building a Service in .NET Core and Exploring Dapr
    1. Azure Event Hubs with Kafka
      1. What is Kafka?
      2. Creating Azure Event Hubs
    2. Building a background service in .NET Core using VS Code
      1. Creating a new .NET Core project in VS Code
      2. Creating a consumer to listen for Kafka events
      3. Creating a hosted service for job requests
      4. Creating a hosted service for notifications
      5. Adding a hosted service to the Startup class
      6. Writing Producer in the NodeJS API to publish messages to Kafka
      7. Writing Producer in the Java API to publish messages to Kafka
      8. Dapr building blocks
      9. Core components of Dapr
      10. Configuring the Dapr environment
      11. Service invocation with Dapr
      12. Pub/sub communication with Dapr
    3. Summary
  15. Chapter 5: Building a Web-Based Frontend Application with Angular
    1. Technical requirements
      1. Installing Node.js
      2. Installing the Angular CLI
    2. A quick overview of Angular
    3. Designing our application
    4. Creating and running the Angular app project
      1. Generating the app using the CLI
      2. Looking at the CLI-generated files
      3. Running the app using the CLI
    5. Adding styling with Bootstrap
      1. Installing the Bootstrap and jQuery packages
      2. Adding the CSS and JS files to the Angular project
    6. Creating the landing page
      1. Generating the HomeComponent
      2. Setting the application's default route path
      3. Creating the navigation bar
      4. Designing and styling the home page
    7. Creating the feature modules
      1. Creating the login feature
      2. Creating the authorization service
      3. Creating the job request feature
      4. Creating the agent feature
    8. Processing routes with authorization guard
      1. Creating a job request guard
      2. Creating the agent guard
    9. Summary
  16. Chapter 6: Debugging Techniques
    1. Becoming familiar with the debugger layout
    2. Debugging the Angular app
      1. Installing the debugger for Chrome
      2. Discussing the launch configuration
      3. Running the debugger
    3. Debugging features of VS Code
      1. Exploring breakpoints
      2. Exploring navigation features
      3. Inspecting data with the variables feature
      4. Looking at the CALL STACK
      5. Exploring logpoints
      6. Debugging with split screen
    4. Debugging the Node.js API
      1. Creating the launch configuration
      2. Attaching the debugger
    5. Debugging the Java API
    6. Debugging the Python API
    7. Debugging .NET Core
    8. Summary
  17. Chapter 7: Deploying Applications on Azure
    1. Technical requirements
      1. Installing Docker
      2. Installing the Kubernetes CLI
    2. Why containers?
    3. Docker containers
    4. Building Docker images
      1. Building a Docker image for the Job Request Service
      2. Building a Docker image for the Schedule Job Service
      3. Building a Docker image for the Notifications Service
      4. Building a Docker image for the Hosted Service
      5. Building a Docker image for the JOS Web App
    5. Setting up a private container registry in Azure
    6. Deploying images to Azure Kubernetes Service
      1. Kubernetes terminology
      2. Kubernetes cluster representation
      3. Azure Kubernetes Service (AKS)
      4. Creating AKS using VS Code
      5. Deploying tagged images from the ACR to AKS
    7. Summary
  18. Chapter 8: Git and Azure DevOps
    1. Technical requirements
    2. Version-control overview
    3. Introduction to Git
      1. Initializing the Git repository
      2. Staging files
      3. Committing files
      4. Pushing changes to the remote repository
    4. Creating repositories in Azure DevOps
    5. Using Git with VS Code
    6. Branching and merging
      1. Some practices of using branches
    7. Branching in VS Code and Azure DevOps
    8. Automating build and deployment using CI/CD
      1. Creating a CI pipeline in Azure DevOps
      2. Creating a CD pipeline in Azure DevOps
    9. Summary
  19. Section 3: Advanced Topics on Visual Studio Code
  20. Chapter 9: Creating Custom Extensions in Visual Studio Code
    1. Technical requirements
    2. Creating a new extension
      1. Generating the extension project
      2. Discussing the extension configuration
      3. Developing the extension
      4. Categorizing commands
      5. Adding the Open Folder command
      6. Taking user input
    3. Creating the Kubernetes objects extension
      1. Generating the code snippet extension project for K8s objects
      2. Creating the code snippet for K8s Deployment and Service objects
    4. Creating the theme extension
      1. Generating the theme extension project
      2. Creating the theme
    5. Summary
  21. Chapter 10: Remote Development in Visual Studio Code
    1. Understanding remote development in VS Code
    2. Setting up remote development in VS Code
    3. Using the Remote – SSH extension
    4. Using the Remote – Containers extension
    5. Using the Remote – WSL extension
      1. Installing and configuring .NET Core on Ubuntu
    6. GitHub Codespaces
    7. Summary
  22. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: Developing Multi-Platform Apps with Visual Studio Code
  • Author(s): Ovais Mehboob Ahmed Khan, Khusro Habib
  • Release date: September 2020
  • Publisher(s): Packt Publishing
  • ISBN: 9781838822934