Skip to content
/ fluent Public

Readable query Interface & API generator for JS and Node

License

Notifications You must be signed in to change notification settings

goat-io/fluent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

712 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Stargazers Issues MIT License Commitizen friendly


Logo

GOAT-FLUENT

Fluent - Time Saving (TS) utils
Explore the docs Β»

Β· Report Bug Β· Request Feature

Goat - Fluent (Monorepo)

A comprehensive TypeScript ecosystem for building data-driven applications with unified query interfaces, multi-database support, and extensive utilities for Node.js and browser environments.

πŸš€ Quick Start

# Install the core package
pnpm add @goatlab/fluent

# Install specific database connectors
pnpm add @goatlab/fluent-firebase  # For Firebase/Firestore
pnpm add @goatlab/fluent-loki      # For in-memory database
pnpm add @goatlab/fluent-pouchdb   # For PouchDB

# Install utilities
pnpm add @goatlab/js-utils         # Browser/Node utilities
pnpm add @goatlab/node-utils       # Node.js specific utilities

πŸ“¦ Packages

Core Query Interface

  • @goatlab/fluent - TypeScript query builder and ORM wrapper with multi-database support via TypeORM
  • @goatlab/fluentjs - JavaScript implementation of the Fluent query interface

Database Connectors

Utilities

Task Processing & Queues

Cloud Services

API Integrations

Development Tools

πŸ—„οΈ Supported Databases

Via TypeORM Connector (@goatlab/fluent)

  • PostgreSQL
  • MySQL / MariaDB
  • SQLite
  • Microsoft SQL Server
  • Oracle
  • MongoDB
  • CockroachDB
  • SAP Hana
  • sql.js

Native Connectors

  • Firebase / Firestore
  • LokiJS (in-memory)
  • PouchDB (offline-first)
  • Form.io (API-based)

πŸ—οΈ Architecture

This monorepo follows a modular architecture with:

  • Unified Query Interface: All database connectors implement the same Fluent API
  • Type Safety: Full TypeScript support with Zod schema validation
  • Decorator-based Entities: Define your models using decorators
  • Extensible Connectors: Easy to add new database support
  • Monorepo Structure: Managed with pnpm workspaces and Turbo

πŸ› οΈ Development

# Install dependencies
pnpm install

# Build all packages
pnpm build

# Run tests
pnpm test

# Run development mode
pnpm dev

# Lint code
pnpm lint

πŸ“ Example Usage

import { Fluent, TypeOrmConnector } from '@goatlab/fluent'
import { z } from 'zod'

// Define your schema
const UserSchema = z.object({
  id: z.string(),
  name: z.string(),
  email: z.string().email(),
  age: z.number().optional()
})

// Create a repository
class UserRepository extends TypeOrmConnector<User> {
  constructor() {
    super({
      entity: User,
      dataSource: myDataSource
    })
  }
}

// Use the Fluent API
const users = await userRepo
  .where({ age: { $gte: 18 } })
  .orderBy({ name: 'ASC' })
  .limit(10)
  .find()

🚒 Release Process

This monorepo uses Changesets for versioning and publishing.

# Create a changeset
pnpm changeset

# Version packages
pnpm changeset version

# Build and publish
pnpm changeset publish

Release dependency chain: js-utils β†’ node-utils β†’ fluent β†’ other packages

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Ignacio Cabrera - @twitter_handle - ignacio.cabrera@goatlab.io

Acknowledgments

This library is based on the work of other Authors and Open Source Libraries. Have a look at them and give them a well deserved Star ⭐!

About

Readable query Interface & API generator for JS and Node

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 6