Getting Started - cynchro/OldSchoolFrontFrame GitHub Wiki
The fastest way to start a new app:
node cli/ols.js create starter myappThis creates a self-contained myapp/ folder:
myapp/
├── framework/ # Copy of the OLS core (read-only)
├── modules/
│ └── home/
│ ├── home.html
│ ├── home.js
│ └── home.css
├── index.html
├── app.js
└── config/
Serve it with any static server and open index.html.
Copy the framework/ folder into your project:
myproject/
└── framework/ ← copy this from OldSchoolFrontFrame/framework/
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>My App</title>
</head>
<body>
<nav>
<a href="#/home">Home</a>
<a href="#/about">About</a>
</nav>
<div id="app"></div>
<script type="module" src="app.js"></script>
</body>
</html>import { initApp } from './framework/app/init.js';
initApp({
root: '#app',
routes: {
home: 'home',
about: 'about',
},
fallback: 'home',
dev: true,
});modules/
└── home/
├── home.html
├── home.js
└── home.css (optional)
modules/home/home.html
<div>
<h1>Hello, <span data-bind="name"></span>!</h1>
<input data-model="name" placeholder="Your name" />
</div>modules/home/home.js
import { defineModule } from '../../framework/module/module.js';
defineModule({
state: () => ({
name: 'World',
}),
mounted(ctx) {
console.log('Home module loaded');
},
});python3 -m http.server 8080
# Open http://localhost:8080/| Option | Type | Default | Description |
|---|---|---|---|
root |
string | Element | #app |
Mount point selector or DOM element |
routes |
object | required | Map of routeKey → moduleFolderName
|
fallback |
string | first route | Route to load when hash is empty |
config |
string | object | — | Path to .json/.yaml config or options object |
store |
object | {} |
Initial global store state |
dev |
boolean | false |
Enable console logs and window.$ols
|
exposeEnv |
boolean | false |
Set window.ENV to loaded config |
-
Module System — deep dive into
defineModule() -
Declarative Bindings — all
data-*attributes - Router — dynamic parameters and navigation