A modern Android stock trading simulator app with real-time data integration, built with Kotlin, Jetpack Compose, and FastAPI.
- Real-time Stock Data: Integrates with Polygon.io API for live market data
- Smart Caching: Room database caches data for 1 hour to minimize API calls
- Modern UI: Dark fintech theme with Material Design 3
- Portfolio Management: Track your holdings and performance
- Trading Simulation: Buy and sell stocks with virtual money
- Offline Support: Works with cached data when offline
- UI Layer: Compose screens with Material Design 3
- Data Layer: Room database for local storage
- Network Layer: Retrofit for API communication
- Repository Pattern: Clean architecture with data caching
- MVVM: ViewModels for UI state management
- FastAPI: Async REST API server
- Polygon.io Integration: Real-time stock market data
- SQLite: Local data persistence and caching
- Smart Rate Limiting: Respects API limits with intelligent caching
cd api
uv sync
cp .env.example .env
# Edit .env and add your Polygon.io API key
uv run python main.py
- Sign up at polygon.io
- Get your free API key (2 calls/minute limit)
- Add to
api/.env
:POLYGON_API_KEY=your_key_here
# Build and install
./gradlew assembleDebug
adb install app/build/outputs/apk/debug/app-debug.apk
# Launch
adb shell am start -n com.madebycommon.commonsimulator/.MainActivity
- Cache Duration: 1 hour (as requested)
- Fallback: Shows cached data if API is unavailable
- Cleanup: Automatically removes data older than 7 days
GET /api/v1/stocks/watchlist
- Popular stocksGET /api/v1/stocks/quote/{symbol}
- Individual stock quoteGET /api/v1/stocks/search/{query}
- Search stocksPOST /api/v1/portfolio/trade
- Execute trades
- Dark Theme: Professional fintech appearance
- Color Palette: Vibrant greens for profits, reds for losses
- Typography: Clear, readable fonts optimized for financial data
- Loading States: Smooth loading indicators and error handling
- Responsive: Works on all screen sizes
- Kotlin 2.0.21 with Jetpack Compose
- Room 2.6.0 for local database
- Retrofit 2.9.0 for networking
- Material Design 3 for UI components
- FastAPI 0.116.1 for backend
- SQLAlchemy 2.0 for database ORM
- Android: API 24+ (Android 7.0)
- Java: JDK 11+
- Python: 3.11+
- uv: For Python dependency management
- Start Backend:
cd api && uv run python main.py
- Build Android:
./gradlew assembleDebug
- Install & Test: App connects to
http://10.0.2.2:8000
(emulator) - Hot Reload: FastAPI auto-reloads on code changes
- Add real-time portfolio value tracking
- Implement push notifications for price alerts
- Create detailed stock charts and analysis
- Add social features for sharing trades
- Implement advanced trading strategies
Built with ❤️ for the modern fintech experience