Coder Social home page Coder Social logo

swiftui-pos's Introduction

Antique Cafe POS

I created this as a side project and also to help a friend manage sales at her small cafe in Wat Phnom, Phnom Penh. It was built with SwiftUI intended for iPad use. The app can manages orders, calculates change based on the dual KHR/USD currency used in Cambodia, as well as generating daily sales reports. It is also capable of connecting to a bluetooth printer to issue receipts. The app is currently distributed ad hoc as I am currently based in Sydney. Further improvements and features are currently being developed.


Getting Started

Prerequisites

Installing

Simply pull this repo, open it onto Xcode 11 or later and run on a compatible device or simulator. Note that the simulator will not have bluetooth functionality.


About this app

This app was built mainly with SwiftUI. Features of Swift it utitlises:

Codable

It uses Swift's Codable protocol to create and encode orders to JSON files. Orders are stored in folders ordered by yyyy/mon/dd.

@State, @EnvironmentObject, @Binding & @ObservedObject

These were used to display order properties as well as pass order items across multiple views and reusable component.

CoreBluetooth

CoreBluetooth was used to establish a connection with the receipt printer and issue receipts.

Keychain

With the help of Keychain Wrapper, the Keychain framework is used to store app passcode which grants access to the admin page. This page allows users to view financial reports regarding the cafe.


Acknowledgements

Paul Hudson's guides have been incredibly helpful in helping me get accustomed to this new framework and language. A good start if you're looking to learn SwiftUI would be this tutorial: iDine

Color Hunt is really great if you cannot design for the life of you (like me). Aesthetically pleasing color schemes from more design-gifted people are posted there for your styling needs.

Of course where would I be without this site. Notable threads that REALLY helped me print to a bluetooth printer from an iOS device:

  • Characteristic and Print Buffer - Kudos to Giorgio for laying out which characteristics were meant for printing and pointing out the print buffer.
  • BLEConnection - information from here provided me with a really good understanding of how bluetooth connections work in SwiftUI.

Kudos to jrendel for writing this wrapper to significantly simplify Keychain wrapper. Implementing the app passcode would be significantly more complicated without this.

Although this guide is not specifically for SwiftUI, I was still able to learn how connecting to a BLE device should work and adapt it to the new framework by Apple.

swiftui-pos's People

Stargazers

 avatar  avatar Fredy Mendez avatar  avatar Vong Beng avatar  avatar

Watchers

Vong Beng avatar

Forkers

israreyna

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.