https://github.com/ronanrodrigo/carbrito
Car average prices based on Fipe API
https://github.com/ronanrodrigo/carbrito
clean-architecture tdd
Last synced: about 1 month ago
JSON representation
Car average prices based on Fipe API
- Host: GitHub
- URL: https://github.com/ronanrodrigo/carbrito
- Owner: ronanrodrigo
- Created: 2017-08-10T02:54:41.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-30T04:39:35.000Z (almost 8 years ago)
- Last Synced: 2025-04-01T06:02:26.893Z (3 months ago)
- Topics: clean-architecture, tdd
- Language: Swift
- Homepage:
- Size: 182 KB
- Stars: 10
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Car 🐐
[](https://codebeat.co/projects/github-com-ronanrodrigo-carbrito-master) [](https://www.bitrise.io/app/6e4614b5869bfc76) [](https://codecov.io/gh/ronanrodrigo/carbrito)## Built with enviroment
- Xcode 9.0 beta 6
- Swift 4.0## Setup
1. If you does not have Cocoapod: `gem install cocoapod`
1. Install pods: `pod install`
1. Open `open Carbrito.xcworkspace`
1. To use fastlane: https://github.com/ronanrodrigo/carbrito/tree/master/Fastlane## Structure
```
┌──
│ ├── Core ───────────→ Itens without third party dependencies;
│ │ ├── Entities ───→ Entities from Clean Architecture. Is where all domain logic lives;
│ │ ├── Gateways ───→ Gateways protocols. Used to get data from anywhere;
│ │ ├── Presenters ─→ Presenter protocols. Used to present data from anywhere;
│ │ ├── Routers ────→ Routers protocols. Used to navigate to anywhere;
│ │ └── Usecases ───→ Usecase from Clean Architecture. Is where all app logic lives;
│ ├── Factories ──────→ Agnostic to Architecture. Used to symplify D.I. and object constructions;
│ ├── Controllers ────→ Just controller. Does not know about UI stuffs like events and elements;
│ ├── Gateways ───────→ Concrete implementation of gateways. Ex. knows about network or database;
│ ├── Routers ────────→ Concrete implementation of routers. Ex. knows about navigation controller;
│ └── Views ──────────→ UI elements and events are placed here;
├── Common ─────────────→ Shared stuffs accros modules;
└── Essentials ─────────→ Essential stuffs for the UIAppliction.
```## Main flow
```
┌→ View ─────────→ Controller ─────────→ Usecase ─────────→ Gateway?/Presenter? ┐
| View |
| Where user interaction are fired. Ex. Button tapped; |
| |
| Controller |
| Call usecase to execute user interaction; |
| |
| Usecase |
| Business logic; |
| |
| Gateway |
| Optional, used to get data from anywhere. Ex. Make a HTTP request. |
| Generaly injected in usecase; |
| |
| Presenter |
| Optional, used to present data to anywhere. Ex. Update view; |
| Generaly injected in usecase; |
└─────────────←──────────────────←───────────────←────────────────←─────────────┘
```🐐 Goat in Brazil is called by Cabrito.