
We are gonna have a look at what we are developing in course of this lecture.
We are gonna have a look at how ionic is setup on your local machine for development.
We are looking into how Angular & Ionic projects are structured and what all the files are for.
Kick off an Ionic Angular todo app, launch a local server, and build a dynamic list using ion-list and ion-item with an input and add button to push todos.
demonstrates two-way binding with ngModel in Angular to clear and manage input for a todo app, and introduces offline persistence with pouchdb and couchdb for local storage and sync.
Introduce Julie's app for waiters, illustrating offline-first architecture with pouchdb for frontend storage and sync to remote couchdb, handling offline as normal and conflicts during sync.
Design home screen with a scrollable grid of table cards showing ids and consumed items, then open detail screen with category filters and plus, minus, pencil controls fetching from pouchdb/couchdb.
Develop a home screen with a tables overview in an Angular and Ionic app, displaying a hard-coded tables array as cards in a tabbed layout with table states.
Install and configure CouchDB for offline-first apps, create databases and documents, and design table data as separate documents to simplify syncing and conflict handling.
Set up PouchDB and CouchDB integration in an Angular Ionic app, create db and table services to fetch table documents via selectors, and enable live sync with reactive updates.
Enable four-way binding by subscribing to database changes to reflect back-end updates in real time. Implement a change handler with observable table changes to fetch updates and prevent memory leaks.
What is the CAP-Theorem? Why is our previous approach bad of just fetching the document on changes? What is the problem with distributed systems?
Propagate changes from PouchDB by implementing a change handler that updates a behavior subject with the change document, enabling automatic frontend state updates without manual fetches.
Add types to documents using a generic type, define a table doc model, and use a behavior subject to manage an array of table docs, ensuring IDs are strings.
Build a table details screen in an offline-first Angular Ionic app, define a table id as string, and create a products consumed model with id, revision, tableId, and products.
Implement and view consumed products in an offline-first Angular Ionic app by creating a product consumed document and service, subscribing to changes, and displaying items by table ID.
Display available products for ordering by implementing a product view, handling undefined data, and fetching and subscribing to stock updates with Angular and Ionic in an offline-first setup.
Fix the bug where the same product is consumed for every table by passing a dynamic table ID to the fetch function, wiring a table ID subject for per-table updates.
Style the products view into a waiter-style interface by building a split-screen layout with scrollable Ionic cards, center-aligned labels, and category filtering.
Compare object type versus primitive in TypeScript by contrasting uppercase and lowercase string examples; use lowercase string primitives to avoid bugs and ensure true primitive types.
Add a click handler on the product card to add products to the consumed list, performing stock checks, handling optional fields, and updating the consumed products array in TypeScript.
Persist consumed product changes by saving updates to PouchDB and CouchDB, using a save added action and a product consumed service in an offline-first Angular app.
Create a new product consumed document when a table has no existing record, using the table ID, a generated UID, and updating the products consumed array in CouchDB.
Refactor the app with the repository pattern to decouple data access from logic and enable swapping databases, using a PouchDB repository that extends an abstract base.
Enable an edit flow on the table details page by toggling edit mode, adding plus and minus controls to adjust consumed products, and saving or navigating to the pay page.
Implement an Angular order by pipe to sort nested arrays of objects by a property like table.id, using a getPropertyByString helper and a globally accessible application pipes module.
Add a bottom-right ion fab button on the table details page to navigate to a dedicated pay page, using a card outline icon and router link for seamless payment.
Implement a pay page that lists consumed products, lets users select items via chips, and tracks selected items with subscriptions and service logic for updating amounts and prices.
Refactor cart logic to reduce and increase amounts and calculate totals with currency formatting; implement pay page with split payment and clear actions, per-person totals, and a payment confirmation alert.
Develop the payment page to calculate split amounts per person and let users select the number of payers with a radio interface, while merging selected payments into the bill.
Create a build service to generate bills stored as documents in the database. Link table id and date time, and connect with the products consumed service to fetch builds.
Refactors the billing service to create a new bill for every user and skip updating existing bills, wiring a create bill call with paid products and table id validations.
Create a kitchen view that displays consumed products per table for kitchen staff, using the Ionic CLI to fetch all products consumed via subscriptions and present actionable per-table details.
Design and implement a state machine for every table using XState, tracking free, ordered, prepared, delivered, and dirty states, and update transitions in pouchdb to reflect real-time table status.
Implement styling and continue with state machine by fetching products consumed on the tables page, adding subscriptions and status-based icons and colors for prepared, ordered, and delivered states.
Implement state transitions for kitchen orders using a state machine, visualized with ion chips and buttons from ordered to prepared to delivered, with ability to go back and PouchDB persistence.
Implement and refine state transitions for product handling in offline-first apps, including prepared, delivered, and audit flows, with UI updates and a robust state machine.
Improve the waiter workflow by enabling delivered status updates from the table details view and sorting products by delivered state to keep kitchen and orders synchronized.
Track and reveal pending changes in the waiter view before persisting to the database by implementing a pending changes array, change handlers, and warning color highlighting.
In this course, you will learn how to build a robust, offline-first web application using PouchDB, CouchDB, Angular, and Ionic. You will start by setting up a development environment and learn how to use PouchDB and CouchDB to store and sync data locally and with a remote server. You will then learn how to use Angular to build the front-end of your application and Ionic to design and style your application for mobile devices.
Throughout the course, you will work on a practical project to apply the concepts you have learned and build a fully functional offline-first web application. You will also learn how to test and debug your application, and how to deploy it for production use.
You will learn about the CAP Theorem, which is a fundamental concept in the field of distributed systems. You will learn what the CAP Theorem is, how it relates to the design and implementation of distributed systems, and how it impacts the performance and reliability of these systems.
You will start by exploring the three key components of the CAP Theorem: Consistency, Availability, and Partition Tolerance. You will learn about the trade-offs between these components and how they affect the behavior of distributed systems. You will also learn about different approaches to achieving consistency in distributed systems, including eventual consistency and strong consistency and why we used CouchDB as a technology.
By the end of this course, you will have the skills and knowledge to build a reliable, offline-first web application using PouchDB, CouchDB, Angular, and Ionic. You will be able to store and sync data locally and with a remote server, build a responsive user interface, and design and style your application for mobile devices.