DEV Community

Dominque Terry
Dominque Terry

Posted on

🚀 Introducing Appaveli CLI: Instantly Generate Java DAO and Domain Classes from Your Terminal

As a Java engineer, one of the most repetitive tasks is writing boilerplate DAO and domain classes — especially when you’re not using heavy frameworks like Spring or Hibernate.

That’s why I built Appaveli CLI— a lightweight, Dart-powered command-line tool designed to automate the creation of Java DAO and domain classes. It’s clean, fast, and perfect for developers who want full control over their backend architecture without sacrificing productivity.

What Is Appaveli CLI?
Appaveli CLI is a developer tool I engineered, crafted for solo developers, startups, or lean teams who don’t want to over-engineer their backend.

With a single command, Appaveli CLI scaffolds fully-structured Java domain and DAO classes that follow clean code principles and work with basic JDBC.

No Spring. No Hibernate. No magic. Just code you can trust and control.

💡 Why I Built It
I wanted a way to rapidly generate backend code that could plug directly into my custom lightweight Java framework, without the bloat of external libraries.

I also wanted to avoid writing the same getters, setters, and JDBC statements over and over, and over, again.

⚙️ How It Works
Once installed, you can use the CLI like this:

Generate a Java domain class

`java -jar target/appaveli-cli-jar-with-dependencies.jar generate-domain \
 - entity User \
 - package com.example.domain \
 - fields "id:int,username:String,email:String,active:boolean"`
Enter fullscreen mode Exit fullscreen mode

Generate a matching DAO class with JDBC CRUD

java -jar target/appaveli-cli-jar-with-dependencies.jar generate-dao \
 - entity User \
 - package com.example.dao
Enter fullscreen mode Exit fullscreen mode

It will create files:

Image description
🧠 What Gets Generated
User Domain:

package com.example.domain;

public class User {
    private int id;
    private String username;
    private String email;
    private boolean active;


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public boolean getActive() {
        return active;
    }

    public void setActive(boolean active) {
        this.active = active;
    }


    @Override
    public String toString() {
        return "User{" +
                "id='" + id + '\'' +
                "username='" + username + '\'' +
                "email='" + email + '\'' +
                "active='" + active + '\'' + '}';
    }
}
Enter fullscreen mode Exit fullscreen mode
UserDao:

package com.example.dao;

import java.util.List;
import tech.appavelitech.domain.User;

public interface UserDao {
    void save(User entity);
    User findById(int id);
    List<User> findAll();
    void update(User entity);
    void delete(int id);
}
Enter fullscreen mode Exit fullscreen mode

UserDaoImpl:

package com.example.dao;

import java.util.*;
import tech.appavelitech.domain.User;

public class UserDaoImpl implements UserDao {

    @Override
    public void save(User entity) {
        // TODO: Implement
    }

    @Override
    public User findById(int id) {
        // TODO: Implement
        return null;
    }

    @Override
    public List<User> findAll() {
        // TODO: Implement
        return new ArrayList<>();
    }

    @Override
    public void update(User entity) {
        // TODO: Implement
    }

    @Override
    public void delete(int id) {
        // TODO: Implement
    }
}
Enter fullscreen mode Exit fullscreen mode

🛠️ How to Install

git clone https://github.com/appavelitech/appaveli-cli.git
cd appaveli-cli
mvn clean install
Enter fullscreen mode Exit fullscreen mode

You can also follow the README on GitHub.

🗣️ Let’s Collaborate
If this sounds useful to you:

Drop a ⭐ on the GitHub repo
Try it out and give feedback
Hit me up if you’d like to contribute or suggest a feature

Top comments (2)

Collapse
 
theelitegentleman profile image
Buhake Sindi • Edited

Perhaps have a look at Jakarta Persistence & Repository with the Repository pattern interface. It's an enterprise Repository pattern for Java developers. And you can inject them now using CDI.

Collapse
 
appavelidev profile image
Dominque Terry

Yes, I’ll take a look at it! Thanks!