← Tous les utilitaires

NSRAD

Version 26.1 (build 376) Essai 30 jours

Cette documentation n’existe pas encore en français : affichage en anglais.

NSRAD
Sommaire

What NSRAD is

nsrad is Nacarsoft’s rapid web application development framework, written in Go and targeting database environments (ADABAS, Oracle, PostgreSQL, SQLite, DB2). Applications are defined with YAML files — forms, listings, dynamic menus and REST-API services — plus scheduled tasks (crontab), without repetitive coding. Access control is role-based (RBAC: users, groups, roles and permissions).

Application, file and data names in the examples are fictional.

Use cases

1. Management application on ADABAS with forms and listings

Create a maintenance app (e.g. a fictional policy-admin) on the configured ADABAS file.

./build/nsrad init /tmp/myproject
./build/nsrad start /tmp/myproject
# → listening on http://127.0.0.1:9090

Web flow (http://localhost:9090, admin / admin123): create the application under apps/, define its screens (forms, listings) in YAML, point to the configured database or a Natural entity, and browse the dynamic menus in the browser.

2. Exposing business data as a JSON REST-API

Expose an entity (e.g. fictional customers) as an endpoint with authentication and role control.

curl -s -X POST http://localhost:9090/api/auth/login \
  -H 'Content-Type: application/json' \
  -d '{"username":"admin","password":"admin123"}'

Web flow: define the entity in the application YAML; consume GET /api/<app>/<entity> with the JWT from login; each role authorizes specific actions on applications and data.

3. Automating a nightly report with scheduled tasks

Generate a nightly report or sync (e.g. a fictional policy summary) via the application crontab.

./build/nsrad status /tmp/myproject
# → nsrad is running (PID 12345) — listening on http://127.0.0.1:9090

Web flow: declare the task (report, sync) in the application YAML; check the environment logs/ to confirm the scheduled run completed.

4. Multi-language prototype with several environments

Run development and production environments with the same binary and serve the UI in Spanish and English.

./build/nsrad init /tmp/dev && ./build/nsrad start /tmp/dev
./build/nsrad init /tmp/prod && ./build/nsrad start /tmp/prod
./build/nsrad status /tmp/prod

Web flow: adjust i18n.supported_languages and ui.default_theme in each config.yaml; verify language and theme in the browser; stop with ./build/nsrad stop /tmp/dev.

Interface

Main menu

Development environment

Reference

CLI commands (verified with --help, v1.0.0 build 679)

Command / flagDescription
init [dir]Initialize a new environment (config.yaml + db/ + logs/, plus themes/, apps/, certs/, i18n/)
start [dir]Start the server in background
stop [dir]Stop the background server
status [dir]Status: running/not running, PID, uptime, memory, URL and config in use
licenseShow license status and exit
--config <dir>Alias for [dir] (environment directory, not a file)
--version, -vShow version and build info
--help, -hShow help

Note: the reference manual lists --direnv, --port, --host, --start/--stop/--restart flags; the real binary uses init/start/stop/status subcommands with a positional [dir]. Follow this table.

Main config.yaml options (see config.example.yaml)

OptionDescription
server.portHTTP port (default 9090)
server.read_timeout / write_timeout / shutdown_timeoutServer timeouts
server.logo_path, app_name, copyrightHeader branding
security_db.pathSecurity SQLite (db/security.db): users, groups, roles
auth.jwt_secretJWT secret — change it in production (or AUTH__JWT_SECRET env var)
auth.jwt_expiry / refresh_expiryToken (15m) and refresh (24h) lifetimes
auth.ldap_enabled, ldap_host, ldap_port, ldap_base_dnOptional LDAP authentication
smtp.*Mail for password reset and notifications (host, port, username, password, from, security)
logging.log_dir, level, keep_daysLog directory and retention
mdi.max_open_tabs, tab_state_cookieConcurrent MDI desktop tabs
maps.source, yaml_path, keyboard.*Map source and shortcuts (F3 close, F5 refresh, F6 new, F8 next)
i18n.default_language, supported_languagesLanguages (en, es, fr, de, it, pt) and language cookie
menu.max_depthMaximum menu depth
ui.default_theme, theme_cookieDefault theme and theme cookie
pagination.default_page_size, max_page_sizePagination (20 / 100)
ai.enabled, provider, model, api_key, base_urlBuilt-in AI assistant
license.trial_daysTrial period in days (30)

Environment layout (mydata/): config.yaml (port, themes, database), apps/ (platform applications), repositories/ (Natural/ADABAS objects).

Web UI areas

AreaWhat it does
LoginAuthentication (initial admin/admin123); issues the JWT used by the API (POST /api/auth/login)
MDI desktopConcurrent work tabs (mdi.max_open_tabs limit), state persisted in a cookie
Dynamic menusNavigation across applications and screens defined in apps/ (menu.max_depth depth)
Forms and listingsRecord create, edit and query against the configured database or Natural entities
REST-APIEntities exposed as GET /api/<app>/<entity> JSON, with authentication and roles
Scheduled tasksReports and syncs declared in the application YAML (application crontab)
RBAC administrationManagement of users, groups, roles and permissions over applications and data
Themes and languagesTheme (ui) and language (i18n: en, es, fr, de, it, pt) selectors

Commented examples

# 1. New environment and startup (uses ./mydata if present and no [dir] given)
./build/nsrad init /tmp/myproject
./build/nsrad start /tmp/myproject
./build/nsrad status /tmp/myproject

# 2. Health check and API login
curl -s http://localhost:9090/api/health
curl -s -X POST http://localhost:9090/api/auth/login \
  -H 'Content-Type: application/json' \
  -d '{"username":"admin","password":"admin123"}'

# 3. License status and version
./build/nsrad license
./build/nsrad --version

# 4. Two environments with the same binary
./build/nsrad init /tmp/prod && ./build/nsrad start /tmp/prod
./build/nsrad status /tmp/prod
./build/nsrad stop /tmp/myproject

FAQ

Which port does it listen on and how do I change it? 9090 by default (server.port in [dir]/config.yaml); restart with stop + start after editing.

Where does the license go and what happens without one? At /opt/ns/licenses/nsrad.key; without a license it runs in 30-day trial (license shows the status).

What are the initial credentials? admin / admin123 at http://localhost:9090; the admin user is created by migration and cannot be deleted.

It won’t connect to ADABAS or the application doesn’t show? Check the database section of config.yaml (real DBID/FNR — manual values are fictional) and that the environment apps/ layout is correct; if the port is busy, change server.port.

Aussi disponible en : es