Skip to content

pckimlong/kimapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

703 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Kimapp Monorepo

License: MIT

A comprehensive Flutter development toolkit that streamlines application development with Supabase integration, code generation, and architectural patterns. This monorepo contains multiple packages and tools that work together to provide a cohesive development experience.

πŸ“¦ Repository Structure

kimapp/
β”œβ”€β”€ packages/               # Core packages
β”‚   β”œβ”€β”€ kimapp/             # Main package with core utilities
β”‚   β”œβ”€β”€ kimapp_generator/   # Code generation package
β”‚   β”œβ”€β”€ kimapp_utils/       # Utility functions and extensions
β”‚   └── kimapp_supabase_helper/ # Supabase integration helpers
β”œβ”€β”€ pubs/                   # Additional published packages
β”‚   β”œβ”€β”€ autoverpod/         # Auto-generated Riverpod providers
β”‚   └── autoverpod_generator/ # Generator for autoverpod
β”œβ”€β”€ mason/                  # Mason bricks for code generation
β”‚   β”œβ”€β”€ kimapp/             # Core Kimapp brick
β”‚   β”œβ”€β”€ kimapp_feature/     # Feature generation brick
β”‚   β”œβ”€β”€ kimapp_simple_feature/ # Simplified feature brick
β”‚   β”œβ”€β”€ kimapp_feature_ui/  # UI components brick
β”‚   └── kimapp_package/     # Package template brick
β”œβ”€β”€ tools/                  # Development tools and scripts
└── template_generators/    # Custom code generators

πŸš€ Features

Core Packages

  • kimapp: Core utilities, widgets, and base classes
  • kimapp_generator: Code generation for models, repositories, and more
  • kimapp_utils: Utility functions and extensions
  • kimapp_supabase_helper: Helpers for Supabase integration

Code Generation

  • Schema-First Approach: Define database tables as Dart schemas
  • Type-Safe Models: Generate Freezed models from schemas
  • Repository Generation: Consistent repository pattern implementation
  • Form Generation: Streamlined form handling with validation

Mason Bricks

  • Feature Generation: Quickly scaffold new features with proper architecture
  • UI Components: Generate consistent UI components
  • Package Templates: Create new packages with proper structure

Development Tools

  • Melos Integration: Monorepo management with scripts for common tasks
  • Template Generators: Custom code generators for specific use cases

πŸ› οΈ Getting Started

Prerequisites

  • Flutter SDK (>=3.3.0)
  • Dart SDK (>=3.3.0)
  • Melos for monorepo management
  • Mason CLI for code generation

Setup

  1. Clone the repository:
git clone https://github.com/pckimlong/kimapp.git
cd kimapp
  1. Install Melos globally:
dart pub global activate melos
  1. Bootstrap the project:
melos bootstrap

This will install all dependencies and link local packages together.

Using Mason Bricks

  1. Install Mason CLI:
dart pub global activate mason_cli
  1. Get the bricks:
cd mason
mason get
  1. Generate a new feature:
mason make kimapp_feature --name user_management --table users

πŸ“‹ Development Workflow

Adding a New Feature

  1. Define your database schema using the schema-first approach
  2. Generate the feature using Mason:
mason make kimapp_feature --name feature_name --table table_name
  1. Implement the repository methods
  2. Create providers for state management
  3. Build the UI components

Running Code Generation

melos run build_all

This will run build_runner in all packages that depend on it.

Testing

melos run test

Formatting and Linting

melos run format
melos run analyze

🧩 Melos Commands

Melos provides several useful commands for managing the monorepo:

  • melos bootstrap: Set up the project
  • melos run update_deps: Update dependencies in all packages
  • melos run format: Format Dart code in all packages
  • melos run analyze: Run static analysis
  • melos run build_all: Run build_runner in all packages
  • melos run test: Run tests in all packages
  • melos run clean: Clean all packages
  • melos run publish_dry: Run a dry-run of publishing all packages
  • melos run publish: Publish all packages to pub.dev

πŸ“š Core Concepts

Schema-First Approach

Kimapp uses a schema-first methodology where database tables are defined as Dart schemas. These schemas generate type-safe models, repositories, and providers, ensuring alignment between the database and application code.

@TableStructure(
  'products',
  classPrefixName: 'Product',
  idColumn: 'ProductId:string',
  columns: [
    'name',
    'price:double',
    'description?',  // Optional field
    'category_id>Category',  // Foreign key
  ],
)
class ProductTable {}

Type Safety

  • Use type-safe ID classes for all ID fields
  • Foreign keys must reference the appropriate ID type
  • Leverage Freezed and fast_immutable_collections for immutable data structures

Feature Structure

Each feature includes:

  • Schema: Defines the database table and generates models
  • Repository: Manages CRUD operations and data access
  • Providers: Handles state management with Riverpod
  • Params: Specifies request parameters for operations

πŸ“„ License

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

πŸ™ Acknowledgements

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors