DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Stateless vs. Stateful Widgets: Make the Right Choice for Your Flutter App
  • Build Your Own AI Avatar App From Scratch in Less Than 8 Hours
  • The Technology Stack Needed To Build a Web3 Application
  • How To Use IBM App Connect To Build Flows

Trending

  • LLMs for Bad Content Detection: Pros and Cons
  • Database Monitoring: Key Metrics and Considerations
  • Demystifying Enterprise Integration Patterns: Bridging the Gap Between Systems
  • Agile Metrics and KPIs in Action
  1. DZone
  2. Culture and Methodologies
  3. Agile
  4. Build a Kanban TaskManager App in 10 Minutes

Build a Kanban TaskManager App in 10 Minutes

Use AllcountJS to utilize the power of Node.js to create a Kanban task management app.

Maxim Sorokin user avatar by
Maxim Sorokin
·
Sep. 06, 15 · Tutorial
Like (4)
Save
Tweet
Share
9.21K Views

Join the DZone community and get the full member experience.

Join For Free

Task management is one of the most important features for businesses. While there are many solutions for this problem, there's no silver bullet yet because each business field has its own specifics. Development of an application to meet specific requirements in this circumstance isn’t rare. AllcountJS allows you to build custom task management applications from scratch pretty quickly.

If you're unfamiliar with AllcountJS, check out this Getting Started guide first. While AllcountJS allows you to use all the power of Node.js, in this article we will work only with App Config code. In order to run demo code you should do npm install allcountjs-cli then allcountjs init or simply run code from our demo page here and you’ll get something like:

Image title

Model

Let’s start with model declaration. Probably the most important thing in task management is to have a task object (obviously) and some status flow. Let’s define our model in main.js:

A.app({
  appName: "Task manager",
  onlyAuthenticated: true,
  menuItems: [
    {
      name: "Planning",
      entityTypeId: "Task"
    }, {
      name: "Statuses",
      entityTypeId: "Status"
    }
  ],
  entities: function(Fields) {
    return {
      Task: {
        fields: {
          summary: Fields.textarea("Summary").required(),
          dueDate: Fields.date("Due Date").required(),
          status: Fields.fixedReference("Status", "Status")
        }
      },
      Status: {
        fields: {
          name: Fields.text("Name").required(),
          order: Fields.integer("Order").required()
        },
        referenceName: "name"
      }
    }
  }
});

This App Config produces a working application that has two entities: Task and Status. The task object has a summary and due date fields along with the status reference. The status entity has a name field used as a reference name while showing a combo box and an order field that will be used later to define the order of statuses. As you can see required fields are marked with .required(). It means entity couldn’t be created or saved until these fields are filled. Also you could note onlyAuthenticated flag which designates app couldn’t be accessed without authentication.

Order of Statuses

We could define our status priorities just by adding sorting: [['order', 1]], to the Statusentity type:

A.app({
  appName: "Task manager",
  onlyAuthenticated: true,
  menuItems: [
    {
      name: "Planning",
      entityTypeId: "Task"
    }, {
      name: "Statuses",
      entityTypeId: "Status"
    }
  ],
  entities: function(Fields) {
    return {
      Task: {
        fields: {
          summary: Fields.textarea("Summary").required(),
          dueDate: Fields.date("Due Date").required(),
          status: Fields.fixedReference("Status", "Status")
        }
      },
      Status: {
        fields: {
          name: Fields.text("Name").required(),
          order: Fields.integer("Order").required()
        },
        sorting: [['order', 1]],
        referenceName: "name"
      }
    }
  }
});

This declaration instructs AllcountJS to sort Status entity by order field in ascending order.

Board View

One of the most powerful AllcountJS features is the Views concept. View is an Entity too but as a storage it uses another entity. So there is an opportunity to create many multiple behaviors and visualizations for same data source. Let’s create a board view for our Task entity by adding following property

views: {
  TaskBoard: {
    customView: "board"
  }
}

And create new menu item to open the board:

{
  name: "Board",
  entityTypeId: "TaskBoard",
  icon: "bars"
}

Also we should create custom view board we reference (board.jade)

extends project/card-board
block panelBody
  .panel-body
    h4 {{item.summary}}
    p {{item.dueDate | date}}

AllcountJS uses jade template language by default. Code in board.jade defines template for custom view of our board. It defines panelBody block that describes how the card will look like. We should get following result for main.js

A.app({
  appName: "Task manager",
  onlyAuthenticated: true,
  menuItems: [
    {
      name: "Planning",
      entityTypeId: "Task"
    }, {
      name: "Board",
      entityTypeId: "TaskBoard",
      icon: "bars"
    }, {
      name: "Statuses",
      entityTypeId: "Status"
    }
  ],
  entities: function(Fields) {
    return {
      Task: {
        fields: {
          summary: Fields.textarea("Summary").required(),
          dueDate: Fields.date("Due Date").required(),
          status: Fields.fixedReference("Status", "Status")
        },
        views: {
          TaskBoard: {
            customView: "board"
          }
        }
      },
      Status: {
        fields: {
          name: Fields.text("Name").required(),
          order: Fields.integer("Order").required()
        },
        sorting: [['order', 1]],
        referenceName: "name"
      }
    }
  }
});

If you run this code sample you’ll see Kanban board with status where you can move cards between statuses. Order of statuses is defined by order field because of sorting.

Polishing

To polish things you probably want to add icons for menu items and the app. You could do it by simply referring to Font Awesome icons. Let’s add appIcon and icons for menu and we’ll get final version for the app.

A.app({
  appName: "Task manager",
  appIcon: "book",
  onlyAuthenticated: true,
  menuItems: [
    {
      name: "Planning",
      entityTypeId: "Task",
      icon: "tasks"
    }, {
      name: "Board",
      entityTypeId: "TaskBoard",
      icon: "bars"
    }, {
      name: "Statuses",
      entityTypeId: "Status",
      icon: "sort"
    }
  ],
  entities: function(Fields) {
    return {
      Task: {
        fields: {
          summary: Fields.textarea("Summary").required(),
          dueDate: Fields.date("Due Date").required(),
          status: Fields.fixedReference("Status", "Status")
        },
        views: {
          TaskBoard: {
            customView: "board"
          }
        }
      },
      Status: {
        fields: {
          name: Fields.text("Name").required(),
          order: Fields.integer("Order").required()
        },
        sorting: [['order', 1]],
        referenceName: "name"
      }
    }
  }
});

Try running this in our Demo Gallery.

app Kanban (development) Build (game engine)

Published at DZone with permission of Maxim Sorokin. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Stateless vs. Stateful Widgets: Make the Right Choice for Your Flutter App
  • Build Your Own AI Avatar App From Scratch in Less Than 8 Hours
  • The Technology Stack Needed To Build a Web3 Application
  • How To Use IBM App Connect To Build Flows

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: