Skip to content

vrndrkumar/vtrader-ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

VTrader - Trading Journal App

A comprehensive, production-ready Flutter application for managing trading journals across web, Android, and iOS platforms. Built with modern architecture patterns, responsive design, and extensible features.

๐Ÿš€ Features

Core Features (MVP)

  • โœ… Authentication System - Sign up, sign in, password reset with service abstraction
  • โœ… Responsive Navigation - Adaptive navigation for mobile, tablet, and desktop
  • โœ… Dark/Light Themes - System theme support with manual toggle
  • โœ… Local Storage - Offline-first data persistence with Hive
  • ๐Ÿ”„ Trade Journal - Add, edit, delete trades with filtering and grouping
  • ๐Ÿ”„ Trading Interface - Complex trade page with resizable chart and panels
  • ๐Ÿ”„ Broker Management - Connect and sync with multiple brokers
  • ๐Ÿ”„ Analytics Dashboard - Performance metrics and trade analysis

Technical Features

  • โœ… Modern Architecture - Clean architecture with Riverpod state management
  • โœ… Design System - Consistent UI components and design tokens
  • โœ… Type Safety - Comprehensive data models with JSON serialization
  • โœ… Responsive Design - Mobile-first design with tablet and desktop support
  • ๐Ÿ”„ Testing - Unit tests, widget tests, and CI/CD pipeline
  • ๐Ÿ”„ API Integration - RESTful API client with error handling and retry logic

๐Ÿ—๏ธ Architecture

Project Structure

lib/
โ”œโ”€โ”€ core/                           # Core functionality
โ”‚   โ”œโ”€โ”€ constants/                  # App-wide constants
โ”‚   โ”œโ”€โ”€ theme/                     # Design system (colors, typography, themes)
โ”‚   โ”œโ”€โ”€ router/                    # Navigation and routing
โ”‚   โ””โ”€โ”€ widgets/                   # Core reusable widgets
โ”œโ”€โ”€ features/                      # Feature modules
โ”‚   โ”œโ”€โ”€ auth/                      # Authentication
โ”‚   โ”œโ”€โ”€ dashboard/                 # Dashboard and overview
โ”‚   โ”œโ”€โ”€ trade/                     # Trading and journal features
โ”‚   โ””โ”€โ”€ broker/                    # Broker management
โ”œโ”€โ”€ shared/                        # Shared across features
โ”‚   โ”œโ”€โ”€ models/                    # Data models
โ”‚   โ”œโ”€โ”€ services/                  # Business logic services
โ”‚   โ”œโ”€โ”€ repositories/              # Data access layer
โ”‚   โ””โ”€โ”€ widgets/                   # Reusable UI components
โ””โ”€โ”€ main.dart                      # App entry point

Architecture Patterns

  • Clean Architecture - Separation of concerns with clear boundaries
  • Repository Pattern - Abstraction layer for data access
  • Provider Pattern - State management with Riverpod
  • Service Layer - Business logic abstraction
  • MVVM - Model-View-ViewModel pattern for UI

๐Ÿ› ๏ธ Setup & Installation

Prerequisites

  • Flutter SDK (>=3.10.0)
  • Dart SDK (>=3.0.0)
  • Android Studio / VS Code
  • Git

Installation Steps

  1. Clone the repository

    git clone <repository-url>
    cd vtrader
  2. Install dependencies

    flutter pub get
  3. Generate code

    flutter packages pub run build_runner build
  4. Run the app

    # Web
    flutter run -d chrome
    
    # Android
    flutter run -d android
    
    # iOS (macOS only)
    flutter run -d ios

Development Setup

  1. Enable code generation watch mode

    flutter packages pub run build_runner watch
  2. Run tests

    flutter test
  3. Analyze code

    flutter analyze

๐ŸŽจ Design System

Design Tokens

  • Colors - Primary, secondary, semantic colors with light/dark variants
  • Typography - Inter font family with consistent text styles
  • Spacing - 8px grid system for consistent spacing
  • Breakpoints - Mobile (โ‰ค450px), Tablet (451-800px), Desktop (โ‰ฅ801px)

Components

  • AppButton - Consistent button styling with variants
  • AppInput - Form inputs with validation and accessibility
  • ThemeToggleButton - System/light/dark theme switcher
  • MainLayout - Responsive navigation shell

Responsive Design

  • Mobile - Bottom navigation with hamburger menu
  • Tablet - Navigation rail with compact layout
  • Desktop - Persistent sidebar navigation with full features

๐Ÿ” Authentication

Mock Authentication Service

The app includes a mock authentication service for development and testing:

Demo Credentials:

  • Email: demo@vtrader.in
  • Password: password123

Service Abstraction

The authentication system is designed with abstraction in mind:

  • AuthService - Abstract base class
  • MockAuthService - Development implementation
  • Easy to swap with Firebase Auth, REST API, or other providers

Features

  • Sign up with email/password
  • Sign in with session persistence
  • Password reset flow
  • Profile management
  • Secure session storage

