Code Monkey home page Code Monkey logo

tordojs's Introduction

Let's build amazing things more quickly and with less code.

Join the community on GitHub Discussions

TordoJS

We're building features to help developers to create awesome database using Fauna.

📦 Install

With yarn

yarn add tordo.js

With NPM

npm install tordo.js

📚 Documentation

For full documentation, visit tordojs.com.

⚡️ Quick start

At first, you need to create your collections

import { BaseCollection, field } from 'tordo.js'

export class User extends BaseCollection {
  @field()
  name: string

  @field()
  email: string
}

After that, we need create new file tordo/config.ts to put our collection and allow use commands to migrate or see the database state, for example.

import { TordoCLI } from 'tordo.js'
import { User } from 'collections/User'

/**
 * This is your Source of Truth.
 *
 * TordoJS require know all your collections.
 * To make any update in your database is required add first in this file.
 *
 */
const tordoCLI = new TordoCLI()

// add all your collections here
tordoCLI.add(User)

tordoCLI.runCommand(process.argv)

Migration

One of the best features are allow you to use command line to manage your database.

for now, is required you use ts-node to run the commands.

// some configurations you need create one tsconfig.tordo.json
{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "module": "commonjs"
  }
}

//change your package.json and add this command.
{
  scripts:  {
    "tordo": "TS_NODE_PROJECT='./tordo/tsconfig.tordojs.json' ts-node ./tordo/config.ts"
  }
}

Now we can use tordo commands

#this command create, update and delete your collections and indexes
yarn tordo migration
# allow you to see collections and indexes created in your database.
yarn tordo list

Environment Variables

# boolean. Default is true
TORDO_FAUNADB_LOCAL=

# string. Need be CLASSIC, EUROPE or USA. Default is CLASSIC when use cloud database.
FAUNADB_REGION=

# string. Key to use your cloud database. Default is secret to allow you use fauna docker
FAUNADB_KEY=

Community

For help, discussion about best practices, or any other conversation that would benefit from being searchable:

Discuss TordoJS on GitHub

Status

  • Dev: We are developing the main features.
  • Alpha: We are testing TordoJS with internal projects.
  • Public Beta: Stable enough for most use-cases
  • Public: Production-ready

tordojs's People

Contributors

irvile avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.