Skip to content

Fullstack Web Overview & Project Structure

Orbita ships with a built-in fullstack meta-framework (ob:router, .html templates, ob:db, ob:cache, ob:crypto, and ob build --compile) designed around Laravel-style ergonomics and Django-style modular apps — with zero Node.js required.


Creating a New Web Project

ob init mini-blog --web
cd mini-blog

Start the development server with automatic Live Reload:

ob run --watch --allow-net --allow-read=. --allow-write=storage src/main.tyl

Open http://127.0.0.1:3000 in your browser. Any edit to .tyl, .html, .css, or .js files automatically restarts the server and refreshes the page.


Project Directory Structure

A fullstack Orbita project organizes features into self-contained apps inside src/apps/ (just like Django), while keeping build metadata separate from runtime config:

mini-blog/
├── ob.toml                          # Build & project manifest (dependencies, [embed])
├── config.toml                      # Runtime config (host, port, database path)
├── migrations/                      # Transactional SQL migrations (ob db migrate)
│   └── 20261130_create_posts.sql
├── public/                          # Static assets served with ETag + Cache-Control
│   ├── styles.css
│   └── app.js
├── storage/                         # Runtime data (SQLite database, uploads)
│   └── app.db
└── src/
    ├── main.tyl                     # App entry point (middlewares, static mounts, apps)
    └── apps/
        ├── auth/                    # Modular Auth app
        │   ├── model.tyl            # Users table & queries
        │   ├── middleware.tyl       # Session / cookie middleware
        │   ├── auth_test.tyl        # App tests (ob test)
        │   └── routes/              # Mounted at /auth
        │       ├── login.tyl
        │       ├── login.html
        │       └── logout.tyl
        └── posts/                   # Modular Posts app
            ├── model.tyl            # Posts table & queries
            ├── posts_test.tyl       # App tests (ob test)
            ├── components/          # Reusable UI components
            │   └── post_card/
            │       ├── post_card.tyl
            │       └── post_card.html
            └── routes/              # Mounted at /
                ├── _layout.tyl      # Shared layout loader
                ├── _layout.html     # Shared HTML shell (<slot />)
                ├── _404.html        # Custom 404 page
                ├── _error.html      # Custom 500 page
                ├── index.tyl        # GET / & POST /
                ├── index.html
                └── posts/
                    ├── [id].tyl     # GET /posts/:id
                    └── [id].html

Root Directories & Files

Path Role
ob.toml Project name, version, Git dependencies, and [embed] asset paths baked into compiled binaries.
config.toml Environment settings ([server], [database], custom keys). Overridable via HOST, PORT, and ORBITA_DB without recompiling.
migrations/ Ordered .sql migration files tracked in _orbita_migrations.
public/ Static files (CSS, JS, images). Automatically served with ETag, 304 Not Modified, and versioned via {{ asset('...') }}.
storage/ Local SQLite database and runtime files (gitignored).
src/main.tyl Wires middlewares (security_headers, csrf, rate_limit, auth), mounts static folders, mounts apps, and calls http.serve(app:handler()).
src/apps/<name>/ Self-contained feature module containing its own model.tyl, routes/, components/, middleware.tyl, and *_test.tyl.

Code Generators (ob g)

Just like Laravel Artisan or Rails generators, ob g scaffolds files following these conventions automatically:

ob g app posts                   # Creates src/apps/posts/{model.tyl, routes/, components/}
ob g route posts/index           # Creates index.tyl + index.html
ob g route posts/posts/[id]      # Creates dynamic route [id].tyl + [id].html
ob g component posts/post_card   # Creates post_card.tyl + post_card.html
ob g migration create_posts      # Creates migrations/<timestamp>_create_posts.sql

Ready to Build?

Follow our 5-part Django-style tutorial to build a complete Mini Blog from scratch — covering routing, SQLite models & JOINs, .html views & components, forms, Argon2id auth, ob:cache, interactive Islands, and single-file binary deployment:

→ Start Tutorial — Part 1: Project & Routing