Skip to content

Latest commit

 

History

History
101 lines (62 loc) · 3.82 KB

README.md

File metadata and controls

101 lines (62 loc) · 3.82 KB

Native SwiftUI News App with SQLite Database Integration

This project is a Native News App developed in Swift and SwiftUI, following the MVVM and Singleton design patterns. The initial setup and basic functionalities were implemented following TundsDev's tutorial on YouTube, with additional features and enhancements added independently.

Features

  • News API Integration: Fetches the latest news from Lil Software's News API.
  • User Authentication: Sign up and login functionalities allowing users to create accounts and login.
  • SQLite Database Integration: Stores user data, articles, and favorites using SQLite.
  • Favorites Management: Users can add and remove favorite articles, with favorites stored and fetched from the database.
  • MVVM and Singleton Design Patterns: Ensures a clean, maintainable, and scalable codebase.

Screenshots

image image image image image image image

Project Structure

The project is organized into different parts and folders, following the MVVM design pattern.

API

The app uses Lil Software's News API to fetch news articles. The API endpoint is:

https://api.lil.software/news

Database

The app uses SQLite for database management, with the following entities:

  • User: Stores user information.
  • Articles: Stores articles that users have favorited.
  • Favorites: Stores the primary key (URL) of the articles and the username of the user who favorited them.

Installation

  1. Clone the repository:
git clone https://github.com/your-username/native-news-app.git
  1. Open the project in Xcode:
cd native-news-app
open NativeNewsApp.xcodeproj
  1. Install dependencies (if any).

  2. Build and run the project on your preferred iOS simulator or device.

Usage

  • Sign Up: Create a new account by providing a username and password.
  • Login: Login with your credentials.
  • Browse News: View the latest news fetched from the API.
  • Favorite Articles: Add articles to your favorites by tapping the favorite button.
  • Manage Favorites: View and manage your favorite articles from the favorites section.

Design Patterns

MVVM (Model-View-ViewModel)

The MVVM pattern is used to separate concerns within the app:

  • Model: Represents the data and business logic.
  • View: Displays the UI components and is bound to the ViewModel.
  • ViewModel: Handles the presentation logic and communicates between the Model and the View.

Singleton

The Singleton pattern is used to ensure a single instance of the database manager throughout the app, providing a global point of access.

Contributing

Contributions are welcome! Please fork the repository and create a pull request with your changes.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements