arandu

command module
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 21 Imported by: 0

README

arandu

The Arandu project skeleton. This is what aru new clones — the equivalent of laravel/laravel, not of laravel/framework.

Nobody imports this repository. You clone it once and it is yours from then on, which is what lets the framework evolve without fighting the directory layout of older projects.

Layout

The eight directories of Laravel, in the same places and with the same names.

main.go                the entry point — public/index.php and artisan, merged
bootstrap/app.go       the whole composition of the application, explicit
config/                ten files, one per domain, each a typed struct
routes/web.go          the routes; routes/console.go the commands
app/Http/Controllers/  controllers, CamelCase files as in PSR-4
app/Models/            structs, no Active Record
app/Services/          business rules — does not exist in Laravel
app/Repositories/      data access, every method takes a Grant
app/Policies/          authorization — required, not recommended
database/              migrations, seeders, factories
resources/views/       kyse sources (.kyse.go) and the Go they compile to
resources/css/app.css  the Tailwind entry; resources/js/app.js is hand-written
public/                barely exists: assets are embedded in the binary
storage/               app/ and framework/ — there is no storage/logs
compose.yml            Postgres and Redis, for when you outgrow SQLite
.env.example           copy to .env

What is missing on purpose: vendor/, bootstrap/cache/, storage/logs/, package.json and node_modules/.

main.go dispatches the commands that need the registered modules: serve, migrate, migrate:rollback, migrate:status, migrate:fresh, routes, db:seed, schedule:list, schedule:run and work. aru delegates to this binary, because this binary is the one that knows which modules exist.

Getting started

Nothing to install: the default connection is SQLite, a file under database/.

cp .env.example .env
aru key:generate          # paste the line into .env
aru view:build            # compiles resources/views and the stylesheet
aru migrate
aru db:seed               # creates the first administrator
aru serve

No Node anywhere: aru view:build runs the kyse compiler, which is part of the CLI, and the standalone Tailwind binary, which the CLI downloads and pins in arandu.toml.

Moving to Postgres is .env and nothing else:

DB_CONNECTION=pgsql
DB_DATABASE=arandu
DB_HOST=127.0.0.1
DB_USERNAME=arandu
DB_PASSWORD=arandu

docker compose up -d starts Postgres and Redis when you want them locally.

Two things that are not like Laravel

No schema builder. A migration is SQL, written in the subset every supported database shares. Laravel needs a Blueprint because Eloquent hides the database; here the point is that nothing hides it.

A seeder is a type, not a class found by reflection. A seeder that drifts from the interface fails the build, rather than failing the first time someone runs it against production.

License

MIT, the same license Laravel uses. See LICENSE.md.

Documentation

Overview

Command arandu is the entry point of this application.

It is what Laravel splits between public/index.php and artisan: the binary is the server, and the same binary is the command line. There is no front controller and no document root, because in Go the process listens itself.

The wiring is not here. bootstrap/app.go composes the application and hands it back ready; this file decides which of the composed pieces the requested command needs, and starts it.

`aru serve` runs this binary with that argument, because only this binary knows which modules exist.

Directories

Path Synopsis
app
Http/Controllers
Package controllers holds this application's controllers.
Package controllers holds this application's controllers.
Models
Package models holds this application's domain types.
Package models holds this application's domain types.
Policies
Package policies holds this application's authorization decisions.
Package policies holds this application's authorization decisions.
Providers
Package providers holds this application's own modules.
Package providers holds this application's own modules.
Package assets carries what `aru view:build` compiled, into the binary.
Package assets carries what `aru view:build` compiled, into the binary.
Package bootstrap composes the application.
Package bootstrap composes the application.
Package config is this application's configuration, one file per domain -- the same ten files Laravel puts in config/, with the same names.
Package config is this application's configuration, one file per domain -- the same ten files Laravel puts in config/, with the same names.
database
factories
Package factories builds domain objects with sensible values.
Package factories builds domain objects with sensible values.
migrations
Package migrations holds this application's own schema changes.
Package migrations holds this application's own schema changes.
seeders
Package seeders holds the database seeders of this project.
Package seeders holds the database seeders of this project.
Package public serves the files a browser or a crawler asks for by a fixed path.
Package public serves the files a browser or a crawler asks for by a fixed path.
resources
Package routes is where this application declares what it answers.
Package routes is where this application declares what it answers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL