Skip to content

PlatziStore is a full-featured demonstration app built with SwiftUI, async/await networking, and a clean, modular architecture.

License

Notifications You must be signed in to change notification settings

bsimmons01/PlatziStoreREST

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PlatziStore (SwiftUI + REST API Sample App)

Educational Example of Swift + REST API Architecture

PlatziStore is a full-featured demonstration app built with SwiftUI, async/await networking, and a clean, modular architecture.
It integrates with the Platzi FakeStore REST API to load products, categories, images, and authentication flows β€” all while showcasing production-ready code organization and modern Swift patterns.

This project is designed as an educational reference for anyone learning:

  • How to structure a SwiftUI app at scale
  • How to build a reusable networking layer
  • How to use async/await with URLSession
  • How to handle authentication, decoding, API errors
  • How to manage application state with observable stores
  • How to build clean, testable views & screens

πŸš€ Features

  • SwiftUI-powered UI with navigation stacks, lists, forms, modals, alerts
  • Async/await networking layer with URLSession + custom error handling
  • Modular, folder-organized architecture
  • Category & product browsing
  • Authentication flows (Login + Registration)
  • Secure token storage using iOS Keychain
  • Async image loading with fallback placeholders
  • Example of custom view components, extensions & utilities
  • Safe concurrency on the main actor where needed

πŸ“± Screenshots

Platzi Login Screen Platzi Category Screen Platzi Locations Screen
Platzi Product List Screen Platzi Detail Screen Platzi Profile Screen

πŸ— Project Structure

The project is organized for clarity, maintainability, and education:

PlatziStore/
β”œβ”€β”€ Controllers/        # AuthenticationController, ProductsController, etc.
β”œβ”€β”€ Errors/             # AppError, APIError, decoding failures
β”œβ”€β”€ Extensions/         # Helpers for String, URL, Color, View, etc.
β”œβ”€β”€ Networking/         # HTTPClient, endpoints, URLRequest builders
β”œβ”€β”€ Requests/           # Encodable API request models
β”œβ”€β”€ Responses/          # Decodable API response models
β”œβ”€β”€ Screens/            # SwiftUI screens (Login, Register, ProductList, Detail)
β”œβ”€β”€ Stores/             # Observable app-wide state containers
β”œβ”€β”€ Utils/              # Constants, helpers, formatters
β”œβ”€β”€ Views/              # Reusable SwiftUI view components
└── PlatziApp.swift     # Main entry point

This layout mirrors what you'd expect in a production SwiftUI application using REST APIs.


🌐 API Used

This project integrates with the publicly available Platzi FakeStore API:

https://fakeapi.platzi.com/

Used for:

  • Authentication
  • Products
  • Categories
  • Images

🧩 Tech Stack

  • Swift 5.9+
  • SwiftUI
  • Async/Await Concurrency
  • URLSession Networking
  • Codable for JSON parsing
  • AppStorage / UserDefaults / Keychain
  • MVVM-ish view + store separation

πŸ”§ How to Run

  1. Clone the repo:

    git clone https://github.com/YOUR_USERNAME/PlatziStore.git
  2. Open the project:

    open PlatziStore.xcodeproj
  3. Build & Run in Xcode (iOS 17+ recommended) No API keys are required β€” everything uses the public Platzi endpoints.


πŸ“š Learning Highlights

This project demonstrates:

βœ” Building a clean networking layer

  • Centralized HTTP client
  • Reusable request builders
  • Typed responses
  • Automatic error translation

βœ” Clean architecture

  • Stores handle state & business logic
  • Screens are light and declarative
  • Controllers encapsulate API calls
  • Reusable view components reduce duplication

βœ” SwiftUI best practices

  • Environment injection
  • NavigationStack
  • Alerts, sheets, and loading states
  • Async image handling
  • Form validation

βœ” Real-world handling

  • Authentication tokens
  • Duplicate validation on inputs
  • Placeholder images
  • URL extensions for random image utilities

πŸ‘¨β€πŸ« Built with lessons from:

"The Complete Guide to Integrating JSON API with SwiftUI" by Mohammad Azam

https://www.udemy.com/course/the-complete-guide-to-integrating-json-api-with-swiftui/

Not affiliated with or endorsed by the instructor or Udemy


πŸ›οΈ Credits

All code written by Brian Simmons, unless otherwise notated, and released under the MIT License. Attribution is required.


πŸ§‘πŸ»β€πŸ’» Apps by Brian:

Heard It All App Icon Heard It All - Relive every Billboard Hot 100 #1
What Year Was It? App Icon What Year Was It? - Challenge your memory across history

πŸ’¬ About

Created by Brian Simmons
centrasoft.com


🀝 Contributing

Pull requests are welcome. Please open an issue first to discuss major changes.

About

PlatziStore is a full-featured demonstration app built with SwiftUI, async/await networking, and a clean, modular architecture.

Topics

Resources

License

Stars

Watchers

Forks

Languages