Skip to content

MarcosMasip/framework-clean-self-contained

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

575 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Maven Central Java Version Required Java CI with Maven Release and Deploy DynamiaTools Documentation

Dynamia Tools Logo

DynamiaTools

DynamiaTools is a cutting-edge full-stack Java 21+ framework designed for building powerful enterprise web applications, harnessing the strength of Spring Boot 3 and the elegance of ZK 10.

πŸ”Œ Instant Offline Quickstart (Self-Contained)

The repository contains everything you need to explore DynamiaTools without external generators.

There are now two runnable entry points:

  1. Distribution Jar (dist module): Minimal assembled executable with core framework modules only (no sample CRUD data). Fastest startup. Use ./dynamia run. Includes a built‑in Home β†’ Welcome page and a static index.html that auto-redirects the root / to it.
  2. Demo App (examples/demo-app): Full sample with CRUD descriptors and REST example. Use ./dynamia demo or the combined warm build + start ./dynamia up.

Use the distribution jar when you want to validate framework wiring or embed it. Use the demo for reference descriptors and sample endpoints.

1. Clone

git clone https://github.com/<your-org>/framework-clean-self-contained.git
cd framework-clean-self-contained

2. Make the CLI executable (macOS/Linux only, needed once if permissions not preserved)

chmod +x ./dynamia

Windows users just run: dynamia.cmd (or through Git Bash: ./dynamia).

3. First run (online once)

Pick one (all are safe to try):

Minimal core distribution (shows Home β†’ Welcome page):

./dynamia run

Sample demo with CRUD:

./dynamia demo

Warm build + cache + start demo:

./dynamia up

What happens during up:

  1. Auto-downloads a JDK 21 locally into .jdk/ if you don't have one.
  2. Uses the bundled Maven Wrapper (no system Maven required) to build all modules.
  3. Caches dependencies for offline use.
  4. Starts the demo app (CRUD + REST + descriptors, Spring Data JPA + in‑memory DB) at http://localhost:8080.

4. Verify the API (demo only)

In a second terminal:

curl -s http://localhost:8080/api/demo/contacts | jq '.'

You should see JSON with keys: data, pageable, response.

5. Offline mode test (optional but recommended)

  1. Stop the app (Ctrl+C).
  2. Disconnect network.
  3. Run:
./dynamia offline-check
./dynamia demo

Expected: offline-check passes; demo starts again fully offline.

6. Scaffold a new app (no start.spring.io)

./dynamia new-app MyApp --group com.example --package com.example.myapp

Creates apps/my-app with a runnable Spring Boot + DynamiaTools starter.

7. (Optional) Vendor dependencies inside the repo

./dynamia vendorize
MAVEN_OPTS='-Dmaven.repo.local=.m2repo' ./dynamia build

8. Run tests

DYNAMIA_SKIP_TESTS=false ./dynamia build

Runs the smoke test (placeholder) and any added unit tests. By default tests are skipped for faster bootstrap unless you override DYNAMIA_SKIP_TESTS.

9. Success criteria checklist

Goal Confirmed When
Build works ./dynamia build ends with [ok] Build complete
Distribution runs ./dynamia run shows startup banner + Tomcat started
Demo runs ./dynamia demo shows Spring Boot banner + Tomcat started
REST OK (demo) curl shows JSON with data & response
Offline ready ./dynamia offline-check shows [ok] Offline check passed
Scaffolder works apps/my-app/ created with sources
Vendor cache .m2repo/ exists after vendorize

For more background see docs/OFFLINE.md and docs/SCAFFOLDER.md.

10. Command Reference (Cheat Sheet)

Command Purpose Expected Outcome
./dynamia run Launch lightweight distribution jar Startup banner + Tomcat started + Home/Welcome page (root / auto-redirect)
./dynamia demo Launch full demo sample app Demo endpoints available
./dynamia up Build everything (skip tests), warm deps, launch demo Spring Boot starts, visit http://localhost:8080
./dynamia build Clean install all modules [ok] Build complete at end
DYNAMIA_SKIP_TESTS=false ./dynamia build Full build with tests Tests execute; build success message
./dynamia offline-check Validate cached dependencies [ok] Offline check passed
./dynamia doctor Diagnose environment & offline readiness Diagnostic summary printed
./dynamia vendorize Populate local .m2repo vendor cache .m2repo/ filled; use with MAVEN_OPTS='-Dmaven.repo.local=.m2repo'
./dynamia new-app MyApp Scaffold new application Directory apps/my-app with runnable project
./dynamia new-module Reports Scaffold new reusable module Directory modules/reports (or similar) created
./dynamia version Show CLI version Prints CLI prototype info

Notes:

  • The repository uses the Maven Wrapper; you never need a pre-installed Maven.
  • A JDK 21 will auto-download into .jdk/ if none suitable is found.
  • For offline developer machines run ./dynamia run (or up) once while online; afterward both run and demo work offline.

11. Typical Offline Workflow

  1. (Online) ./dynamia run (or ./dynamia up for full warm + demo)
  2. (Optional) ./dynamia vendorize to freeze dependencies into .m2repo
  3. Disconnect network
  4. ./dynamia offline-check -> should pass
  5. ./dynamia demo (or run)

If adding dependencies later, temporarily reconnect and run ./dynamia build again.

11.1 Dynamic Port Selection

If port 8080 is occupied, the CLI now automatically picks the first free port between 8080–8100 and prints a warning:

[warn] Port 8080 busy; using 8081

Override manually with:

SERVER_PORT=9090 ./dynamia run

12. Offline Limitations & Notes

Most dependencies are fully cached by a single ./dynamia up run. Two caveats:

  1. ZK Transitives: Some legacy/optional API coordinates (e.g. jakarta.enterprise:cdi-api:2.0.SP1, jakarta.persistence:persistence-api:1.0, jakarta.transaction:jta:1.1) may appear during a broad dependency:go-offline scan via the ZK community repository. They are not required for the provided distribution or demo use cases. If the offline warm-up reports them as missing, you can safely ignore unless you explicitly add CDI/JTA features. The CLI now prints a clarifying warning instead of failing the sequence.
  2. Legacy JAXB & Cache: We pinned modern jakarta.xml.bind-api. We removed Ehcache (and its legacy javax JAXB chain) and replaced it with a lightweight in-memory cache to improve offline determinism.

Mitigations:

  • Force refresh once (online): ./mvnw -U -q dependency:go-offline
  • If adding CDI/JTA later, ensure network access for that first build, then offline works again.
  • Use ./dynamia offline-check (faster) rather than raw dependency:go-offline for routine verification.

13. Fresh Clone Runbook (Ordered Commands & Expected Outcomes)

Follow these after cloning to explore everything quickly:

Step Command Expected Outcome
1 git clone <repo-url>; cd framework-clean-self-contained Repository present locally
2 (Linux/macOS) chmod +x ./dynamia CLI script executable
3a ./dynamia run Distribution jar starts on 8080
3b ./dynamia up JDK auto-installed (if needed), build success, demo starts on 8080
4 curl -s http://localhost:8080/api/demo/contacts JSON with data, pageable, response
5 (Stop app) Ctrl+C Graceful shutdown messages from Tomcat
6 ./dynamia offline-check [ok] Offline check passed
7 ./dynamia demo Demo restarts instantly using cached deps
8 ./dynamia new-app Sample --group com.example --package com.example.sample New apps/sample/ directory created
9 ./dynamia build Rebuild all modules (skip tests) finishes with [ok] Build complete
10 (tests) DYNAMIA_SKIP_TESTS=false ./dynamia build Tests execute (if any added) and succeed
11 (optional vendor) ./dynamia vendorize .m2repo/ directory populated
12 (use vendor cache) MAVEN_OPTS='-Dmaven.repo.local=.m2repo' ./dynamia build Build succeeds using vendored repository

If any step fails, rerun with -X via Maven wrapper for diagnostics: ./mvnw -X <goal>.

14. Profiles

An offline-lite Maven profile trims non-essential modules for a quicker dependency warm-up:

./mvnw -Poffline-lite -DskipTests install

Used internally by the CLI; you can also invoke it manually for constrained environments.

15. Doctor Command

Run a quick health & environment diagnostic:

./dynamia doctor

This reports:

  • JDK path (provisioned or system)
  • Maven Wrapper status
  • Basic dependency cache presence
  • Hints if something is missing

16. Distribution vs Demo Summary

Mode Command Purpose Sample CRUD Included Relative Startup
Distribution ./dynamia run Minimal framework boot (Home/Welcome only, root redirect) No CRUD Faster
Demo ./dynamia demo / ./dynamia up Showcase with descriptors Yes Slightly slower

Select the distribution jar for embedding/integration checks, and the demo when you need concrete reference views.

Windows Quick Notes

Use dynamia.cmd up (or just dynamia up if .cmd associated). PowerShell example:

./dynamia.cmd up

Offline and scaffolding commands follow the same pattern.

If the script won't run

Symptom Cause Fix
permission denied: ./dynamia Execute bit lost on clone chmod +x ./dynamia
Hangs on JDK download Network or proxy restriction Manually install JDK 21 and set JAVA_HOME or place a JDK in .jdk/
Offline check failed Not all deps cached Re-run ./dynamia up while online
Port 8080 busy Other service using port Set server.port=9090 in examples/demo-app/src/main/resources/application.yml or export SERVER_PORT=9090
Scaffolder jar missing Starter not built yet Run ./dynamia build first

