Hands-On Full Stack Web Development with Angular 6 and Laravel 5
eBook - ePub

Hands-On Full Stack Web Development with Angular 6 and Laravel 5

Become fluent in both frontend and backend web development with Docker, Angular and Laravel

Fernando Monteiro

Compartir libro
  1. 420 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Hands-On Full Stack Web Development with Angular 6 and Laravel 5

Become fluent in both frontend and backend web development with Docker, Angular and Laravel

Fernando Monteiro

Detalles del libro
Vista previa del libro
Índice
Citas

Información del libro

Build modern, fast, and progressive web applications using modern features of PHP 7 and TypeScript

Key Features

  • Explore the latest features of Angular and Laravel to build applications that are powerful, consistent, and maintainable
  • Develop modern user interfaces with a reusable component-based architecture using Angular 6 and Bootstrap 4
  • Learn how to build secure backend APIs with Laravel

Book Description

Angular, considered as one of the most popular and powerful frontend frameworks, has undergone a major overhaul to embrace emerging web technologies so that developers can build cutting-edge web applications.

This book gives you practical knowledge of building modern full-stack web apps from scratch using Angular with a Laravel Restful back end.

The book begins with a thorough introduction to Laravel and Angular and its core concepts like custom errors messages, components, routers, and Angular-cli, with each concept being explained first, and then put into practice in the case-study project.

With the basics covered, you will learn how sophisticated UI features can be added using NgBootstrao and a component-based architecture. You will learn to extend and customize variables from Bootstrap CSS framework.

You will learn how to create secure web application with Angular and Laravel using token based authentication. Finally, you will learn all about progressive web applications and build and deploy a complete fullstack application using Docker and Docker-compose.

By the end of this book, you'll gain a solid understanding of Angular 6 and how it interacts with a Laravel 5.x backend

What you will learn

  • Explore the core features of Angular 6 to create sophisticated user interfaces
  • Use Laravel 5 to its full extent to create a versatile backend layer based on RESTful APIs
  • Configure a web application in order to accept user-defined data and persist it into the database using server-side APIs
  • Build an off-line-first application using service-worker and manifest file
  • Deal with token based authentication on single page application (SPA).
  • Secure your application against threats and vulnerabilities in a time efficient way
  • Deploy using Docker and Docker-compose

Who this book is for

This book targets developers who are new to Angular, Laravel, or both, and are seeking a practical, best-practice approach to development with these technologies. They must have some knowledge of HTML, CSS and JavaScript. Familiarity of PHP is assumed to get the most from this book.

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Hands-On Full Stack Web Development with Angular 6 and Laravel 5 un PDF/ePUB en línea?
Sí, puedes acceder a Hands-On Full Stack Web Development with Angular 6 and Laravel 5 de Fernando Monteiro en formato PDF o ePUB, así como a otros libros populares de Informatik y Programmierung in JavaScript. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2018
ISBN
9781788836647
Edición
1
Categoría
Informatik

Creating a RESTful API Using Laravel - Part 1

Before we get started, let's briefly introduce a software development standard called the RESTful API.
An Application Programming Interface (API) is a set of instructions, routines, and programming patterns used to access an internet-based application. This allows a computer or other application to understand the instructions in this application, interpret its data, and use it for integration with other platforms and software, generating new instructions that will be executed by this software or computers.
In this way, we understand that the APIs allow interoperability between applications. In other words, this is communication between applications, in our case, the communication between the client-side and the server-side.
Representational State Transfer (REST) is an abstraction of the web architecture. Briefly, REST consists of principles, rules, and constraints that, when followed, allow the creation of a project with well-defined interfaces.
The features available in a RESTful service can be accessed or manipulated from a set of operations that are predefined by default. The operations make it possible to create (PUT), read (GET), change (POST), and delete (DELETE) resources, and are available from messages using the HTTP protocol.
Although Laravel is an– MVC framework, we can build RESTful apps that are extremely robust and scalable.
In this chapter, you will learn how to build a RESTful API using the core elements of the Laravel framework, such as controllers, routes, and Eloquent Object Relational Mapping (ORM). Mainly, we will cover the following topics:
  • Preparing the application and understanding what we are building
  • An Eloquent ORM relationship
  • Controllers and routes

Preparing the application and understanding what we are building

Let's start this session using the application that we started to develop in the previous chapter. However, we will make some adjustments before continuing. First, we are going to add our code to the version control. In this way, we will not lose the progress we made in the previous chapter.
  1. Inside the chapter-04 folder, create a new file called .gitignore and add the following code:
storage-db
.DS_Store
  • See https://help.github.com/articles/ignoring-files for more information about ignoring files
  • If you find yourself ignoring temporary files generated by your text editor or operating system, you probably want to add a global ignore instead git config --global core.excludesfile '~/.gitignore_global'
  • Ignore the storage folder's due size
The previous code just added the storage-db folder to untracked files.
  1. Let's add the changes to source control. Inside the Terminal window, type the following command:
git init
Finally, let's add our first commit.
  1. Inside the Terminal, type the following commands:
git add .
git commit -m "first commit"
Bravo! We have our code under Git source control.

Refactoring the application files

Now, it is time to change some files to adjust to chapter-05:
  1. Copy all the content of chapter-04 and paste it into a new folder called chapter-05.
  2. Open the docker-compose.yml file and replace the code with the following lines:
version: "3.1"
services:
mysql:
screenshot: mysql:5.7
container_name: chapter-05-mysql
working_dir: /application
volumes:
- .:/application
- ./storage-db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=123456
- MYSQL_DATABASE=chapter-05
- MYSQL_USER=chapter-05
- MYSQL_PASSWORD=123456
ports:
- "8083:3306"
webserver:
screenshot: nginx:alpine
container_name: chapter-05-webserver
working_dir: /application
volumes:
- .:/application
- ./phpdocker/nginx/nginx.conf:
/etc/nginx/conf.d/default.conf
ports:
- "8081:80"
php-fpm:
build: phpdocker/php-fpm
container_name: chapter-05-php-fpm
working_dir: /application
volumes:
- ./project:/application
- ./phpdocker/php-fpm/php-ini-
overrides.ini:/etc/php/7.2/fpm/conf.d/99-overrides.ini
Note that we changed MYSQL_DATABASE and MYSQL_USER and also changed the container names to fit the chapter-05 title.
  1. Edit the project/.env file with the new database information, as in the following code:
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=chapter-05
DB_USERNAME=chapter-05
DB_PASSWORD=123456
  1. Now, delete the storage-db folder. Don't worry we will create a new one with the docker-compose command later.
  2. It's time to commit our new changes, but this time we will do it another way. This time, we will use the Git Lens VS Code plugin.
  1. Open VS Code. On the left-hand side bar, click on the third icon for source control.
  2. Add the following message inside the message box at the top-left sidebar Init chapter 05.
  3. Press Command +Enter on macOSX, or Ctrl + Enter on Windows, and click Yes.
Well done. Now, we can start chapter 05 with a new baseline of files.

What we are building

Now, let's talk a bit...

Índice