Giter Site home page Giter Site logo

nsms's Introduction

NyarukaSMS

NyarukaSMS aims to provide a quick start for a basic python based SMS app using the tools Nyaruka uses to build its systems. This includes setting up rapidsms, rapidsms-httprouter, smartmin and our parsing and localization libraries.

Getting Started

To get started, follow these steps:

% virtualenv env
% source env/bin/activate
% pip install nsms
% start-nsms [project-name]
% pip install -r pip-requires.txt
% cd [project-name]
% python manage.py syncdb
% python manage.py migrate
% python manage.py runserver

Sample Application

NSMS comes with a simple SMS application to track the mileage on vehicles. The SMS format for the application is as follows.

Registering Cars

Each user of the system much register the car they are using, they do so by sending:

car [license plate]

This register a car to the phone. From now on all mileage reports will be associated with the car with the passed in license plate. The license plate must be 8 characters.

Adding Mileage Reports

Once a user has registered their car, they can report mileage by sending the message:

miles [mileage (integer)]

This records a new mileage report for the car associated with this connection. If the connetion has not registered a car then this will be an error.

Best Practices

This application aims to demonstrate the following best practices:

  • Comprehensive unit coverage. We aim for 100% unit test coverage of our apps, and so should you. This app shows you how easily that can be done
  • DRY. We use Smartmin to allow us to add a lot of functionality without adding much code
  • Language Templates. We let our customers edit the translations for all our messages through a web UI, including using standard Django templates for formatting.
  • Tolerant Parsing. Though still a work in progress, our rapidsms_parser module provides an easy way to programmatically parse SMS messages and give good error messaging in the process.
  • User Management. We provide our customers with basic user management, using groups and SmartMin permissions to easily manage these.

nsms's People

Contributors

ericnewcomer avatar nicpottier avatar norkans7 avatar reugene avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nsms's Issues

Migration to rapidsms 0.11

Can we have nsms "automation" tested/migrated with/to the newer rapidsms? It sure is still a handy tool (nsms).

Handle bad translation gracefully

During moveit training they encountered a registration error message when trying to send the success message. This is because their success message used {{ facility name }} instead of {{ facility.name }}.

We should provide a more appropriate error message when translation replacement fails.

Add validation of translation templates

We should figure out a way to validate templates in translations strings so users don't get caught at runtime with something invalid. IE.. something like {{ clinic name}} instead of {{ clinic.name }} will blow up the template.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.