Convert Figma logo to code with AI

airbnb logomavericks

Mavericks: Android on Autopilot

5,821
500
5,821
61

Top Related Projects

A framework for building native applications using React

164,677

Flutter makes it easy and fast to build beautiful apps for mobile and beyond

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.

⚡ Empowering JavaScript with native platform APIs. ✨ Best of all worlds (TypeScript, Swift, Objective C, Kotlin, Java, Dart). Use what you love ❤️ Angular, Capacitor, Ionic, React, Solid, Svelte, Vue with: iOS (UIKit, SwiftUI), Android (View, Jetpack Compose), Dart (Flutter) and you name it compatible.

A framework for building native Windows apps with React.

32,626

An open-source framework for making universal native apps with React. Expo runs on Android, iOS, and the web.

Quick Overview

Mavericks is an open-source project by Airbnb that provides a framework for building and deploying machine learning models at scale. It aims to simplify the process of creating, training, and serving ML models in production environments, with a focus on scalability and ease of use.

Pros

  • Streamlines the ML workflow from development to production
  • Supports various ML frameworks and model types
  • Provides built-in monitoring and versioning capabilities
  • Offers scalable deployment options for high-traffic applications

Cons

  • Steep learning curve for newcomers to ML operations
  • Limited documentation and community support compared to more established tools
  • May require significant infrastructure setup for optimal performance
  • Primarily tailored for large-scale applications, potentially overkill for smaller projects

Code Examples

# Define a simple model using Mavericks
from mavericks import Model, Feature

class SimpleModel(Model):
    input_feature = Feature(dtype=float)
    output_feature = Feature(dtype=float)

    def predict(self, input_feature):
        return input_feature * 2
# Train and deploy the model
from mavericks import Trainer, Deployer

model = SimpleModel()
trainer = Trainer(model)
trainer.train(training_data)

deployer = Deployer(model)
deployer.deploy(environment='production')
# Serve predictions using the deployed model
from mavericks import Client

client = Client('simple_model')
prediction = client.predict(input_feature=5.0)
print(f"Prediction: {prediction}")

Getting Started

To get started with Mavericks, follow these steps:

  1. Install Mavericks:

    pip install mavericks
    
  2. Create a new Mavericks project:

    mavericks init my_project
    cd my_project
    
  3. Define your model in model.py:

    from mavericks import Model, Feature
    
    class MyModel(Model):
        # Define your model here
        pass
    
  4. Configure your project in mavericks.yaml:

    model: MyModel
    version: 1.0.0
    environment: development
    
  5. Train and deploy your model:

    mavericks train
    mavericks deploy
    

For more detailed instructions and advanced usage, refer to the Mavericks documentation.

Competitor Comparisons

A framework for building native applications using React

Pros of React Native

  • Larger community and ecosystem, with more third-party libraries and resources
  • Cross-platform development for both iOS and Android from a single codebase
  • Backed by Facebook, ensuring long-term support and regular updates

Cons of React Native

  • Steeper learning curve for developers not familiar with React
  • Performance can be slower than native development for complex applications
  • Requires additional configuration and native modules for certain platform-specific features

Code Comparison

React Native:

import React from 'react';
import { View, Text } from 'react-native';

const App = () => (
  <View>
    <Text>Hello, React Native!</Text>
  </View>
);

Mavericks:

import Mavericks

class ViewController: UIViewController, MavericksView {
    var viewModel: ViewModel!
    
    func render(_ state: ViewState) {
        // Update UI based on state
    }
}

Summary

React Native is a popular cross-platform framework for mobile app development, while Mavericks is an iOS-specific architecture for building robust applications. React Native offers broader platform support and a larger ecosystem, but may have performance trade-offs. Mavericks provides a more native experience for iOS but is limited to that platform. The choice between the two depends on project requirements, team expertise, and target platforms.

164,677

Flutter makes it easy and fast to build beautiful apps for mobile and beyond

Pros of Flutter

  • Cross-platform development for mobile, web, and desktop from a single codebase
  • Rich set of pre-designed widgets for faster UI development
  • Hot reload feature for quick iteration and testing

Cons of Flutter

  • Larger app size compared to native applications
  • Steeper learning curve for developers new to Dart language
  • Limited access to some platform-specific features

Code Comparison

Flutter (Dart):

class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Text('Hello, Flutter!'),
    );
  }
}

Mavericks (Swift):

struct MyView: View {
    var body: some View {
        Text("Hello, Mavericks!")
    }
}

Flutter offers a more widget-based approach to UI development, while Mavericks follows SwiftUI's declarative syntax. Flutter's code tends to be more verbose but provides fine-grained control over UI elements. Mavericks leverages Swift's concise syntax and type inference for cleaner, more readable code.

Flutter is a comprehensive framework for cross-platform development, whereas Mavericks focuses on iOS app architecture. Flutter's ecosystem is larger and more diverse, supporting multiple platforms. Mavericks, being tailored for iOS, provides a more native feel and potentially better performance for iOS apps.

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.

Pros of Ionic Framework

  • Cross-platform development: Build mobile, desktop, and web apps from a single codebase
  • Large ecosystem: Extensive library of UI components and plugins
  • Active community: Regular updates and strong developer support

Cons of Ionic Framework

  • Performance: May lag behind native apps for complex, graphics-intensive applications
  • Learning curve: Requires knowledge of web technologies and Angular/React/Vue
  • Limited native functionality: Some advanced device features may require additional plugins

Code Comparison

Ionic Framework (TypeScript):

import { Component } from '@angular/core';

@Component({
  selector: 'app-home',
  template: '<ion-content>Hello Ionic!</ion-content>'
})
export class HomePage {}

Mavericks (Swift):

import ComposableArchitecture

struct AppState: Equatable {}
struct AppAction: Equatable {}

let appReducer = Reducer<AppState, AppAction, AppEnvironment> { state, action, _ in
  return .none
}

Key Differences

  • Ionic Framework is a cross-platform solution, while Mavericks focuses on iOS development
  • Ionic uses web technologies, whereas Mavericks is based on Swift and the Composable Architecture
  • Ionic offers a wider range of pre-built UI components compared to Mavericks
  • Mavericks provides a more native iOS experience and potentially better performance for iOS-specific apps

⚡ Empowering JavaScript with native platform APIs. ✨ Best of all worlds (TypeScript, Swift, Objective C, Kotlin, Java, Dart). Use what you love ❤️ Angular, Capacitor, Ionic, React, Solid, Svelte, Vue with: iOS (UIKit, SwiftUI), Android (View, Jetpack Compose), Dart (Flutter) and you name it compatible.

Pros of NativeScript

  • Cross-platform development for iOS and Android using JavaScript or TypeScript
  • Direct access to native APIs and UI components
  • Large ecosystem of plugins and extensions

Cons of NativeScript

  • Steeper learning curve compared to Mavericks
  • Potentially larger app size due to framework overhead
  • Performance may not be as optimized as native development

Code Comparison

NativeScript (XML and TypeScript):

<Page>
  <StackLayout>
    <Label text="Hello, NativeScript!" />
    <Button text="Tap me" tap="onTap" />
  </StackLayout>
</Page>
export function onTap() {
  console.log("Button tapped!");
}

Mavericks (Swift):

struct ContentView: View {
    var body: some View {
        VStack {
            Text("Hello, Mavericks!")
            Button("Tap me") {
                print("Button tapped!")
            }
        }
    }
}

While NativeScript offers cross-platform development with JavaScript/TypeScript, Mavericks focuses on native iOS development using Swift and SwiftUI. NativeScript provides a more flexible approach for targeting multiple platforms, but Mavericks offers tighter integration with iOS-specific features and potentially better performance for iOS-only apps.

A framework for building native Windows apps with React.

Pros of React Native Windows

  • Enables development of native Windows applications using React Native
  • Actively maintained by Microsoft with frequent updates
  • Large community and extensive documentation

Cons of React Native Windows

  • Limited to Windows platform, less cross-platform flexibility
  • Steeper learning curve for developers unfamiliar with Windows development
  • May have performance limitations compared to native Windows development

Code Comparison

React Native Windows:

import { NativeModules } from 'react-native';
const { WindowsModule } = NativeModules;

WindowsModule.showNativeDialog('Hello from Windows!');

Mavericks:

import Mavericks

class ViewModel: MavericksViewModel<ViewState> {
    fun fetchData() {
        // Fetch data and update state
    }
}

Key Differences

  • React Native Windows focuses on Windows app development, while Mavericks is a Swift framework for iOS
  • React Native Windows uses JavaScript/TypeScript, Mavericks uses Swift
  • React Native Windows provides a bridge to native Windows APIs, Mavericks offers state management for iOS apps

Use Cases

  • React Native Windows: Developing Windows desktop applications using React Native
  • Mavericks: Building iOS applications with a robust state management system

Community and Support

  • React Native Windows: Large community, backed by Microsoft
  • Mavericks: Smaller community, maintained by Airbnb
32,626

An open-source framework for making universal native apps with React. Expo runs on Android, iOS, and the web.

Pros of Expo

  • Larger and more active community with over 15,000 GitHub stars and frequent updates
  • Comprehensive documentation and extensive learning resources
  • Supports a wide range of React Native development features and tools

Cons of Expo

  • Larger project size and potentially slower build times
  • Some limitations on native module access without ejecting
  • May include unnecessary features for simpler projects

Code Comparison

Expo (app.json configuration):

{
  "expo": {
    "name": "MyApp",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    }
  }
}

Mavericks (example usage):

struct CounterState: MaverickState {
    var count: Int = 0
}

class CounterViewModel: MaverickViewModel<CounterState> {
    func increment() {
        setState { state in
            state.count += 1
        }
    }
}

Note: The code comparison is limited due to the different nature and purposes of these projects. Expo focuses on React Native development, while Mavericks is a Swift framework for iOS app architecture.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Build Status Maven Central codecov.io

Mavericks (formerly MvRx): Android on Autopilot

For full documentation, check out our docs site.

Mavericks is the Android framework from Airbnb that we use for nearly all product development at Airbnb.

When we began creating Mavericks, our goal was not to create yet another architecture pattern for Airbnb, it was to make building products easier, faster, and more fun. All of our decisions have built on that. We believe that for Mavericks to be successful, it must be effective for building everything from the simplest of screens to the most complex in our app.

This is what it looks like:


data class HelloWorldState(val title: String = "Hello World") : MavericksState

/**
 * Refer to the wiki for how to set up your base ViewModel.
 */
class HelloWorldViewModel(initialState: HelloWorldState) : MavericksViewModel<HelloWorldState>(initialState) {
    fun getMoreExcited() = setState { copy(title = "$title!") }
}

class HelloWorldFragment : Fragment(R.layout.hello_world_fragment), MavericksView {
    private val viewModel: HelloWorldViewModel by fragmentViewModel()

    override fun invalidate() = withState(viewModel) { state ->
        // Update your views with the latest state here.
        // This will get called any time your state changes and the viewLifecycleOwner is STARTED.
    }
}

Installation

Gradle is the only supported build configuration, so just add the dependency to your project build.gradle file:

dependencies {
  implementation 'com.airbnb.android:mavericks:x.y.z'
}

The latest version of mavericks is Maven Central

For full documentation, check out the docs site

Legacy documentation for MvRx 1.x can still be found in the wiki