Skip to main content

Posts

Deploy Laravel 5.4 App on LEMP Stack (DigitalOcean Guide) Part - 4

This is the fourth part of the Deploy Laravel 5.4 App on LEMP Stack (DigitalOcean Guide) . In the last post, I have shown how to prepare the server for Laravel application deployment. And in this post, I'm going to show how to setup the local machine for production deployment. Make sure that your local Laravel directory is under git version control before you continue. If there is a .git folder in your Laravel folder that means Git is initialized. You can use git log command to check the commit logs. You can learn more about Git from the official website . Following command add new remote and set up our server as a push location. Substitute the red text with your domain name or IP address. git remote add production ssh://root@ 196.0.0.1 /var/repo/site.git You can run git remote command to view a list of existing remotes. You can execute the following command to push it to the server. git push production master It will prompt you to enter the password.The pr...

Deploy Laravel 5.4 App on LEMP Stack (DigitalOcean Guide) Part - 3

This is a third part of the Deploy Laravel 5.4 App on LEMP Stack (DigitalOcean Guide) . In this post, I'm going to prepare the server for Laravel application deployment. Let's create a folder for our Laravel application. By default, NginX will look at the /var/www/ path to serve the files. In this folder let's create a folder called app. Open the following file to update the new path. Run the following command in your terminal. sudo nano /etc/nginx/sites-available/default Let's change the root line and add the public folder path. Change the following location section to add /index.php?$query_string; location / {                 # First attempt to serve request as file, then                 # as directory, then fall back to displaying a 404.              ...

Deploy Laravel 5.4 App on LEMP Stack (DigitalOcean Guide) Part - 2

This tutorial is the second part of the Deploy Laravel 5.4 App on LEMP Stack (DigitalOcean Guide) . Before I install LEMP stack, I am going to update the package installer. To do that run the following command in the terminal. It will grab the package list and update it. sudo apt-get update Install Nginx (Engine-X) Run the following command to install Nginx server. sudo apt-get install nginx   After the installation, you should be able to visit your IP address and it will show the Nginx default page. Install MySQL Run the following command to install MySQL on your server. sudo apt-get install mysql-server The above command will start the MySQL installation process. You will have to enter 'Y' and proceed. After few steps you will see the following screen. Enter root password and proceed. Default MySQL installation is famous for insecure. MySQL has a helper script to secure the MySQL installation. To run the script type the following command i...

Deploy Laravel 5.4 App on LEMP Stack (DigitalOcean Guide) Part - 1

This blog post teaches you how to set up Laravel onto a virtual private server (VPS) using LEMP stack (DigitalOcean). LEMP is an acronym that stands for Linux, Nginx (Engine-X), MySQL and PHP. The reason I chose to use LEMP with Laravel is that it seems to be the preferred stack among the Laravel community. You can use LAMP stack as well, but when running smaller server instances like we are (with 512mb RAM), it has shown that Nginx performs better with limited resources. Why DigitalOcean? You can host it any VPS server that you wish. In this tutorial, I set up the server through SSH into VPS instance. But there are few reasons to choose DigitalOcean such as simple UI and minimalistic approach, SSD-based virtual machines, comprehensive documentation, affordable pricing and community & ecosystem Support. I have used DigitalOcean in production, and it works great. If you would like to sign up using Busy Programmer's Guide, you will get $10 to get started, absolutely free. ...

Mobile Backend As A Service (BaaS) platform for Android

Many mobile apps and games rely on a backend service for things that can’t be done solely on hosted device, such as sharing and processing data from multiple users, or storing large files. Backend as a service (BaaS) provides a centralised database and other features to manage user-generated data and application data. The developer can link applications to the backend service and backend service expose APIs to manage users, integrate push notification and analytics. BaaS is a recent development of cloud computing technology. Using backend services provide developers functionalities to manage users, data and to analyse real-time changes actively. Backend service should be able to handle the offline case gracefully and minimise battery drain. Back in the day developers had to develop custom backend platforms using server-side technologies. And developers had to scale up and down according to the user base and app usage. It was time-consuming in terms of resources and skills. Most mob...

Alternatives to the SQLite in Android

At the moment there are several embeddable databases and libraries out there that you can use in a mobile application. In this post, I examine most popular libraries and databases and highlight some of their characteristics. Realm Realm is a mobile platform and a replacement for SQLite & Core Data. According to the website, it has more than 100k active developers. Realm is fully open source and distributes under Apache License. Realm Mobile Database is much faster than an ORM, and often faster than raw SQLite due to zero-copy design. Some of the benefits of Realm are fast queries, safe threading, encryption of data and reactive architecture. You can learn more about Realm by visiting this page . Sugar ORM Sugar ORM is a library that can be used to interact with SQLite database using Object-Relational Mapping. Object-Relational Mapping (ORM) is a technique that used to query and manipulate data from a SQLite database using an object-oriented paradigm. And Suga...

How to create a project in Android Studio 2.2

This post is to support those who read the books such as  Busy programmer’s guide to Firebase with Android.  If you are getting started on Android programming, this post will help to understand the basic structure of the Android project. Android Studio Android studio provides a unified environment to develop apps for Android phones, tablets, Android Wear, Android TV and Android Auto. It is the official Integrated Development Environment (IDE) for android app development based on IntelliJ IDEA. You can learn more about Android studio features from Android Developer Website . You can download the Android Studio setup file from Download Android Studio and SDK Tools . It is bundled with Android SDK, so you don’t need to download Android SDK separately. If your Operating System is other than Windows, you can visit this URL to download the Android Studio Bundle. Launch downloaded executable file (android-studio-bundle-xxxxxxxxxx-windows.exe). Make sure you have installed Ja...