Developer's Introduction SelfStorageSMS

SelfStorageSMS (SSSMS) as a system automates the sending of “rent due” and collections notices via SMS (text message), automated phone calls and emails to tenants of self-storage facilities using specific management software titles, currently SiteLink and QuikStor. It does this by interfacing with databases containing facilities’ tenant and unit data and checking the status of each unit. If the unit’s information matches certain criteria, a notification is queued for the tenant and is then sent at a predetermined time in the facility’s time zone.

The system tracks messages sent and received and bills each facility based on a monthly flat-rate amount plus per-notification charges by sending transactions through an online credit card payment gateway. Using a Customer Portal, facilities have the ability to change their account and billing information, as well as customize the content of text notifications and the criteria for which each notification is sent. Reporting is provided automatically when each facility is billed; as well, facilities may use the Customer Portal to access reports at any time. Administrators have the ability to do these tasks as well as additional tasks related to servicing facility accounts, via an Admin Portal.


MessageReminders (MR) is a web application that allows individuals and businesses to send immediate and scheduled text message notices and reminders, and provides two-way text communications. MR supports both SMS and MMS messages. For the purpose of this document, the term “text message” will refer to either, except where specifically noted. Each client is provided with one or more secure logins that display various forms relevant for the way the client uses text messaging. Clients are also able to download activity reports in comma-separated (CSV) format. Reports can also be set up to be automatically emailed to customers on a weekly and/or monthly basis. Although most billing is set up as flat-rate recurring billing in the payment gateway, the ability to bill based on per-text activity exists.

1. Skills Required

The following skills and skill levels are required for satisfactory development of the SSSMS and MR systems:

Skill Required Proficiency Preferred Proficiency
PHP MVC/OOP Moderate Moderate-High
PHP General / Procedural Moderate-High Expert
Javascript & jQuery Moderate Moderate-High
Linux Admin / Shell Scripting Basic Moderate
TCP/IP Concepts / Configuration Moderate Moderate
HTML5 and CSS3 Moderate Moderate-High
MySQL Moderate Moderate
Database Schema Design Moderate Moderate
API Integration Moderate-High Expert
Technical Documentation Moderate Moderate
WHM and cPanel Familiar Familiar
Graphics Design / Manipulation Basic Basic
Computer Problem Solving Moderate-High Expert
Subversion Heard of it Familiar
WebSockets Heard of it Familiar

2. Vendors and Third-Parties

SSSMS interfaces with a variety of third-party systems for input, output and monitoring. Facility data is obtained from SiteLink, Storage Commander, SWAMP and QuikStor. As well, notes are output to records when notifications are sent or messages received. The system uses Twilio as a telecommunications gateway for sending and receiving messages, placing automated phone calls and for billing usage reports. The credit card payment gateway is Payeezy, provided by First Data. Time zone data is retrieved from MapQuest is used for geolocation. Infusionsoft is used for marketing and customer nurture campaigns.

MR interfaces with Twilio as its SMS gateway. Code has been written to also interface with Plivo as an SMS gateway although MR currently does not utilizes this code. The USAePay payment gateway is used for transaction processing.

Monitoring and alerts are provided by Uptime Robot and Pingdom. Other vendors include InMotion Hosting for hardware and network infrastructure, DNS Made Easy for DNS services and failover, for SSL certificates and LastPass to manage login credentials.

3. Hardware & Network Infrastructure

InMotion Hosting (IMH) provides server hardware and the network connectivity for them. There are two VPS accounts for SSSMS, one located in IMH’s east coast data center and the other in their west coast data center. The west coast (secondary) server hosts mail and development sites as well as replicated production sites. The east coast server (primary) contains live data and performs all production processing barring outage.

4. Replication & Failover

The systems are configured to replicate their production environments across two servers, both in WHM account set-up, programming code for each domain and instant data replication. Daily data

backups are made on each server for recovery, with each server's backup copied to the other. System monitoring with DNS failover allows the secondary server to go live hosting production activity in the event of outage on the primary server. DNS failover is on a per-domain basis, allowing domains not experiencing outage to continue running on the primary server while the secondary takes over for non- functional domains.

5. Development

All development and testing takes place using development copies of production sites, hosted on the secondary server. There are three applications for which there is a Subversion software repository in use for version control; per policy, Subversion must be used with these three applications.

Following approval, new development is implemented on the primary server. Production changes made on the primary server are automatically replicated to redundant accounts on the secondary server.

6. WHM & cPanel

Administrative functions for the servers can be most easily performed using WHM (Web Hosting Manager) and cPanel (Control Panel). WHM is used to configure server-wide services and settings, and to create accounts for individual sites. The site control panels, cPanel, are used to configure and manage individual site accounts. URLs and login credentials for the WHMs and cPanels can be found in LastPass. Access to site cPanels can also be gained through WHMs “List Accounts” screen.

7. Secure Shell (SSH)

Both the primary and secondary servers run CentOS on Linux. Advanced administrative tasks, troubleshooting using server logs and scripts as well as functions not found in WHM may need to be performed using the Linux shell. The VPS utilizes SSL encryption in providing shell tasks. Additionally, an “allow” rule for the IP address of the individual desiring to access the shell must be added to the firewall.

8. Email

