ditojs / dito

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 – Developed at Lineto by Jürg Lehni and made available by Lineto in 2018 under the MIT license
https://lineto.com
MIT License
82 stars 8 forks source link
api declarative json koa objection rest server sql vue

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 developed at Lineto by Jürg Lehni, and was made available by Lineto in 2018 under the MIT license.

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:

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/index.js",
  "db:rollback": "dito db:rollback src/config/index.js",
  "db:reset": "dito db:reset src/config/index.js"
}

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: