Core Concepts

How altseven applications are structured: the Application object, views, events and routing.

The architecture of an altseven application, and the concepts you need before building real features.

The Application object

Everything in altseven hangs off an Application instance. You create one at startup, pass it options, and export it so the rest of your code can use it:

import { Application } from "/lib/altseven/dist/a7.js";

export const myApp = new Application( {
	name: "myapp",
	security: { enabled: false }
} );

The instance name you choose (myApp here, a7 if you want the legacy name) becomes the namespace for your whole application. The Application constructor synchronously builds the module registry from your options; init() (called automatically when you construct the application) then initializes each module and, if security is enabled, awaits the authentication check before your code continues.

Property Module Purpose
myApp.log LogManager Leveled logging
myApp.model ModelManager Application-wide data store with undo/redo
myApp.remote RemoteManager AJAX fetch, remote modules, WebSockets
myApp.services ServiceManager Registry of your Service instances
myApp.dataproviders DataProviderManager Registry of DataProviders and their bindings
myApp.events EventManager Publish/subscribe topics
myApp.security SecurityManager Session/user state
myApp.router RouterManager URL routing (only if options.router is set)
myApp.ui UIManager View registry and render queue
myApp.error ErrorManager Global error capture
myApp.console Console Optional in-browser console
myApp.constants — Convention: your app-wide constants
myApp.user — Convention: the session user (when security is enabled)

ES modules

altseven is an ES modules project. The framework ships as a single ES module (dist/a7.js) that exports the classes you build with: Application, View, Entity, Service, DataProvider, and a few others. Your application code is also organized as ES modules — there is no bundler, so your server must serve each file and the browser resolves the import graph at load time.

my-app/
├── index.html
├── assets/
│   └── js/
│       ├── app.js          # bootstrap: Application, options, routes, top views
│       ├── entity/         # Entity subclasses (data schemas)
│       ├── service/        # Service subclasses (CRUD + caching)
│       ├── dataprovider/   # DataProvider subclasses (view state + bindings)
│       └── view/           # View factories (components)

Configuration options

Everything is configured through the options structure passed to the Application constructor — logging, authentication, remote endpoints, routing, UI behavior. All options have defaults, so {} is valid, but most real apps set at least remote, router and logging. The full reference is in Configuring Your Application.

Templating

Views render HTML with template literals. Template literal expressions (${ ... }) are plain JavaScript, so you can compute, filter and join inside templates without learning a template language. Interactivity is declared with data-on<event> attributes in the template and implemented in a parallel eventHandlers object on the view. See Views.

In This Section

  • Views — state, templates, event handlers, lifecycle
  • Events — publish/subscribe topics and conventions
  • Routing — URL routes, parameters, browser history

Views

The View class: state, templates, event handlers, children and the render lifecycle.

Events

The publish/subscribe event system and the conventions for using it well.

Routing

Client-side URL routing: route tables, parameters, and browser history.