A comprehensive Flutter application for traders to record, analyze, and manage their trading activities offline with complete privacy and data control.
- Overview
- Features
- Tech Stack
- Prerequisites
- Installation & Setup
- Project Structure
- Architecture
- Development Workflow
- Building & Running
- Running with VSCode
- Testing
- Contributing
- Troubleshooting
- Project Status
TradeTrackr is a mobile and desktop application built with Flutter that serves as a comprehensive trading journal for traders. The app allows users to:
- Record and track all trading activities with detailed trade entries
- Analyze performance with profit/loss calculations and statistics
- Export/import data in CSV format for backup and migration
- Maintain complete privacy with offline storage using local SQLite database
- Access data across multiple platforms (Android, Linux, Web)
π For detailed feature specifications, see MVP Documentation
π For data schema details, see Data Schema
- First-time user setup with personal information
- Date/time format preferences
- Automatic timezone detection
- Welcome screens with feature introduction
- Record buy/sell trades with comprehensive details:
- Entry/exit dates and times
- Instrument/asset names
- Position sizes and prices
- Stop loss and take profit levels
- Entry reasons and additional notes
- Automatic profit/loss calculations
- Trade validation and data integrity
- Interactive trade history table
- Advanced filtering by date, instrument, and results
- Search functionality
- Sorting capabilities (ascending/descending)
- Comprehensive trade information display
- Performance metrics (P/L, risk/reward ratio, holding duration)
- Edit and delete trade functionality
- Psychological notes and market conditions
- Complete offline functionality
- CSV export/import for backup and migration
- Local SQLite database with Drift ORM
- Automatic and manual backup options
- Data integrity and security
- User profile management
- Backup settings (automatic/manual scheduling)
- Display preferences (date/time formats, themes)
- Notification settings
- Clean and intuitive interface using Shadcn UI
- Cross-platform compatibility (Android, Linux, Web)
- Responsive design for all screen sizes
- Dark/light theme support
- Flutter 3.35.5 - Cross-platform framework
- Dart 3.35.5 - Programming language
- Riverpod 3.0.0 - State management
- Go Router 16.2.1 - Navigation and routing
- Shadcn UI 0.31.8 - Modern UI component library
- SQLite - Local database
- Drift 2.29.0 - Type-safe SQL query builder and ORM
- Drift Flutter 0.2.7 - Flutter integration for Drift
- CSV - Data export/import functionality
- Path Provider 2.1.3 - File system access
- Permission Handler 11.3.1 - Platform permissions
- Freezed 3.2.3 - Code generation for immutable models
- JSON Serializable 6.11.1 - JSON serialization
- UUID 4.1.0 - Unique identifier generation
- Intl 0.20.2 - Internationalization and date formatting
- Logger 2.6.1 - Logging utility
- Riverpod Generator 3.0.0 - State management code generation
- Build Runner 2.7.1 - Code generation runner
- Custom Lint 0.8.0 - Custom linting rules
- Riverpod Lint 3.0.0 - Riverpod-specific linting
- Drift Dev 2.29.0 - Drift development tools
- flutter_test - Unit and widget testing
- Mockito 5.1.0 - Mocking framework
- Operating System: Android, Linux, Windows, macOS, or Web
- RAM: Minimum 4GB (8GB recommended)
- Storage: 500MB free space
- Display: 1280x720 or higher resolution
- Flutter SDK: Version 3.35.5 (exactly this version)
- Dart SDK: Compatible with Flutter 3.35.5
- VS Code (recommended) or Android Studio with Flutter extensions
- Git: Version control system
When using VSCode, install these recommended extensions for optimal development experience:
- Dart-Code.dart-code: Official Dart extension
- Dart-Code.flutter: Official Flutter extension
- ms-vscode.vscode-json: JSON language support
- redhat.vscode-yaml: YAML language support
- streetsidesoftware.code-spell-checker: Spell checking
- eamodio.gitlens: Enhanced Git capabilities
π‘ Tip: VSCode will automatically recommend these extensions when you open the project
Choose one of the following to manage Flutter versions:
git clone <repository-url>
cd trade_trackrChoose one option:
Option A: Using mise (Recommended)
# Install mise if not already installed
curl https://mise.jdx.dev/install.sh | sh
# Install Flutter 3.35.5
mise install flutter@3.35.5
mise use flutter@3.35.5Option B: Using fvm
# Install fvm globally
flutter pub global activate fvm
# Install Flutter 3.35.5
fvm install 3.35.5
fvm use 3.35.5flutter --version
# Should show: Flutter 3.35.5 β’ channel stableflutter pub getGenerate the necessary code for Riverpod, Freezed, and Drift using the following command:
dart run build_runner buildtrade_trackr/
βββ android/ # Android platform-specific code
βββ assets/ # Application assets (images, etc)
βββ docs/ # Documentation
β βββ data-schema.md # Data schema specification
β βββ mvp-tradetrackr.md # MVP feature specification
βββ fonts/ # Custom application fonts
βββ lib/ # Main application code
β βββ data/ # Data layer (Repositories & Datasources)
β β βββ datasource/ # Data source abstractions
β β β βββ local/ # Local persistence (Drift/SQLite)
β β βββ repository/ # Repository implementations
β βββ domain/ # Domain layer (Business Logic)
β β βββ entity/ # Immutable models & entities
β β βββ repository/ # Repository interfaces
β β βββ use_case/ # Business use cases
β βββ gen/ # Generated code/assets
β βββ presentation/ # Presentation layer (UI)
β β βββ page/ # Screen widgets
β β βββ provider/ # State management (Riverpod)
β βββ app.dart # Application configuration
β βββ app_observer.dart # Provider state observation
β βββ bootstrap.dart # App bootstrap logic
β βββ constants.dart # App-wide constants
β βββ main.dart # Main entry point
β βββ result.dart # Functional error handling
β βββ use_case.dart # Use case base classes
βββ linux/ # Linux platform-specific code
βββ test/ # Test suite
βββ web/ # Web platform-specific code
βββ analysis_options.yaml # Linting and analysis rules
βββ mise.toml # Version control settings
βββ pubspec.yaml # Dependencies management
βββ README.md # Project overviewThis project follows Clean Architecture principles with clear separation of concerns:
-
Presentation Layer (
lib/presentation/)- UI components and screens
- State management with Riverpod
- User interaction handling
-
Domain Layer (
lib/domain/)- Business logic and rules
- Use cases for application features
- Entity definitions (immutable data models)
-
Data Layer (
lib/data/)- Repository implementations
- Local database operations
- Data source abstractions
- Dependency Injection: Riverpod for dependency management
- Result Pattern:
Success<T>/Failed<T>for error handling - Repository Pattern: Abstraction over data sources
- Use Case Pattern: Business logic encapsulation
# Create a new feature branch
git checkout -b feature/your-feature-name
# Make changes following the architecture
# 1. Create/Update entities in domain/entity/
# 2. Create use cases in domain/use_case/
# 3. Implement repositories in data/repository/
# 4. Create providers in presentation/provider/
# 5. Build UI in presentation/page/
# Generate code after changes
dart run build_runner build
# Run tests
flutter test
# Commit changes
git add .
git commit -m "feat: add your feature description"# Watch mode for continuous code generation during development
dart run build_runner watch
# Clean and rebuild all generated code
dart run build_runner clean
dart run build_runner build -d# Run application
flutter run
# Build APK
flutter build apk# Run application
flutter run -d linux
# Build application
flutter build linux
# The built application will be in build/linux/x64/release/bundle/# Run application
flutter run -d chrome
# Build application
flutter build web
# The built web app will be in build/web/# Android APK
build/app/outputs/flutter-apk/app-release.apk
# Linux application
build/linux/x64/release/bundle/trade_trackr
# Web application
build/web/# Run on Android device/emulator
flutter run -d <android_device_id>
# Run on Linux
flutter run -d linux
# Run on Web (Chrome)
flutter run -d chromeThis project includes optimized VSCode configurations for easy development and debugging across all supported platforms.
- Install VSCode with Flutter and Dart extensions
- Install recommended extensions (see extensions recommendations above)
- Configure Flutter SDK path in VSCode settings for your version manager (mise/fvm)
The project includes a .vscode/launch.json file with optimized launch configurations for debugging across all supported platforms:
- "TradeTrackr": Standard debug mode for the application
- "TradeTrackr Linux": Debug mode for Linux platform
- "TradeTrackr Web": Debug mode for web platform
The project includes automated build tasks for different platforms:
- Flutter: Build APK: Build APK for Android
- Flutter: Build AppBundle: Build AAB bundle for Google Play Store
- Flutter: Build Linux App: Build application for Linux
- Flutter: Build Web: Build web app
- Open VSCode Command Palette (
Ctrl+Shift+P/Cmd+Shift+P) - Type "Tasks: Run Task"
- Select your desired build task from the list
- Open the project in VSCode
- Click the Run icon in the sidebar (play button with bug)
- Select "TradeTrackr" from the dropdown
- Click the green Play button or press
F5
- Open Command Palette:
Ctrl+Shift+P(Windows/Linux) orCmd+Shift+P(macOS) - Type: "Debug: Select and Start Debugging"
- Select your desired configuration
- Press Enter
- Open integrated terminal in VSCode:
Ctrl+Shift+ - Run:
flutter run
flutter run -d <device_id>flutter run -d linuxflutter run -d chromeF5: Start debugging with selected configurationCtrl+Shift+P/Cmd+Shift+P: Open Command PaletteCtrl+Shift+B/Cmd+Shift+B: Run build taskCtrl+S/Cmd+S: Save and auto-format
When running the app:
- Press
rin terminal for Hot Reload - Press
R(Shift+r) for Hot Restart - Press
Shift+F5to Stop debugging
# List available devices
flutter devices
# Run on specific Android device
flutter run -d <android_device_id>
# Run on Linux
flutter run -d linux
# Run on Web browser
flutter run -d chromeThe project includes several useful tasks accessible via Command Palette:
- Flutter: Clean: Clean build artifacts
- Flutter: Get Dependencies: Install/update dependencies
- Flutter: Generate Code: Run build_runner to generate code
- Flutter: Watch Code Generation: Continuous code generation during development
- Flutter: Analyze: Run static analysis
- Flutter: Run Tests: Execute unit tests
- Flutter: Run Tests with Coverage: Run tests with coverage report
- Flutter: Build APK: Build APK for production
- Flutter: Build AppBundle: Build AAB for Play Store
- Flutter: Build Linux App: Build for Linux platform
- Flutter: Build Web: Build web app for production
- Open Command Palette:
Ctrl+Shift+P - Type: "Tasks: Run Task"
- Select desired task from the list
- Check VSCode settings for correct Flutter SDK path
- Ensure mise/fvm is properly configured
- Restart VSCode
- Ensure device/emulator/browser is connected
- Ensure all dependencies are installed:
flutter pub get
Android:
- Ensure Android SDK is installed and configured
- Check device is connected and authorized
Linux:
- Ensure Linux development dependencies are installed
- Check for any missing system libraries
Web:
- Ensure Chrome/Firefox is installed
- Check for any web-specific dependency issues
- Open Extensions panel:
Ctrl+Shift+X - Install missing extensions manually
- Reload VSCode window:
Ctrl+Shift+Pβ "Developer: Reload Window"
# Run all tests
flutter test
# Run tests with coverage report
flutter test --coverage
# Run specific test file
flutter test test/some_test.dart
# Run tests with verbose output
flutter test -vtest/
βββ domain/
β βββ entity/ # Entity unit tests
β βββ use_case/ # Use case unit tests
βββ data/
β βββ repository/ # Repository implementation tests
βββ presentation/
β βββ provider/ # Provider tests
β βββ page/ # Page integration tests- Follow the existing code style and conventions
- Use meaningful variable and function names
- Add comments for complex business logic
- Ensure all code is null-safe
- Follow the established architectural patterns
- Create a feature branch from
main - Make your changes following the architecture
- Write or update tests for your changes
- Ensure all tests pass
- Update documentation if needed
- Create a pull request with a clear description
feat: add new trade recording feature
fix: resolve profit calculation bug
docs: update README installation guide
style: format code according to style guide
refactor: restructure trade repository
test: add unit tests for trade validation1. Flutter Version Issues
# Ensure correct Flutter version
flutter --version
# If using mise
mise use flutter@3.35.5
# If using fvm
fvm use 3.35.52. Code Generation Issues
# Clean and rebuild generated code
dart run build_runner clean
dart run build_runner build -d
# Check for build errors
flutter analyze3. Dependency Issues
# Clean dependencies
flutter clean
flutter pub get
# Update dependencies
flutter pub upgrade4. Android Build Issues
# Clean Android build
cd android
./gradlew clean
cd ..
# Accept Android licenses
flutter doctor --android-licenses5. VSCode Issues
# Reload VSCode window
Ctrl+Shift+P β "Developer: Reload Window"
# Check Flutter SDK path in VSCode settings
# File β Preferences β Settings β Search "flutter"
# Verify VSCode extensions are installed
# View β Extensions β Search for "flutter" and "dart"- Check the Issues page for known problems
- Review the MVP Specification for feature details
- See the Data Schema for data structure information
π§ Currently in MVP development phase
- β User Onboarding & Setup Awal: First-time user setup (Register flow implemented)
- π Input Trade Baru: Form for recording new trading transactions (Planned)
- π Daftar Jurnal Trading: Interactive trade history table (Planned)
- π Detail Trade: Comprehensive trade information display (Planned)
- π Export Data Manual ke CSV: Manual data export to CSV format (Planned)
- π Backup Otomatis Terjadwal: Scheduled automatic backup system (Planned)
- π Import Data CSV: Data import from CSV files (Planned)
- β Pengaturan Dasar: User preferences and application settings (Implemented)
- π UI Responsif & Minimalis: Shadcn UI integration (In Progress)
- β Architecture: Clean Architecture setup
- β Database: SQLite with Drift ORM implementation
- β State Management: Riverpod implementation
- β Cross-Platform: Android, Linux, and Web support
- β Offline Storage: Local data persistence
- β Testing: Unit tests for core functionality
- β Code Generation: Freezed and Riverpod generators setup
This project is licensed under the MIT License.
Developed by Tiga Satu Desember
Organization: io.tigasatudesember
TradeTrackr - Track smarter, trade better. π