https://github.com/hgq287/hgswift
Save time and build better apps with this Swift template for iOS and macOS, featuring a well-organized structure based on Clean Architecture
https://github.com/hgq287/hgswift
alamofire clean-architechture grdb swift swiftpackage swiftui xcodegen
Last synced: 11 months ago
JSON representation
Save time and build better apps with this Swift template for iOS and macOS, featuring a well-organized structure based on Clean Architecture
- Host: GitHub
- URL: https://github.com/hgq287/hgswift
- Owner: hgq287
- License: mit
- Created: 2019-08-06T10:07:38.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-07-05T09:56:01.000Z (11 months ago)
- Last Synced: 2025-07-12T08:51:59.295Z (11 months ago)
- Topics: alamofire, clean-architechture, grdb, swift, swiftpackage, swiftui, xcodegen
- Language: Swift
- Homepage:
- Size: 6.38 MB
- Stars: 4
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# HGSwift
Welcome to **HGSwift**, a Swift project template built with care to help you kickstart iOS and macOS apps using **Clean Architecture**. It's designed to give you a clean foundation with shared logic, modular structure, and easy setup using **XcodeGen**.
## Why HGSwift?
I created HGSwift to:
- Set up a solid, scalable Swift project structure in 30 minutes.
- Support both **iOS** and **macOS** with shared and platform-specific targets.
- Follow **Clean Architecture** principles out of the box.
- Automatically generate `.xcodeproj` using `XcodeGen`.
- Provide a script to clone the template into a new, ready-to-code project with customizable project name, author, and more.
## Project Structure
Here's a high-level look at the template structure:
```
HGSwift/
├── installer.swift
├── Makefile
├── LICENSE
├── CHANGLELOG.md
├── README.md
├── Out/ <-- Your project is placed here
│
└── Template/
├── project.yml <-- XcodeGen configuration
├── Makefile <-- Optional build/setup logic
├── codecov.yml <-- Code coverage config (optional)
├── configs/ <-- Build configs, environment settings
├── scripts/ <-- Utility scripts
├── Shared/ <-- Shared logic (networking, utils, etc.)
├── Tests/ <-- Unit tests
├── TPLProjectName/ <-- iOS/macOS app target (UI, AppDelegate, etc.)
├── TPLProjectNameCore/ <-- Core business logic, UseCases, Models
├── Vendors/ <-- External dependencies
└── TPLProjectName.xcodeproj <-- Xcode project (generated by XcodeGen)
```
> `TPLProjectName` and `TPLProjectNameCore` are placeholders. These will be replaced with your actual project name during the install process.
## How to Use
1. **Clone this repo:**
```bash
git clone https://github.com/hgq287/HGSwift.git
cd HGSwift
```
2. **Run the installer script:**
```bash
make install
```
The script will ask for:
- Project name
- Author
- Organization (optional)
It will then copy everything into a new folder and apply your custom names.
3. **Generate the Xcode project:**
```bash
cd `YOUR PROJECT`
xcodegen
```
Now open the `.xcodeproj` and start building 🚀
## Architecture Overview
This template follows **Clean Architecture**, including:
- **Core**: All business logic and domain models.
- **Shared**: Common code across platforms.
- **iOS/macOS targets**: Interactor layer, scenes, UI code.
- Clear separation of features
- Built to support testability and modular growth.
## Requirements
- Swift 5.0+
- macOS 15+
- [XcodeGen](https://github.com/yonaskolb/XcodeGen): `brew install xcodegen`
## Contributing
Feel free to open issues, suggest improvements, or submit pull requests. All contributions are welcome!
## License
MIT License – use it freely and feel free to credit if you find it helpful 🙌