Coder Social home page Coder Social logo

ollisal / dito Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ditojs/dito

0.0 0.0 0.0 2.49 MB

Dito.js is a declarative and modern web framework with a focus on API driven development, based on Objection.js, Koa.js and Vue.js – Released in 2018 under the MIT license, with support by Lineto.com

License: MIT License

JavaScript 68.96% HTML 0.04% Vue 27.88% CSS 3.12%

dito's Introduction

Dito.js

Dito.js is a declarative and modern web framework with a focus on API driven development, based on Koa.js, Objection.js and Vue.js

Dito.js consists of two main components: Dito.js Server, providing all classes and methods to build the server architecture, and Dito.js Admin, a Vue.js library that can be used to build views and forms for administration of the Dito.js models in a very efficient fashion.

Both components share the key philosophy of the Dito.js framework: The use of declarative descriptions not only of the data structures themselves (the models), but also of the way they are remotely interacted with (the controllers), as well as the way they are edited (the admin views and forms).

This is then also the reason for the name Dito.js itself:

Ditto originally comes from the Latin word dictus, "having been said," the past participle of the verb dīcere, "to say." https://www.thefreedictionary.com/ditto

Dito.js was created by Jürg Lehni and released in 2018 under the MIT license, with support by Lineto.com.

Structuring a Dito.js Application

Unlike other frameworks, Dito.js is not opinionated about its folder structures and file naming, and does not deduce any information from such structures. With the exception of the creation of migration files, there aren't any generators that automatically create files for you.

There is however a recommended way to structure a Dito.js application, by dividing it into the following folder structure:

  • src/server: This folder contains the admin Dito.js Server app, along with all models and controllers in sub-folders:
    • src/server/models: The place where for the model classes.
    • src/server/controllers: The place for the controller classes.
  • src/admin: This folder contains a declarations of all admin views and forms
  • src/config: The application configuration files.
  • migrations: The folder holding all migration files.
  • seeds: The folder holding all seeds files.

This structure will be explained in more detail in the documentation of each these aspects separately:

Setting up package.json for a Dito.js Application

Dito.js server comes with its own CLI program, but it is rare to call it directly: Normally you simply set up a set of package.json scripts through which a selection of predefined tasks are executed:

"scripts": {
  "console": "dito console src/server/app",
  "db:seed": "dito db:seed src/server/app",
  "db:create_migration": "dito db:create_migration src/server/app",
  "db:migrate": "dito db:migrate src/config",
  "db:rollback": "dito db:rollback src/config",
  "db:reset": "dito db:reset src/config"
}

Note that in order to work, each of these scripts require either the path to the application, or the path to the application's configuration, as specified above. Here a brief description of each script's purpose:

  • yarn console: Starts an interactive Read-Eval-Print-Loop console in which all Dito.js models can be directly used.
  • yarn db:seed: Seeds the configured database with the data provided in seeds. See Seeds for more information.
  • yarn db:create_migration: Creates migration files for the specified models. See Migrations for more information.
  • yarn db:migrate: Migrates to the latest state of migrations. See Migrations for more information.
  • yarn db:rollback: Rolls back the last batch of applied migrations. See Migrations for more information.
  • yarn db:reset: Resets the database by rolling back all applied migrations, and then reapplying all available migrations. See Migrations for more information.

dito's People

Contributors

lehni avatar wirsing avatar fpatrik avatar rivertam avatar koskimas 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.