Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Selling groceries online using Postgres, Flask,...

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for Pycon ZA Pycon ZA
October 07, 2016

Selling groceries online using Postgres, Flask, Docker & Android by Petrus Janse van Rensburg

Startups are exciting. But choosing the right tech-stack can be a daunting task: You want to be able to move quickly right from the start, but also remain flexible as the technical requirements inevitably change.

In this talk I will describe my own experience of building out the tech stack for a mobile e-commerce startup. It will cover: • an overview of the main design challenges • the chosen architecture (database, server-side application layer, API and mobile client) • how I used Flask to build the API • how I used Flask-Admin to build a management console • deploying the backend application using docker-compose.

Avatar for Pycon ZA

Pycon ZA

October 07, 2016
Tweet

More Decks by Pycon ZA

Other Decks in Programming

Transcript

  1. Internet usage in Africa • 226 million smartphones (end 2015)

    • set to triple by 2020 http://www.gsma.com/mobileeconomy/africa/
  2. 1. Most smartphone users will still be stuck on slow

    / expensive connections for the foreseeable future.
  3. Existing approach • Access to extremely large inventory. • Find

    an item by doing:
 Search + Filter + Scroll + Tap for details • Each step requires network
  4. Existing approach Example: Amazon’s Android app • 21 Mb data

    needed to buy 5 items • ~ 240 taps needed to place first order
  5. • We sell only groceries to people around Cape Town,

    through a dedicated Android app. • It’s the first step towards building a new kind of online retailer, that works well in emerging-market conditions. What do we do?
  6. Our approach • Only the goods you need for solving

    a simple, everyday task (e.g. buying groceries for a household). • Dedicated app, with a simple UI that uses little data. • Only in a limited geographic area.
  7. Our approach How does it compare? • 21 Mb 0.25

    Mb data needed to buy 5 items • Works offline - you only need to be connected when proceeding to checkout. • ~ 240 taps 65 taps needed for first order
  8. - Charles Eames “There is always a need for anyone

    that can do a simple job thoroughly.”
  9. 1. Postgres tables 2. SQLAlchemy model classes 3. JSON API

    4. Client-side SQLite tables 5. Client-side Java model classes
  10. 3. Keeping sane with all the data models Keep it

    simple: de-normalise where possible Pitfalls