๐Ÿ’พ Data Management

Local Storage

  • Hive - Primary local database for offline-first architecture
  • SharedPreferences - User preferences and settings
  • Secure Storage - Authentication tokens and sensitive data

Data Models

  • UserModel - User profile and preferences
  • TradeModel - Trading transactions with P&L calculations
  • BrokerModel - Broker connections and sync settings
  • StrategyModel - Trading strategies with risk management
  • PositionModel - Current market positions

Data Flow

  1. UI Layer - Widgets and pages
  2. State Layer - Riverpod providers and notifiers
  3. Service Layer - Business logic and validation
  4. Repository Layer - Data access abstraction
  5. Storage Layer - Local database and preferences

๐Ÿ”„ State Management

Riverpod Architecture

  • Providers - Dependency injection and state management
  • StateNotifiers - Complex state management with immutable updates
  • FutureProviders - Async data loading with error handling
  • StreamProviders - Real-time data updates

Key Providers

  • themeModeProvider - Theme state management
  • routerProvider - Navigation configuration
  • authStateProvider - Authentication state
  • tradesProvider - Trade data management

๐Ÿ“ฑ Platform Support

Web

  • Responsive design for desktop and mobile browsers
  • PWA capabilities (future enhancement)
  • URL-based routing with deep linking

Android

  • Material Design 3 components
  • Adaptive layouts for phones and tablets
  • Android-specific optimizations

iOS

  • Cupertino design elements where appropriate
  • iOS-specific navigation patterns
  • Safe area handling

๐Ÿงช Testing Strategy

Test Types

  • Unit Tests - Business logic and data models
  • Widget Tests - UI components and interactions
  • Integration Tests - End-to-end user flows

Test Structure

test/
โ”œโ”€โ”€ unit/                          # Unit tests
โ”‚   โ”œโ”€โ”€ models/                    # Data model tests
โ”‚   โ”œโ”€โ”€ services/                  # Service layer tests
โ”‚   โ””โ”€โ”€ utils/                     # Utility function tests
โ”œโ”€โ”€ widget/                        # Widget tests
โ”‚   โ”œโ”€โ”€ components/                # Component tests
โ”‚   โ””โ”€โ”€ pages/                     # Page tests
โ””โ”€โ”€ integration/                   # Integration tests
    โ””โ”€โ”€ flows/                     # User flow tests

Running Tests

# All tests
flutter test

# Unit tests only
flutter test test/unit

# Widget tests only
flutter test test/widget

# Integration tests
flutter test integration_test

๐Ÿš€ Deployment

Web Deployment

# Build for web
flutter build web --release

# Deploy to hosting service
# (Firebase Hosting, Netlify, Vercel, etc.)

Android Deployment

# Build APK
flutter build apk --release

# Build App Bundle
flutter build appbundle --release

iOS Deployment

# Build for iOS
flutter build ios --release

# Archive and upload via Xcode

๐Ÿ”ง Configuration

Environment Variables

Create .env file in project root:

API_BASE_URL=https://api.vtrader.in/v1
SENTRY_DSN=your_sentry_dsn
ANALYTICS_KEY=your_analytics_key

Build Flavors

  • Development - Local development with mock data
  • Staging - Testing environment with staging APIs
  • Production - Live environment with production APIs

๐Ÿ“ˆ Performance

Optimization Strategies

  • Lazy Loading - Load data and widgets on demand
  • Image Caching - Efficient image loading and caching
  • State Optimization - Minimal rebuilds with Riverpod
  • Bundle Splitting - Code splitting for web builds

Monitoring

  • Performance metrics tracking
  • Error reporting with Sentry (future)
  • Analytics with Firebase Analytics (future)

๐Ÿ”ฎ Future Enhancements

Phase 2 Features

  • Real-time chart integration
  • Broker API integrations (Zerodha, Upstox, etc.)
  • Advanced analytics and reporting
  • Trade strategy backtesting
  • Social features and community
  • Mobile notifications
  • Export/import functionality
  • Multi-language support

Technical Improvements

  • Comprehensive test coverage (>90%)
  • CI/CD pipeline with GitHub Actions
  • Performance monitoring
  • Accessibility improvements
  • Offline-first synchronization
  • Real-time data streaming

๐Ÿค Contributing

Development Workflow

  1. Fork the repository
  2. Create a feature branch
  3. Make changes with tests
  4. Run linting and tests
  5. Submit pull request

Code Standards

  • Follow Flutter/Dart style guide
  • Write comprehensive tests
  • Document public APIs
  • Use meaningful commit messages

Pull Request Template

  • Description of changes
  • Testing approach
  • Screenshots (for UI changes)
  • Breaking changes (if any)

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ†˜ Support

Documentation

Community

๐Ÿ™ Acknowledgments

  • Flutter team for the amazing framework
  • Riverpod for excellent state management
  • Material Design team for design system
  • Open source community for packages and inspiration

Built with โค๏ธ using Flutter

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages