Connecting Spotify to NFC tags for Home Automation! (Flutter App & Dart Server)
The project will later contain two independant codebases.
The mobile folder contains the Flutter App, which is the main part.
Navigate into the mobile folder.
You must first install Flutter.
Then, you can run flutter pub get to install the dependencies.
Finally, just run flutter run to start the App!
This part of the project is not yet started.
A friend shared this youtube video with me. Inspired by it, I wanted to build an App, that could write something onto NFC tags, so that they would start a Spotify Song / Playlist when being scanned.
Later this could be expanded by a Raspberry Pi server that syncs the phone data and is able to scan the NFC tags by itself. Then, a phoneless variant (like in the video) would be possible.
I'm using this App to assess three modules: Clean Code, Testing and Native Mobile Development. Accordingly, the App needs to:
- Write and read NFC tags
- Handle App Intents (Used for Auth & NFC-Tag reading)
- Store these Tag IDs in a Database
- Access the Spotify API
- Have a lot of tests (I'm doing TDD)
- Be well-refactored (Clean Code)
I'm following the TDD Clean Architecture for Flutter, as proposed by Reso Coder.
The app is divided into separate 'Features'. Every feature is divided into three 'Layers'. That looks like the following:
- /presentation
- /bloc (Container for the State)
- /pages (Widgets that are routed)
- /widgets (Most UI / All Widgets)
- /domain
- /usecases (Defines the Actions, that can be taken. Contains the main logic.)
- /entities (Abstract Data Models)
- /repositories (Abstract Collection of what Data needs to be accessed)
- /data
- /models (Implement the Entities, additional Conversion logic)
- /repositories (Implementation of the Abstract Repositories)
- /datasources (API Clients, Storage Handlers, Sensors, ...)
Each layer works completely independent and is therefore testable