Giter Club home page Giter Club logo

typesync's Introduction

Autogenerate Firestore model types for all platforms


PRs welcome! Typesync CLI is released under the AGPL-3.0-only license.

Typesync is an open-source schema management tool that simplifies managing Firestore databases. Typesync allows you to maintain a single source of truth for your Firestore architecture in a special schema. With this schema in place, you can seamlessly auto-generate type definitions for multiple platforms like TypeScript, Swift, Python, and more using the CLI tool.

Typesync keeps your database and application code consistent and up-to-date at all times. In addition to type definitions, it lets you generate other useful things like Security Rules, Mermaid graphs visualizing your database architecture and documentation for your data models.

View the full documentation (docs) ▸

header

Documentation

Explore our comprehensive documentation for detailed guides, usage examples, and additional resources. It covers everything from the basics to more advanced topics:

  • Introduction: Learn what Typesync is and its core features.
  • Installation: Instructions on how to install the Typesync CLI.
  • Quickstart: Get up and running with Typesync quickly.
  • Upgrading: Guidelines on upgrading to the latest version of the CLI.
  • Types: Details on the types supported by Typesync’s type system.

License

This project is made available under the AGPL-3.0 License.

typesync's People

Contributors

kafkas avatar seymurkafkas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

typesync's Issues

Implement `keyof` type

This will let users create enums from object keys. May also provide a way to create enums from discriminant literals (tbd).

Generation should fail for incorrect discriminant

The following definition doesn't produce an error when it should. Instead, the generator produces a simple union.

Pet:
  model: alias
  type:
    type: union
    discriminant: type
    variants:
      - type: object
        fields:
          type:
            type:
              type: literal
              value: dog
          breed:
            type: string
      - type: map
        of: string

Feature Request(s)

Hi - thanks for creating this project, was looking for something to help with this exact use case as have a mixed Python BE and TS FE using Firestore with both.

Have a few feature ideas that I hope help make the library more useful (some of which already have open "Issues" so are hopefully planned):

  • Right now I can only create a map as an Alias, and then use that to a Document - would be great to specify on the Document directly (dup of #87?)
  • An Unknown, or Any type would be really useful for more freeform schemas (dup of #57?)
  • Ability to support additional (typed or Any type) properties on a document, atm I am collecting them in a nested map but this makes the code more complex

Some nice to haves in the future,

  • Ability to use an existing Pydantic parent class or Config
  • Support for Firebase SERVER_TIMESTAMP

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.