An open API service indexing awesome lists of open source software.

https://github.com/rizaadi/valorantlab

Valorant app with Flutter, Clean Architecture, Modularization, Dependency Injection
https://github.com/rizaadi/valorantlab

clean-architecture dependency-injection flutter melos modularization valorant

Last synced: about 1 month ago
JSON representation

Valorant app with Flutter, Clean Architecture, Modularization, Dependency Injection

Awesome Lists containing this project

README

          





Valorantlab Logo

Valorantlab



Valorant information app


## About The Project

![Product Screenshota](thumnail.png)

This project is my exploration with Flutter to build an app that displays information about the game Valorant, including detail on Agents, Maps, Weapons, and more. The app fetches real-time data from the **[Valorant API](https://valorant-api.com/)** to provide up-to-date game information.f

The first version of this app originated from my college exam, as described [Here](https://www.rizaadikurniawan.com/project/valorantlab), and I later refactored it.

## ๐Ÿ—๏ธ Project Architecture

This project follows **Clean Architecture** principles and uses **Melos** for monorepo management. The architecture is organized into multiple packages:

### ๐Ÿ“ฆ Package Structure

```
valorantlab/
โ”œโ”€โ”€ ๐Ÿ“ฑ app (main) # Main Flutter application
โ”œโ”€โ”€ ๐ŸŽฏ features/ # Feature-specific packages
โ”‚ โ”œโ”€โ”€ agent/ # Agent feature (list, detail, management)
โ”‚ โ”œโ”€โ”€ home/ # Home screen and navigation
โ”‚ โ”œโ”€โ”€ maps/ # Maps feature (list, detail, callouts)
โ”‚ โ””โ”€โ”€ weapon/ # Weapon feature (list, detail, stats)
โ”œโ”€โ”€ ๐Ÿ“ฆ packages/ # Core infrastructure
โ”‚ โ””โ”€โ”€ core/ # Shared utilities, database, networking
โ””โ”€โ”€ ๐Ÿ”„ shared/ # Shared dependencies and resources
โ”œโ”€โ”€ dependencies/ # Common dependencies and configurations
โ””โ”€โ”€ i18n/ # Internationalization (EN/ID support)
```

### Built With

- [Flutter](https://flutter.dev/)
- [Clean Architecture](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html)
- [Melos](https://pub.dev/packages/melos)
- [Bloc State Management](https://pub.dev/packages/flutter_bloc)
- [Flutter Flavoriz](https://pub.dev/packages/flutter_flavorizr)
- [Flutter Launcher Icons](https://pub.dev/packages/flutter_launcher_icons)
- [Go Router](https://pub.dev/packages/go_router)
- [Get It](https://pub.dev/packages/get_it)
- [Isar Database](https://pub.dev/packages/isar)
- [Freezed](https://pub.dev/packages/freezed)
- [Dartz](https://pub.dev/packages/dartz)
- [Http](https://pub.dev/packages/http)
- [Flutter SVG](https://pub.dev/packages/flutter_svg)
- [Flutter Gen](https://pub.dev/packages/flutter_gen)
- [Equatable](https://pub.dev/packages/equatable)
- [Husky](https://pub.dev/packages/husky)
- [Commitlint](https://pub.dev/packages/commitlint_cli)

## ๐Ÿš€ Getting Started

### Prerequisites

- **Flutter SDK**: Latest stable version
- **Dart**: Comes with Flutter
- **Melos**: For monorepo management

### Quick Setup

1. **Clone the repository**

```sh
git clone https://github.com/rizaadi/valorantlab.git
cd valorantlab
```

2. **Install Melos globally**

```sh
dart pub global activate melos
```

3. **Setup development environment**

```sh
melos run dev:setup
```

4. **Start development**
```sh
melos run build:watch
```

## ๐Ÿ› ๏ธ Melos Commands Reference

This project uses **Melos** for comprehensive monorepo management. Here are all available commands:

### ๐Ÿš€ Quick Start Commands

| Command | Description |
| ----------------------- | -------------------------------------- |
| `melos bootstrap` | Setup all packages and dependencies |
| `melos run dev:setup` | Complete development environment setup |
| `melos run build:watch` | Start development with hot reload |
| `melos run dev:doctor` | Check development environment health |

### ๐Ÿงช Testing & Quality Assurance

| Command | Description |
| ---------------------------- | ------------------------------- |
| `melos run test` | Run all tests across packages |
| `melos run test:coverage` | Run tests with coverage reports |
| `melos run test:unit` | Run unit tests only |
| `melos run test:integration` | Run integration tests |
| `melos run test:watch` | Run tests in watch mode |
| `melos run verify` | Pre-commit quality checks |

### ๐Ÿ“ฆ Build & Release

| Command | Description |
| ----------------------------------- | ------------------------------------- |
| `melos run build` | Build production APK |
| `melos run build:dev` | Build development APK |
| `melos run build:apk` | Build Android APK (production) |
| `melos run build:appbundle` | Build Android App Bundle (Play Store) |
| `melos run build:appbundle:dev` | Build development App Bundle |
| `melos run build:appbundle:profile` | Build profile App Bundle |
| `melos run build:ios` | Build iOS app (production) |
| `melos run release` | Complete release workflow |

### ๐Ÿ”ง Development Tools

| Command | Description |
| --------------------------- | --------------------------------------- |
| `melos run analyze` | Run code analysis |
| `melos run lint` | Run stricter linting |
| `melos run lint:fix` | Auto-fix linting issues |
| `melos run format` | Format all Dart files |
| `melos run format:fix` | Fix formatting issues |
| `melos run generate` | Run code generation |
| `melos run generate:select` | Run code generation on selected package |
| `melos run generate:watch` | Code generation in watch mode |

### ๐ŸŽฏ Scoped Commands (Package-Specific)

| Command | Description |
| -------------------------- | --------------------------- |
| `melos run features:test` | Test only feature packages |
| `melos run features:build` | Build only feature packages |
| `melos run core:test` | Test only core packages |
| `melos run shared:test` | Test only shared packages |

### ๐Ÿ“Š Monitoring & Maintenance

| Command | Description |
| --------------------------- | --------------------------------- |
| `melos run metrics` | Generate code quality metrics |
| `melos run docs:generate` | Generate API documentation |
| `melos run docs:deps:graph` | Generate Mermaid dependency graph |
| `melos run docs:serve` | Serve documentation locally |
| `melos run security:check` | Security vulnerability audit |

### ๐Ÿ”„ Version Management

| Command | Description |
| ------------------------------ | ----------------------- |
| `melos run version:patch` | Bump patch version |
| `melos run version:minor` | Bump minor version |
| `melos run version:major` | Bump major version |
| `melos run version:prerelease` | Bump prerelease version |
| `melos run changelog:generate` | Generate changelog |

### ๐Ÿš€ CI/CD Integration

| Command | Description |
| --------------------- | -------------------------- |
| `melos run ci:setup` | Setup CI environment |
| `melos run ci:test` | Run CI tests with coverage |
| `melos run ci:build` | Build for CI deployment |
| `melos run ci:deploy` | Complete CI/CD pipeline |

### ๐Ÿงน Cleanup Commands

| Command | Description |
| ---------------------- | ------------------------------- |
| `melos clean` | Clean all packages |
| `melos run clean:deep` | Deep clean with generated files |
| `melos run dev:reset` | Reset development environment |

### โšก Performance & Optimization

| Command | Description |
| ------------------------ | --------------------- |
| `melos run perf:profile` | Build profile version |

### ๐Ÿ“‹ Package Management

| Command | Description |
| ------------------------- | --------------------------------- |
| `melos run get` | Get dependencies for all packages |
| `melos run deps:upgrade` | Upgrade all dependencies |
| `melos run deps:outdated` | Check for outdated dependencies |

## ๐Ÿ” Dependency Graph Analysis

### View Package Dependencies

You can analyze package relationships using melos commands:

```bash
# List all packages with details
melos list --long

# Show dependency graph as JSON
melos list --graph

# Generate visual dependency graph (Graphviz format)
melos list --gviz

# Check for dependency cycles
melos list --cycles
```

### ๐Ÿ”„ Dependency Graph

The dependency relationships between packages visualized using Mermaid:

```mermaid
graph TD
%% Package definitions
valorantlab["๐Ÿ  valorantlab
Main App"]
agent["๐ŸŽญ agent
Agent Feature"]
home["๐Ÿก home
Home Feature"]
maps["๐Ÿ—บ๏ธ maps
Maps Feature"]
weapon["โš”๏ธ weapon
Weapon Feature"]
core["๐Ÿ› ๏ธ core
Infrastructure"]
dependencies["๐Ÿ“ฆ dependencies
Shared Deps"]
i18n["๐ŸŒ i18n
Localization"]

%% Dependencies
valorantlab --> agent
valorantlab --> home
valorantlab --> maps
valorantlab --> weapon
valorantlab --> core
valorantlab --> dependencies
valorantlab --> i18n

agent --> weapon
agent --> core
agent --> dependencies
agent --> i18n

home --> core
home --> dependencies

maps --> core
maps --> dependencies
maps --> i18n

weapon --> agent
weapon --> core
weapon --> dependencies
weapon --> i18n

core --> agent
core --> home
core --> maps
core --> weapon
core --> dependencies
core --> i18n

%% Styling
classDef mainApp fill:#e1f5fe,stroke:#01579b,stroke-width:3px
classDef feature fill:#f3e5f5,stroke:#4a148c,stroke-width:2px
classDef infrastructure fill:#e8f5e8,stroke:#1b5e20,stroke-width:2px
classDef shared fill:#fff3e0,stroke:#e65100,stroke-width:2px

class valorantlab mainApp
class agent,home,maps,weapon feature
class core infrastructure
class dependencies,i18n shared
```

**Key Dependencies:**

- **Main App** โ†’ All features + core + shared packages
- **Features** โ†’ Core + shared packages for common functionality
- **Core** โ†’ Shared packages for base utilities
- **Shared** โ†’ No dependencies (foundation level)

### Understanding the Architecture

- **๐Ÿข Main App (`valorantlab`)**: Entry point that depends on all features and core packages
- **๐ŸŽฏ Feature Packages**: Independent features that can be developed separately
- `agent`: Manages agent-related functionality
- `home`: Handles home screen and navigation
- `maps`: Manages map information, callouts, and tactical details
- `weapon`: Manages weapon-related features
- **๐Ÿ› ๏ธ Core Package**: Shared infrastructure (database, networking, utilities)
- **๐Ÿ“ฆ Shared Packages**: Foundation-level packages
- `dependencies`: Common dependencies and configurations
- `i18n`: Internationalization support

## ๐Ÿ’ป Development Workflow

### Setting up Development Environment

1. **Initial Setup**

```bash
# Clone and setup
git clone https://github.com/rizaadi/valorantlab.git
cd valorantlab

# Install melos and setup environment
dart pub global activate melos
melos run dev:setup
```

2. **Daily Development**

```bash
# Start development server
melos run build:watch

# Run tests continuously
melos run test:watch

# Check code quality
melos run verify
```

3. **Before Committing**

```bash
# Format code
melos run format:fix

# Run all quality checks
melos run verify

# Run full test suite
melos run test:coverage
```

### Feature Development Process

1. **Create Feature Branch**

```bash
git checkout -b feature/new-feature
```

2. **Develop with Scoped Commands**

```bash
# Test only your feature
melos run features:test --scope=your-feature

# Build only your feature
melos run features:build --scope=your-feature
```

3. **Quality Assurance**

```bash
# Run comprehensive checks
melos run verify
melos run test:coverage
melos run analyze
```

4. **Prepare for Release**

```bash
# Version management
melos run version:patch

# Generate changelog
melos run changelog:generate

# Build release
melos run release
```

## ๐Ÿš€ CI/CD Integration

### GitHub Actions Example

Create `.github/workflows/ci.yml`:

```yaml
name: CI/CD Pipeline

on:
push:
branches: [main, develop]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.16.0"

- name: Setup Melos
run: dart pub global activate melos

- name: Setup CI Environment
run: melos run ci:setup

- name: Run Tests
run: melos run ci:test

- name: Build App
run: melos run ci:build

- name: Deploy
if: github.ref == 'refs/heads/main'
run: melos run ci:deploy
```

### Available CI Commands

| Command | Purpose | Usage |
| --------------------- | ---------------------- | --------------------------------- |
| `melos run ci:setup` | Prepare CI environment | Sets up packages and dependencies |
| `melos run ci:test` | Run CI tests | Executes tests with coverage |
| `melos run ci:build` | Build for deployment | Generates release builds |
| `melos run ci:deploy` | Deploy application | Full deployment pipeline |

## ๐Ÿ”ง Troubleshooting

### Common Issues

**1. Build Failures**

```bash
# Clean and reset everything
melos run clean:deep
melos run dev:reset

# Check environment
melos run dev:doctor
```

**2. Dependency Conflicts**

```bash
# Check for outdated packages
melos run deps:outdated

# Upgrade dependencies
melos run deps:upgrade
```

**3. Test Failures**

```bash
# Run tests with detailed output
melos run test:coverage

# Test specific packages
melos run features:test --scope=package-name
```

**4. Code Generation Issues**

```bash
# Clean and regenerate all packages
melos run build:clean
melos run generate

# Interactive package selection for generation
melos run generate:select
```

### Performance Tips

- Use scoped commands for faster development
- Run `melos run test:watch` during development
- Use `melos run build:watch` for hot reload
- Regular `melos run clean:deep` for optimal performance

## ๐Ÿ“‹ Roadmap

### โœ… Completed

- [x] Clean Architecture implementation
- [x] Dependency Injection with GetIt
- [x] Flutter Flavors (dev/prod)
- [x] Comprehensive Unit Testing
- [x] Modularization with Melos
- [x] Localization (EN & ID)
- [x] Melos monorepo management
- [x] Code quality automation
- [x] Comprehensive testing framework

### ๐Ÿšง In Progress

- [ ] Advanced CI/CD with deployment automation
- [ ] Publish to Play Store/App Store

### ๐Ÿ”ฎ Future Goals

- [ ] Performance optimization
- [ ] Widget testing expansion
- [ ] Performance monitoring and analytics
- [ ] Advanced security features

## License

Distributed under the MIT License. See [MIT License](https://github.com/rizaadi/valorantlab/blob/1c93f8261d7cb0c0bc2650b0ed6b8a9a5efeb716/LICENSE) for more information.

## Contact

[Riza Adi Kurniawan](https://www.linkedin.com/in/rizaadikurniawan/) - rizaadi890@gmail.com