All email is routed through the secondary server, including outbound mail generated by the Live server. Inbound email for SSSMS is stored in email accounts stored in the “” WHM account on the secondary server, likewise for MR, “”. Those mailboxes may be accessed, as well as new email addresses created, through the corresponding cPanel.

9. Domain Name System (DNS)

Correct domain name to IP address translation is essential to the proper operation of the system. DNS is provided by DNS Made Easy.

10. Cron

Cron is a service that runs automated tasks according to a predetermined schedule. All automation for both systems is performed via cron. These tasks include deleting old files, fetching data from SiteLink, sending notifications through Twilio, generating reports, processing billing, checking the status of free trial customers and new customer notifications. The proper configuration of these tasks is necessary for maintenance, timely functioning of the system and in order for processing to take place in the correct

sequence. Cron can be accessed through the secure shell (SSH) or via the “Cron Jobs” icon in the cPanel “Advanced” icon group.

11. Data

Database administration can most easily be performed using phpMyAdmin, a web-based tool accessed through the servers’ cPanels. PhpMyAdmin can be used to modify the structure of the database and tables, edit data and tune basic MySQL parameters. Advanced configuration, such as for replication, requires or is more easily performed using the Secure Shell (SSH). Additional administrative tools may be used on direction or by approval.

12. APIs

The following APIs are used by the SSSMS system:

13. SelfStorageSMS General System Design SSSMS utilizes the LAMP stack (Linux, Apache, MySQL, PHP) for development and delivery. There is extensive Javascript and jQuery found primarily in the Customer and Admin Portals. Javascript and CSS minification is used for delivery of production pages on the primary server. Rental data (rent roll) and queues for SMS gateways are stored as XML files. Reports are stored and sent as comma-separated values (CSV) files. Account statements and invoices are stored and/or sent as PDF files. Log files are created and appended by many PHP scripts and are stored as plain text.

The majority of PHP development uses a top-down procedural approach as opposed to an object- oriented approach. Interacting with self-storage management software and with SMS gateways is done through object-oriented classes. There is a selfstor class which acts as a wrapper for specific types of self-storage management software, such as SiteLink, Storage Commander, SWAMP or QuikStor. Thus, when selfstor is instantiated, it instantiates into itself either sitelink, stgcmndr, swamp or quikstor, depending on the software used by a particular facility, and passes many method calls to these classes. This allows scripts to access self-storage data abstractly, without necessarily caring which underlying class' methods are actually being used. Access to telecommunications gateway-specific code, such as for Twilio, uses the same approach.

Object-oriented code is often used when interfacing with a third-party library or vendor-supplied code that uses it.

Javascript and jQuery are found mixed. jQuery is used where its framework provides capabilities not part of core Javascript or where development is significantly simpler than with core Javascript. Portals

The SSSMS Portals provide a user-friendly front-end for customers and administrators to customize and control the service. Although commonly referred to as two distinct portals, the Admin Portal and Customer Portal, the same software is being accessed. However, depending on the credentials used to log-in, whether as a customer or as an administrator, different options are presented to the user. The presentation of available options is determined by conditionals throughout the programming, both in Javascript and in PHP.

The Portals front-ends are responsive, meaning they adapt to the width of users’ browsers. There is very little code that is specifically for mobile devices or for desktop browsers. Javascript is used to determine the browser user agent and width of the browser window and redirect to a distinct PHP script that sets flags for portions of the code that differ depending on the view, in addition to setting up distinct layouts.

Javascript files are minimized using Microsoft’s Ajax Minifier for the production (primary) server. Additional Javascript files load third-party libraries/add-ons or provide supplemental code not needed in every instance. In many functions, Javascript is used to make an Ajax call and update the DOM with HTML outputted by the PHP script answering the call.

Both Javascript and jQuery are used interchangeably throughout. Where a task is simpler using jQuery, it is used. Otherwise, in most cases straight Javascript is used.

14. MessageReminders

MR utilizes the LAMP stack (Linux, Apache, MySQL, PHP) for development and delivery. Additionally, there is extensive Javascript and jQuery used throughout. SMS queues are stored in a MySQL table, updated as send attempts are made. Reports are not stored but are generated in real time and sent to the browsers as comma-separated value (CSV) files.

MR uses an object-oriented MVC architecture.

Each client's login displays a variety of forms relevant to its use of MR. These different forms are accessible via Tabs shown at the top of the screen. The screen page represents an MVC View and each form is loaded into the view.

For each form loaded into a view (page), there is one or more Javascript files loaded, one or more

cascading style-sheets (CSS) loaded and a Controller called via Ajax, which handles data submitted by the form.

The Instant Messaging form connects with a WebSockets server for functionality rather than utilizing periodic Ajax calls.

In addition to the pages containing forms for clients' use, MR also has an administrative dashboard. Dashboard pages and forms use the same architecture as client pages.

Models provide classes for accessing, manipulating and/or sending data. There is a Model for working with text messages, a model for working with users, a model for database access, and so on. Third- party libraries, such as for Twilio, Plivo and PHPMailer, are also accessed through models' methods.

The .htaccess file uses the URI to determine which PHP script to call with which parameters in order to display the appropriate requested page. Configuration settings used throughout the system are found in a plain text .ini file.