Skip to content

DzzD/appcorejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AppCore<sub>JS</sub> logo

AppCoreJS Framework

AppCoreJS is a layered framework for Node.js applications.

The rule is strict:

project -> app -> core

core is internal. app is the mandatory interface. Project code uses app, never core directly.


Quick Start

Minimal full command (all layers):

npx app-core --back --server --front --model --project myProject --dbuser appcore --dbpassword appcore --dbname appcore

Generated structure (current directory):

./core/
./app/
./myProject/
./myProject/public/
./server.js
./index.js

Run the server:

node server.js

Open:

  • http://127.0.0.1:3000

Global Concept

core

  • internal engine
  • framework internals
  • not intended to be used directly

app

  • framework interface
  • mandatory entry point
  • place to adapt framework behavior globally

project (./<project>/)

  • business code
  • business models, queries, server components, frontend components/screens
  • uses app only

Fundamental rule:

project -> app -> core

Never:

project -> core

AppCore<sub>JS</sub> Architecture


Why app is mandatory

app is your control layer. You can change framework behavior without patching core.

Example: global save rule in app/db/DbObject.js.

import { CoreDbObject } from '../../core/db/CoreDbObject.js';

export class DbObject extends CoreDbObject
{
    async save(forceInsert = false)
    {
        if ('updatedAt' in this)
        {
            this.updatedAt = new Date();
        }

        return await super.save(forceInsert);
    }
}

This check is functional. It applies only when the model has updatedAt.


Project Vision

./core/
./app/
./myProject/
  db/
  server/
  public/
  • core/: framework internals.
  • app/: framework interface layer.
  • myProject/: business layer.

Domain Overview

Backend

  • ORM classes are exposed through app/db/*.
  • project models are in ./<project>/db/models/.

Server

  • server base class is app/server/Server.js.
  • project server extends it in ./<project>/server/.

Frontend

  • frontend root is ./<project>/public/.
  • public/core: frontend engine.
  • public/app: frontend interface.
  • public/components and public/screens: project UI code.
  • public/ext: generated only with --front --ext (or --front --intro).
  • public/intro: generated only with --front --intro.

Models

  • generated with --model.
  • app model classes generated in ./<project>/db/models/.
  • core base model classes generated in ./core/db/models/.

Documentation

Start here:

Direct access:


Author

Bruno Augier (aka DzzD)

About

AppCoreJS is a framework for building Node.js / PostgreSQL / HTML5 / CSS / JavaScript applications.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors