Hosting a Web Application in the Cloud using AWS – Part I

AWS architecture

AWS Cloud Basics Amazon Web Services (AWS) is the leading on-demand cloud computing platform. At a broad level, AWS consists of a collection of independent services such as EC2, S3, RDS, etc. (more on these later). These services can be strung together to develop highly-available, highly-scalable and cost-effective web architectures. Architecting in the Cloud In order to host your web application on AWS, you have to understand how architecture on the cloud works. Also, you have to think of each aspect (computing, storage, database, etc.) of your hosting solution as separate entities that can be managed and scaled independently of each other. In AWS, …

Continue Reading

Yii2 – What you need to know – Part V (Yii2 Application Structure, Security…)

Application Structure

In this last and final installment of the series on Yii2 and it’s new changes, we will take a quick look at all the additional details found in this update to the popular framework that are not covered in the previous parts. Yii2 Application Structure & Installation One of the things you will notice first while starting off development for Yii2 is the new and improved application structure and installation procedure. Yii2 uses composer from the get go to manage dependencies. Moreover, the Yii2 application structure is divided into two broad types: basic and advanced. The basic installation, creates a basic …

Continue Reading

Yii2 – What you need to know – Part IV (Events, Behaviors & Errors)

Events, Behaviors, Errors

In this installment of the series where we are exploring the Yii2 framework, we will look in detail at the Events, Behaviors and Error Handling features of the Yii2 framework. There are some notable differences in the way Yii2 handles these critical features when compared to how Yii used to handle them. Events For those of you that never used events in your previous Yii based projects, let me tell you, you have been missing a very powerful feature. Events are very useful for two reasons. First, they can make your components more flexible. Second, you can hook your own code into …

Continue Reading

Yii2 – What you need to know – Part III (Active Record)

Active Record

In this installment of the series where we are exploring the Yii2 framework, we will look in detail at the Active Record and database aspects of this powerful framework. We feel that this is one of the strongest sections of Yii2 in terms of both improvements as well as addition of new features. Database Support in the new Active Record class Among the big news in Yii2 Active Record is the support for numerous new backends including NoSQL based ones. These backends include elasticsearch, redis, Sphinx search as well as mongodb. This is great news as we can switch backends without …

Continue Reading

Yii2 – What you need to know – Part II (MVC)

MVC

MVC In part 2 of this series I am going to look at the core MVC concepts of the Yii2 framework. While the basic premise of the MVC structure of the Yii2 framework remains the same as that of Yii1.1, there are some subtle differences to be seen. As a result, when we delve deeper into the constructs of the MVC structure, we find a plethora of changes that will make development on the Yii2 platform a more rewarding experience. Models In Yii, Models extend from the yii\base\Model class. Models are typically used to both hold data and define the validation …

Continue Reading

Yii2 – What you need to know – Part I

Yii2

Introduction to Yii2 The Yii project had started on  January 1, 2008, by some of the developers that were responsible for the PRADO framework. Their vision was to improve upon the PRADO framework and address all of it’s shortcomings. Yii 1.0 was formally released on December 3, 2008, and quickly became a major force in the huge ocean of PHP frameworks due to its performance, ease of use and adherence to some of the best practices of the industry at that time. Over time, as development on the PHP language itself picked up steam and new and more modern features got …

Continue Reading

Testing Bootstrap 4 on Yii2

Bootstrap 4 Yii2

For a Yii2 project I had taken up recently, we decided to go with bootstrap 4 although it was still in alpha development stage. Because, we reasoned, by the time the project was completed and released, Bootstrap 4 would have hit stable and we would find ourselves with an outdated library even before the release. In this post, I will take a look at how you can test your app using the latest bootstrap version. Yii2 Bootstrap Library Yii2 includes a crore bootstrap extension called yii2-bootstrap which can be found here: https://github.com/yiisoft/yii2-bootstrap. This is currently providing Bootstrap 3 and is at version …

Continue Reading

Bootstrap 4 Features – A Quick Primer

Bootstrap 4

Update Jan 22, 2016: This article was updated after the Boostrap 4 alpha 6 was released with quite a few changes including turning on flexbox by default. The Bootstrap 4 CSS Framework is expected to be out very soon. I thought I might write a brief primer about the new features and functionalities that are introduced in the upcoming version of Bootstrap. Bootstrap 4 development was in it’s alpha 5 stage as I was writing this. The developers are hopeful of an initial beta release after alpha 6. I hope to keep this post updated as the development moves along. Bootstrap CSS Framework Originally released …

Continue Reading

Install Laravel with Nginx and PHP-FPM

Install Laravel

Nginx with PHP-FPM is currently the preferred way to run PHP applications on your server. In this post, I will show you how to install Laravel on your server and run it on top of Nginx serving PHP files using PHP-FPM. We will also make use of composer as the preferred way to install Laravel. Install Laravel using Composer Make sure you have composer installed on your system. If not you can get it here. I would suggest you install composer globally. Once composer is installed and verified, you should setup the laravel installer using: This will create a new laravel …

Continue Reading

Angular2 and Yii2: Project Structure and Architecture

Angular2 and Yii2

How do you start off using Angular2 (or AngularJS) and Yii2 in a single project? What is a solid project structure / architecture that can be used to combine the two while still maintaining good separation of concerns? I will try to outline a basic folder structure and workflow I have used successfully in the past. Project Structure First of all let me show you the final directory structure that I am aiming for. Although I will explain how we get there in the next section, it is good to keep in mind what we are trying to achieve. The entire project is divided into two sections contained …

Continue Reading