/todolist-on-herbs

A sample Todo List app using Herbs

Primary LanguageJavaScriptOtherNOASSERTION

Node.js CI

What's Herbs?

Herbs is an open source library for backend applications. It is focused on achieving faster deliveries and with happier developers, without neglecting the long-term need to constantly evolve your application as requirements change.

See more on the website: https://herbsjs.org/

Getting Started with TO DO list on Herbs

Within this repository, you will find a front-end application, made in react consuming a back-end application, using Herbs, the API is made in graphQL

Todolist on Herbs

This is a example on how to build a backend application using Herbs.

Using

$ npm install
$ npm run knex:migrate
$ npm start

You should receive this message => 🚀 Server UP and Running in port: 4000

VSCode launchers (launch.json) are also available.

Postgresql setup

  1. Change knexfile.js and src\infra\config\dev.json connection info.

  2. Run migration:

$ npx knex migrate:latest --env development

Herbs Shelf

View all the use cases and its steps in just one place.

Herbs Shelf: http://localhost:4000/herbsshelf

Documentation dynamically generated by herbsshelf.

GraphQL

GraphQL Playground: http://localhost:4000/graphql

GraphQL dynamically generated by herbs2gql.

Rest

Express routes dynamically generated by herbs2rest.

Herbs REPL

View all the use cases your termnal.

$ node ./src/infra/repl

REPL dynamically generated by Herbs REPL.

Settings

Environment:

.env.{environment} files.

Rename one of the files to just .env.

Default is dev. Also check for HERBS_EXCEPTION env variable.

Config:

Edit /backend/infra/config/{environment}.json files if necessary.

Diagram

classDiagram
    class Item {
        Number id
        String description
        Boolean isDone
        Number position
    }
    class ToDoList{
        Number id
        String name
        Item[] items
        isEmpty()
        lastPosition()
    }

    ToDoList "1" --> "*" Item

How to contribute

If you would like to help contribute to this repository, please see CONTRIBUTING

License