Skip to content

FusionKitJava/fusionkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 FusionKit

A modern, lightweight Java web framework for rapid application development

Java Version License

FusionKit is a comprehensive Java web framework that combines the best tools and libraries into a cohesive, easy-to-use package. Built on top of battle-tested technologies like Javalin, Freemarker, and HikariCP, it provides everything you need to build modern web applications quickly and efficiently.

FusionKit Overview

FusionKit Errors

✨ Features

🔧 Core Framework

  • Lightweight & Fast - Built on Javalin for optimal performance
  • Convention over Configuration - Sensible defaults with full customization
  • Type-Safe Configuration - TOML-based configuration with strong typing
  • Production Ready - Comprehensive logging and error handling

🗃️ Database Integration

  • Connection Pooling - HikariCP for high-performance database connections
  • ORM Utilities - Simple mapping from ResultSets to Java objects
  • MySQL Support - Optimized for MySQL with timezone handling

🎨 Templating & Views

  • Freemarker Integration - Powerful template engine with full feature support
  • Static File Serving - Efficient static asset handling
  • Internationalization - Built-in localization support
  • Error Pages - Beautiful, customizable error handling

🛠️ Developer Experience

  • Interactive Debugger - Built-in web-based debug console
  • Route Overview - Visual route mapping and debugging
  • Structured Logging - Logback integration with configurable levels

📁 Project Structure

FusionKit follows a clean, organized directory structure:

your-app/
├── .config/              # Configuration files
│   ├── database.toml     # Database configuration
│   ├── freemarker.toml   # Template engine settings
│   └── fusionkit.toml    # Framework configuration
├── src/main/java/        # Java source code
├── templates/            # Freemarker templates
├── public/               # Static assets (CSS, JS, images)
├── data/                 # Application data files
└── logs/                 # Application logs
Technology Purpose Version
Javalin Web framework & routing Latest
Freemarker Template engine Latest
HikariCP Connection pooling Latest
MySQL Connector Database driver Latest
Gson JSON serialization Latest
OkHttp HTTP client Latest
Logback Logging framework Latest

1. Add FusionKit to your project

<dependency>
    <groupId>com.github.marcandreher</groupId>
    <artifactId>fusionkit</artifactId>
    <version>1.1.3</version>
</dependency>

2. Create your main application class

public class App extends FusionKit {
    public static void main(String[] args) {
        // Initialize configuration
        FusionKit.setConfig(new AppConfig());
        AppConfig config = (AppConfig) FusionKit.getConfig().getModel();
        
        // Set up logging
        FusionKit.setLogLevel(config.getServer().getLogger());
        
        // Configure database
        Database db = new Database();
        db.connectToMySQL(
            config.getDatabase().getHost(), 
            config.getDatabase().getUser(), 
            config.getDatabase().getPassword(), 
            config.getDatabase().getDatabase(), 
            ServerTimezone.valueOf(config.getDatabase().getTimezone())
        );
    
        // Configure web application
        WebAppConfig webAppConfig = WebAppConfig.builder()
            .name("MyApp")
            .port(config.getServer().getPort())
            .domain(config.getServer().getDomain())
            .staticfiles(true)      // Enable static file serving
            .freemarker(true)       // Enable Freemarker templating
            .i18n(true)            // Enable internationalization
            .productionLevel(ProductionLevel.DEVELOPMENT)
            .build();

        // Register and start the application
        FusionKit.registerWebApplication(new MyWebApplication(webAppConfig));
    }
}

3. Create your web application

public class MyWebApplication extends WebApplication {
    public MyWebApplication(WebAppConfig config) {
        super(config);
    }
    
    @Override
    public void routes() {
        // Define your routes
        get("/", ctx -> ctx.render("index.ftl"));
        get("/api/users", UserController::getAllUsers);
        post("/api/users", UserController::createUser);
    }
}

Debug Console

FusionKit includes a powerful web-based debug console accessible via:

  • Press F10 to toggle the debug console
  • View application state, logs, and model data
  • Interactive JavaScript console for runtime debugging

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

👨‍💻 Author

Marc Andre Herpers - @marcandreher


Star this repository if you find it helpful!

About

A fullstack java devkit

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •