SmartShop.MAUI is a cross-platform application built with .NET MAUI, following the MVVM architecture for maintainability and scalability. It provides modular services for API communication and clean ViewModels for robust data binding and testability.
- Features
- Architecture
- Configuration
- Getting Started
- Directory Structure
- Usage
- Contributing
- Troubleshooting
- License
- Contact
- MVVM Architecture: Ensures a clear separation of concerns for maintainable code.
- Modular Services: API endpoints are managed by easily extendable service classes.
- ViewModels: Designed for clean data binding, testability, and UI logic separation.
- Multi-Platform Support: Runs on Android, iOS, Windows, and macOS.
- Community Toolkit: Integrated for enhanced UI and utility features.
- Authentication Service: Handles user login with error reporting and validation.
- Asset Management: Supports deploying raw assets for use in the application.
- Font Customization: Register custom fonts for improved user interface.
- Dependency Injection: Uses DI for services and view models, simplifying testing and development.
The project is built using the Model-View-ViewModel (MVVM) pattern, which separates UI, business logic, and data management:
- Models: Define data structures and API response/request types.
- Views: XAML pages for platform-specific user interfaces.
- ViewModels: Manage UI logic and interact with services.
- Services: Handle API calls, authentication, and reusable logic.
Dependency injection is used for modularity and testability. The main configuration and service registration is in MauiProgram.cs.
- API Base URL: Configured in
SmartShop.MAUI/Helpers/AppConstants.csashttp://localhost:5218. - Fonts: Custom fonts (OpenSans) are registered in
SmartShop.MAUI/MauiProgram.cs. - Dependency Injection: Services such as
ApiServiceandAuthServiceare registered for use across the app. - Assets: Raw assets can be added to
SmartShop.MAUI/Resources/Rawand are automatically deployed with the app package.
-
Clone the repository:
git clone https://github.com/supunsarachitha/SmartShop-FrontEnd-MAUI.git
-
Open the solution:
- Use Visual Studio 2022 or later with .NET MAUI workloads installed.
-
Restore dependencies:
- Restore NuGet packages.
-
Build and run:
- Build the solution and run the app on your preferred target platform (Android, iOS, Windows, or macOS).
SmartShop.MAUI/Helpers: Application constants and utility classes.SmartShop.MAUI/Services: Modular API and authentication services.SmartShop.MAUI/ViewModels: MVVM ViewModels for data binding.SmartShop.MAUI/Models: Data models for requests and responses.SmartShop.MAUI/Platforms: Platform-specific implementations.SmartShop.MAUI/Resources/Raw: Raw assets for deployment.SmartShop.MAUI/Views: XAML pages for UI.
- Login Functionality: Use the login page to authenticate with your backend API. The login logic validates input and handles errors gracefully.
- API Communication: All API requests are handled by the
ApiServiceandAuthServiceclasses, with configuration and error management. - Extending Functionality: To add new pages or services, follow the existing MVVM structure for maintainability.
- Fork the repository, create a feature branch, and open a pull request with a clear description of your changes.
- Keep code style consistent and include unit tests where appropriate.
- Document any major changes in the PR description.
- For bugs and feature requests, please use GitHub Issues.
- Ensure you are using Visual Studio 2022 or later with the latest .NET MAUI workloads.
- If API requests fail, verify that the backend is running and the
ApiBaseUrlis correctly configured. - For asset issues, make sure files are placed in the correct
Resources/Rawdirectory with proper build actions. - Consult the documentation and code comments for further guidance.
This project is licensed under the Apache License 2.0.
For questions, suggestions, or support, please open an issue on the GitHub repository or contact the maintainer via GitHub profile.