Giter VIP home page Giter VIP logo

wsb-trendies's Introduction

Trendies

Lightweight Open-Source WallStreetBets Monitor

Android AndroidAPI Kotlin JetpackCompose CodeFactor


Lightweight, fast, and open-source monitoring of r/wallstreetbets for Android ๐Ÿ“ฑ๐Ÿ“ˆ No Ads, no trackers.

Table of Contents

Visual Overview

๐Ÿ“Š Trending Stocks Overview

Trending on WallStreetBets

This view showcases the trending stocks on r/WallStreetBets with their sentiment indicators. Users can view at a glance which stocks are being discussed the most and the overall sentiment (bullish/bearish) for each.

๐Ÿ“ˆ Detailed Stock Insights

Stock Detailed View

Dive deeper into any stock to see its performance chart, essential details, and recent comments from the r/WallStreetBets community. This provides a comprehensive look at the stock's current sentiment and market data.

Features

  • Trending: up-to-date list of the trending stock tickers mentioned on the r/wallstreetbets subreddit.
  • Details: view comments, sentiment, and market details for each trending stock.
  • Lightweight: Stores data locally and updates them automatically only when needed, minimizing network data and battery consumption.
  • Designed for Android: The User Interface has been designed following the latest Google's Material Design guidelines, using only native Android components and animations.

Installation

To install and run Trendies on your device, follow these steps:

  1. Clone the repository.
  2. Open the project in Android Studio.
  3. Run the app on your emulator or physical device.

Usage

After installation, open the app and:

  • Browse trending stock tickers from the main screen.
  • Tap on any ticker to view its detailed insights.

Technical Details

  • 100% Jetpack Compose ๐Ÿš€: The app's UI is entirely built using the modern declarative UI toolkit Jetpack Compose, ensuring a consistent and updated user interface experience.

  • Material Design 3 ๐Ÿ’Ž: The latest material design principles have been implemented, ensuring a modern and sleek user experience.

  • MVVM Architecture: The app follows the Model-View-ViewModel architectural pattern, promoting separation of concerns and making the codebase modular and easier to maintain.

  • Networking with Retrofit: Data from r/WallStreetBets is fetched using the Retrofit library, coupled with OkHttp for efficient HTTP requests.

  • Data Persistence with Room: The app uses the Room library for data persistence, ensuring efficient data storage and retrieval with an SQLite backend.

  • Performance Optimizations: The app employs efficient data structures and algorithms, along with caching mechanisms, to ensure smooth performance even with large volumes of data.

  • Other Libraries: Additional tools and libraries used include Glide for image loading and Dagger Hilt for dependency injection, streamlining development and ensuring efficient operations.

Contribution

Contributions are welcomed! If you have suggestions or issues, please open a GitHub issue. If you'd like to improve the code or add a feature, please send a pull request.

License

This project is licensed under the MIT License. See the LICENSE.md file for details.

Acknowledgments

  • Special thanks to Philipp Lackner for his amazing video guides and tutorials on Android development.

wsb-trendies's People

Contributors

xmcnulty avatar

Watchers

 avatar

wsb-trendies's Issues

Separate Get and Refresh List

Separate getTrendingStocks and refreshCache in the repository implementation. This is a better practice. If the cache is empty when calling getTrendingStocks, refreshCache will be called from getTrendingStocks, loading which will populate the cache. getTrendingStocks will always return from the cache. Additionally, a new use case will be needed for refreshing the data that is displayed to the user. Ex.

getTrendingStocks
`
if(stocks.isNotEmpty() {
return stocks
}

refreshCache()

return dao.getTrendingStocks() `

refreshCache

` dao.clearAll()

val stocks = api.getTrendingStocks()

dao.insertAll(stocks) `

Fetch Chart Data

Implement fetching of chart data from remote api. Data will be stored in Room database as single source of truth.

Implement Use Case for Market Overview Data

Room repository will act as single source of truth for this data. Implement use cases and repository functions for fetching data from remote API, storing, updating and fetching locally.

NullPointerException on some calls to IntradayDataDto.toIntradayData

When running the app and selecting "EV" from the list, the below NullPointerException is thrown. It appears the Dto returned from the repository is null. It is unclear if it is null because the body of the response from the API is empty or if there is an issue with Gson parsing.

java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Set java.util.Map.entrySet()' on a null object reference
at io.xavier.topwsb.domain.mapper.IntradayDataMapperKt.toIntradayData(IntradayDataMapper.kt:55)
at io.xavier.topwsb.data.repository.IntradayDataRepositoryImpl.getIntradayData(IntradayDataRepositoryImpl.kt:19)
at io.xavier.topwsb.data.repository.IntradayDataRepositoryImpl$getIntradayData$1.invokeSuspend(Unknown Source:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7898)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@7e68393, Dispatchers.Main.immediate]

Invalid Tickers from Tradestie Api

It appears the tradestie API mistakes some strings in comments for tickers when they are not. Which leads to a NullPointerException being thrown:

"Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter ticker"

This occurs when mapping the DTO to a StockOverview object because there was no data returned ... the stock doesn't actually exist.
Need to figure out a way to handle this.

Fix: Build Warning for Wsb_Comments Room Table

C:\Users\xmcnu\StudioProjects\top-wsb-tickers-android\app\build\tmp\kapt3\stubs\debug\io\xavier\topwsb\domain\model\WsbComment.java:20: warning: ticker_trending_stock column references a foreign key but it is not part of an index. This may trigger full table scans whenever parent table is modified so you are highly advised to create an index that covers this column.

@Entity( tableName = TABLE_NAME_COMMENTS, foreignKeys = [ForeignKey( entity = TrendingStockEntity::class, parentColumns = arrayOf(TICKER_STOCK_COL_NAME), childColumns = arrayOf(TICKER_STOCK_COL_NAME), onDelete = CASCADE )] ) data class WsbComment( @PrimaryKey(autoGenerate = true) @ColumnInfo(name = "comment_id") val id: Int, @ColumnInfo(name = TICKER_STOCK_COL_NAME) val ticker: String, val text: String, val createdUtc: Long, val author: String, val link: String )

Cache Top Stocks in Room Database

When data is returned from the tradestie api, store it in a room database. When loading from the data first check the room database and update with new data from the api if necessary.

Change chart to intraday

Because this app shows comments for a trending stock in a day- change the price chart to display the intraday data for that day. In the case of a weekend or banking holiday, show the chart for the last trading day.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.