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
- 420 pagine
- English
- ePUB (disponibile sull'app)
- Disponibile su iOS e Android
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
Informazioni sul 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.
Domande frequenti
Informazioni
Creating a RESTful API Using Laravel - Part 1
- 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
- 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
- Let's add the changes to source control. Inside the Terminal window, type the following command:
git init
- Inside the Terminal, type the following commands:
git add .
git commit -m "first commit"
Refactoring the application files
- Copy all the content of chapter-04 and paste it into a new folder called chapter-05.
- 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
- 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
- Now, delete the storage-db folder. Don't worry – we will create a new one with the docker-compose command later.
- 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.
- Open VS Code. On the left-hand side bar, click on the third icon for source control.
- Add the following message inside the message box at the top-left sidebar Init chapter 05.
- Press Command +Enter on macOSX, or Ctrl + Enter on Windows, and click Yes.