Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

SimpleWorkJS

A model-first, real-time web application framework for Node.js. Define your data models once and get a working backend with auto-generated REST APIs, server-rendered UI, live WebSocket sync, and built-in RBAC.

Packages

Package Description Repo
@simpleworkjs/orm Base model-first ORM with Sequelize, Redis, and LDAP adapters. orm
@simpleworkjs/orm-identity Built-in identity/RBAC layer (User, Group, Role, Permission, AuthToken). orm-identity
@simpleworkjs/backend Express/Socket.IO framework, auto REST routes, server-rendered pages, CLI generator. backend
@simpleworkjs/frontend Browser-side JS: API wrapper, pubsub, socket, renderers, messages/confirmations. frontend
@simpleworkjs/conf Environment-aware configuration loader. conf

Golden Path

The fastest way to see SimpleWorkJS in action is the demo-todo starter app.

git clone git@github.com:simpleworkjs/demo-todo.git
cd demo-todo/app
npm install
npm start
# open http://localhost:3000
# admin / Changeme1!

Quick Start

Generate a new project from npm:

npx simpleworks generate my-app
cd my-app
npm install
npm start

Define a Model

// models/Task.js
const {Model} = require('@simpleworkjs/orm-identity');

class Task extends Model {
  static fields = {
    id: {type: 'uuid', primaryKey: true},
    title: {type: 'string', isRequired: true, max: 200},
    done: {type: 'boolean', default: false},
    createdBy: {type: 'hasOne', model: 'User'},
  };

  static permissions = {
    read: ['user'],
    create: ['admin'],
    update: ['admin', 'owner'],
    delete: ['admin'],
  };
}

module.exports = Task;

The framework automatically creates the database table, REST API, and server-rendered CRUD pages.

Architecture

@simpleworkjs/conf
        ^
        |
@simpleworkjs/orm
        ^
        |
@simpleworkjs/orm-identity
        ^
        |
@simpleworkjs/backend  +  @simpleworkjs/frontend
        ^
        |
   your app

Website

Documentation, examples, and getting-started guides: https://simpleworkjs.github.io

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors