A modern, lightweight Java web framework for rapid application development
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.
- 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
- 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
- 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
- Interactive Debugger - Built-in web-based debug console
- Route Overview - Visual route mapping and debugging
- Structured Logging - Logback integration with configurable levels
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 |
<dependency>
<groupId>com.github.marcandreher</groupId>
<artifactId>fusionkit</artifactId>
<version>1.1.3</version>
</dependency>
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));
}
}
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);
}
}
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
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Marc Andre Herpers - @marcandreher
⭐ Star this repository if you find it helpful!