A SwiftUI-based iOS application for managing products with offline support.
- Product listing with search functionality
- Add new products with image support
- Mark products as favorites
- Offline support for adding products
- Beautiful UI with modern SwiftUI components
The API documentation is available in multiple formats:
-
Online Documentation (Recommended):
- Visit https://ichetanmittal.github.io/ios_product_cart for interactive API documentation
- No setup required, always up to date
-
Local Development:
# Start the documentation server ./serve-docs.sh # Visit http://localhost:8000/docs in your browser
-
Raw Specification:
- View api-spec.yaml for the OpenAPI specification
- Import Swipe.postman_collection.json into Postman for testing
For detailed API information, see API.md.
- Xcode 14.0 or later
- iOS 16.0 or later
- Swift 5.7 or later
- Clone the repository
- Open
Swipeios.xcodeproj
in Xcode - Select your target device or simulator
- Build and run the project (⌘ + R)
Swipeios/
├── Models/
│ └── Product.swift
├── ViewModels/
│ └── ProductViewModel.swift
├── Views/
│ ├── ProductListView.swift
│ ├── AddProductView.swift
│ └── Components/
│ └── ProductCard.swift
├── Networking/
│ └── NetworkManager.swift
└── Storage/
└── LocalStorageManager.swift
The app follows the MVVM (Model-View-ViewModel) architecture:
- Models: Define the data structure
- Views: Handle the UI and user interactions
- ViewModels: Manage business logic and data flow
- NetworkManager: Handle API communications
- LocalStorageManager: Manage offline storage
- GET Products:
https://app.getswipe.in/api/public/get
- POST Add Product:
https://app.getswipe.in/api/public/add
The app includes offline support through LocalStorageManager
:
- Products created while offline are stored locally
- Favorites are persisted locally
- Pending products are automatically synced when online