BracketCove / SpaceNotes

SpacesNotes, by Ryan M. Kay, with inspiration from Martin Fowler, Robert C. Martin, and Darel Bitsy for architecture.
198 stars 113 forks source link

Please Note:

SpaceNotes

New to Kotlin? Whether you are a seasoned Java veteran, or you're just starting out with Kotlin for Android, consider checking out Application Programming Fundamentals w/ Kotlin. If you like my videos and repositories, I think you'll really enjoy a more polished course experience from wiseAss!

What is SpaceNotes?

SpaceNotes is a Kotlin based Android Application, which was built with best practices an innovation in mind. The app uses Coroutines for concurrency and cross-module/boundary communication, a Clean Domain Layer to allow the application to work properly across multiple platforms, and a few of my favourite APIs from Android Architecture Component and Firebase.

Software Architecture

Feature Specific (Front End Android):

NoteList Feature

Note List

This feature displays whatever Notes are currently available based on the user's status, such as: Anonymous, Registered Private, Registered Public

NoteDetail Feature

Note Detail

This feature allows the User to view, update, create, and delete a Note. Data is stored in various local/remote datasources based on whether the user is or isn't logged in, and if they are in public or private mode.

Login Feature

Login

This feature allows the User to authenticate with GoogleSignIn; which is currently the only supported sign in function. No passwords or in-app Sign up is required.

Note: I normally advocate against using Activities as Views, but I ran in to a tight-coupling problem with GoogleSignIn API (which requires you to override Activity.onActivityResult(...). Given this tight coupling, and the simplicity of this feature (it only has two buttons including the toolbar), I decided to just use the Activity as a pragmatic decision.

Common:

Domain:

The Domain Layer of this application has three primary purposes:

Packages:

Data (Android Back End):

The Data Layer of this application contains implementations of the data sources which are described in the repository package of the domain layer.

Auth:

Currently implemented with FirebaseAuth; manages user authentication.

Data Models:

API specific data models, which are mapped from/to domain models. Each data model is created for a particular API, such as Firestore and Room.

Note:

Implementations for the anonymous, registered private, and registered public data sources which persist Note objects.

Transaction:

Transaction is only used for registered private users. It's purpose is to store offline transactions that the user makes to their registered repository, and attempts to push those transactions when the user reconnects to the remote firestore database.

DataExt.kt:

Contains all of the obnoxious but necessary Data Model Mapping functions, and some Coroutine wrappers over Firebase/GMS Tasks API

Can I use code from this Repo?

Absolutely, pursuant to the project's LICENSE. That being said, the logo and name are my intellectual creations, so don't use them unless you are linking/reffering to this Repo.

Follow the rules in the license, and you're good.

Architecture Style:

This project uses Model-View-Whatever. It is the software architecture that has no particular style, yet accommodates all situations. In a less Zen way of speaking, I don't follow MVP, MVC, or MVVM strictly. I use parts of all styles of architectures based on whatever feature I'm creating, and that is what dictates the ultimate architecture of a given feature.

If you want me to explain in slightly more familiar terms, I basically apply MVP + VM as a front-end session datastore (such as arguments passed in from Activity Intents, current user states, current note to be displayed). I don't use ViewModels as Decision Maker Classes, hence the Logic class.

Contact/Support me:

Follow the wiseAss Community: https://www.instagram.com/wiseassbrand/ https://www.facebook.com/wiseassblog/ https://twitter.com/wiseass301 http://wiseassblog.com/ https://www.linkedin.com/in/ryan-kay-808388114

Support wiseAss here: https://www.paypal.me/ryanmkay

License