jweb-framework

基于 JAX-RS、Guice 风格 DI、Bean Validation、JPA 和 React 的开发人员友好型 Java CMS。「A developer friendly Java CMS based on JAX-RS, Guice style DI, Bean Validation, JPA and React.」

Github星跟蹤圖

JWeb Framework

A developer friendly module based JAX-RS micro service framework.

  • Built for startup, provides well designed quick prototyping code base.
  • Supports template editing, perfect for building landing pages.
  • JAX-RS module framework
    • Enhancements to Jersey
    • Supports Guice style DI/AOP
    • Embedded HTTP server with undertow

Getting Started

These instructions will get you a copy of the JWeb CMS up and running on your local machine.

Prerequisites

  1. Download and install Open JDK 11 or Oracle JDK 11
  2. If you want to use MySQL as database. (Optional, JWeb default embeds HSQL)
    1. Download and install MySQL.
    2. Create a database.
      CREATE DATABASE main CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    3. Create a database user with schema update permission.
      CREATE USER 'user'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON * . * TO 'user'@'localhost'; FLUSH PRIVILEGES;

Installing

  1. Download the package file JWeb-v0.9.0-beta.zip (For all platform)
  2. Unzip the package
  3. Run ./bin/JWeb
  4. Use a browser(IE11+) to open http://localhost:8080
  5. Fill in the require information to setup JWeb.
    1. Choose language.
    2. Input app name, the name will be displayed in page title.
    3. Select database.
      1. If you want to use MySQL, input the info of database and user you created.
    4. Input SMTP settings.

      Optional, if you skip the SMTP settings, user register will be disabled.

    5. Click install button. JWeb will restart.
  6. Open http://localhost:8080/admin/

Run Source Code

  1. Clone the repo
  2. Import as a Gradle project to Intellij IDEA or Eclipse.
  3. Run JWeb-main/src/java/Main.java

Known issues

  • There will be errors in module-info.java for duplicate module java.xml.bind
  • There will be errors in DAO related source codes for missing @Transactional.

It is because of Java 10 JEE split package issues. A temp fix for Intellij IDEA is:

  1. Open settings. Build, Execution, Deployment>Compiler>Java Compiler.
  2. Input the following parameters to Additional command line parameters. And replace the path of javax.transaction-api-1.3.jar.
    --add-modules=java.xml.bind --patch-module java.transaction=~\.gradle\caches\modules-2\files-2.1\javax.transaction\javax.transaction-api\1.3\e006adf5cf3cca2181d16bd640ecb80148ec0fce\javax.transaction-api-1.3.jar
    
  3. The error messages are still there, but it compiles.

Code Examples

To start an App:

public class Main {
    public static void main(String[] args) throws InterruptedException {
        Path dir = Paths.get(System.getProperty("user.home")).resolve(".JWeb");
        App app = new UndertowApp(dir);
        ServiceLoader.load(AbstractModule.class).forEach(app::install);
        app.start();
    }
}

To create a Module:


public class TodoServiceModuleImpl extends TodoServiceModule {
    @Override
    protected void configure() {
        //import DatabaseModule to register entity and create repository
        module(DatabaseModule.class)
            .entity(Task.class);
        
        bind(TaskService.class);
        
        //register service implementation
        api().service(TaskWebService.class, TaskWebServiceImpl.class);
    }
}

Release Notes

  • 0.9.1

    • Clear modules, remove page search/rss and edm features.
    • Add GA/addthis modules
  • 0.9.0

    • User management, supports login/register/forget password/pincode/captcha code.
    • Page management, supports category/page/template/variable/components.
    • File management, supports upload files, download files, scale images, react file browser.
    • Basic email template support

Authors

  • Chi

    If you need support for customization or commerce license, please feel free to contact me chiron.chi#gmail.com

See also the list of contributors who participated in this project.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

License

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

主要指標

概覽
名稱與所有者chifei/jweb-cms
主編程語言PHP
編程語言Java (語言數: 4)
平台
許可證BSD 3-Clause "New" or "Revised" License
所有者活动
創建於2013-11-03 04:18:06
推送於2024-01-22 17:29:50
最后一次提交2024-01-22 20:29:49
發布數44
最新版本名稱2.1.25 (發布於 2023-09-26 17:50:03)
第一版名稱2.0.0-alpha (發布於 )
用户参与
星數199
關注者數31
派生數149
提交數5.1k
已啟用問題?
問題數279
打開的問題數36
拉請求數166
打開的拉請求數6
關閉的拉請求數73
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?