With DynamiaTools you can

  • Create fully functional web applications without too much knowledge about Web Development.
  • Write modular applications. Yes, you could create a module (jar file) and reuse it.
  • It helps you to keep your project DRY.
  • Automatic CRUD.
  • Automatic REST endpoints.
  • Extends the framework with new modules, actions and services.
  • Use HTML5 in your application thanks to ZK framework, this means you can use bootstrap, css3, and many HTML5 technologies
  • Customize your application with themes or templates.
  • Use MVC or MVVM
  • Integrate with other Java framework
  • Much more.

Installation (Traditional Method)

If you prefer manual integration instead of the included scaffolder:

  1. Create a new SpringBoot project (locally or via start.spring.io).
  2. Add the DynamiaTools dependencies below.
  3. Annotate your main class with @EnableDynamiaTools.
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import tools.dynamia.app.EnableDynamiaTools;

@SpringBootApplication
@EnableDynamiaTools // <- this is all you need
class MyApplication {

    public static void main(String[] args) {
        SpringApplication.run(MyApplication.class, args);
    }

}
  • Run
  • Done!

Maven

<dependencies>
    <dependency>
        <groupId>tools.dynamia</groupId>
        <artifactId>tools.dynamia.app</artifactId>
        <version>5.4.0</version>
    </dependency>

    <dependency>
        <groupId>tools.dynamia</groupId>
        <artifactId>tools.dynamia.zk</artifactId>
        <version>5.4.0</version>
    </dependency>

    <dependency>
        <groupId>tools.dynamia</groupId>
        <artifactId>tools.dynamia.domain.jpa</artifactId>
        <version>5.4.0</version>
    </dependency>
</dependencies>

Gradle

compile 'tools.dynamia:tools.dynamia.app:5.4.0'
compile 'tools.dynamia:tools.dynamia.zk:5.4.0'
compile 'tools.dynamia:tools.dynamia.domain.jpa:5.4.0'

Artifacts are available in Maven Central repositories

Documentation

Please visit (https://dynamia.tools) for full documentation and tutorials

Building (Manual Fallback)

The preferred path is to use the provided CLI (./dynamia build). If you still want a raw Maven invocation:

./mvnw clean install -DskipTests

If you need tests:

./mvnw clean install

You only need a JDK 21; Maven itself is bundled via the wrapper.

License

DynamiaTools is available under Apache 2 License

History

We start developing DynamiaTools 13 years ago as an internal utility library for our projects at Dynamia Soluciones IT (https://www.dynamiasoluciones.com). We needed that our developers could create web applications fast without too much knowledge about specific frameworks or APIs like Spring or JPA.

v1.x

First version was focus in many utility classes for hiding spring complexity, ZK apis, database connection, project configuration, page navigation, services and domain code integration and reusable simple modules. We did same stuff over and over again when we need create consistency user interfaces and actions across modules.

v2.x

Then version 2.x focus on simplify and automatize user interface creation without the need to generate code (that we think is easy to use but very hard to maintain). We created something called view descriptors, instead of write UI code and layout components you just describe it using a simple YML plain file and, the framework do its best to create the UI for you. On the other hand there are the most common thing you do when create any application that use some data storage, the infamous CRUDs. We ended writing the same kind of code for every simple entity. DynamiaTools create beautiful CRUDs for you.
You just need create an entity and your done.

v3.x

Finally, version 3.x come to life, we reorganize, repackage and optimize everything. This version has better code, better design, better performance, new and great features, it's not backwards compatible and, most important is the first version open source. Yes, we want to share our work with you.

v4.x

Now, version 4.x goal is Java 11+ and beyond, better performance, integrate new frameworks and new website with much better documentations and demos.

Please use it, extend it and help us to build a great community around it. We will continue support this project always. Currently, we have 10 projects and more than 40 modules powered by DynamiaTools 4. As you can see this is not a new framework but is new in the open source world. This is not the only project we are going to open, we have more products to share.

v5.x

The main goal of 5.x version is to upgrade to latest version of Java 21, spring and hibernate.

Want contribute?

Please read Contributing Guidelines

β˜• Support DynamiaTools

Hey there! DynamiaTools is built with a lot of dedication to help developers speed up their projects and make development more enjoyable. If DynamiaTools has been useful to you or your projects, consider supporting its development. Your support helps keep the project alive and evolving with new features and improvements. Every coffee counts! 😊

Buy Me A Coffee

About

Fullstack Java framework for enterprise web application

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Java 92.6%
  • JavaScript 4.3%
  • CSS 2.6%
  • Other 0.5%