How to create the backend of a crypto tracking app using Swift and Laravel

The application will be built using Swift, Laravel, Pusher Channels, and Pusher Beams.PrerequisitesTo follow along you need the following requirements:Xcode installed on your machine.Knowledge of the Xcode IDE.Basic knowledge using the Laravel framework.Basic knowledge of the Swift programming language.Laravel CLI installed on your machine.SQLite installed on your machine..Installation guide.Cocoapods installed on your machine.Pusher Beams and Channels application.What we will be buildingWe will start out by building the backend of the application using Laravel..Then we will build the iOS application using Swift..If you want to test the push notifications then you will need to run the application on a live device.How the client application will workFor the client app, the iOS application, we will create a simple list that will display the available currencies and the current prices to the dollar..Whenever the price of the cryptocurrency changes, we will trigger an event using Pusher Channels so the prices are updated.From the application, you will be able to set a minimum and maximum price change when you want to be alerted..For instance, you can configure the application to send a push notification to the application when the price of one Etherium (ETH) goes below $500..You can also configure the application to receive a notification when the price of Bitcoin goes above $5000.How the backend application will workFor the backend application, we will be using Laravel and we will create endpoints that allow a user update the settings and load the settings for a device..The API will be responsible for checking the current prices of the cryptocurrency and sending both a Channels update and a Beams notification when the price changes.However, because the prices don’t change very predictably, we will be simulating the currency changes so we can preview the application in action..We will also be using task scheduling in Laravel to trigger the checks for the current currency prices.In a production environment we will set the scheduler as a cronjob, but because we are in development, we will manually run the command to trigger price changes.How the application will lookWhen we are done with the application, here’s how the application will look:Let’s get started.Setting up Pusher Beams and ChannelsSetting up Pusher ChannelsLog in to your Pusher dashboard..If you don’t have an account, create one..Your dashboard should look like this:Create a new Channels app..You can easily do this by clicking the big Create new Channels app card at the bottom right.. More details

Leave a Reply