Coder Social home page Coder Social logo

qute-blog's Introduction

Simple Blog Showcase of Quarkus Renarde with Qute, Unpoly and Tailwind CSS

Including

  • Responsive layout with Tailwind CSS
  • Optimized UX with Unpoly (for partial page-loads)
  • Simple Auth-Example with a JWT in a http-only Cookie (not from Renarde)

Setup of the Keys for the JWT Part

During the Start of the Service, a key-pair for the authentification with the JWT-session-token is generated. Don't use this approach in productive Environment with scaling. :-)

Start in Dev-Mode

To get the app running in dev-mode, simply execute:

./mvnw quarkus:dev

http://localhost:8080

How to use Unpoly in a Quarkus-Renarde Project

Add unpoly-Dependency from webjars:

    <dependency>
        <groupId>org.webjars.npm</groupId>
        <artifactId>unpoly</artifactId>
        <version>0.62.1</version>
    </dependency>

Add unpoly to your template:

    <script src="/webjars/unpoly/0.62.1/dist/unpoly.min.js"></script>
    <link rel="stylesheet" href="/webjars/unpoly/0.62.1/dist/unpoly.min.css">

Small examples of the power of unpoly in this project

Validate a form without reloading the hole page

Add a selector in up-target for selecting the DOM-Part which you want to update: (example found in src\main\resources\templates\Login\login.html)

    <form action="{uri:Login.loginrequest()}" method="POST" name="loginForm" up-target=".logindiv">
        ...
    </form>

Search on typing:

Just add up-autosubmit: (example found in src\main\resources\templates\template.html)

    <form method="GET" action="{uri:Application.index()}" up-target=".main-content" up-autosubmit>
        <input type="search" name="searchString" class="inp" placeholder="Search..">
    </form>

Validate one single form-element after leaving it

Just add up-validate to your form-element:

    <input class="inp" id="title" name="title" type="text" placeholder="Title" up-validate>

Ensure that you handle the X-Up-Validate header-param in your controller!

How to use Tailwind CSS in a Quarkus-Renarde Project

Install the Tailwind CLI over npm and execute a init according https://tailwindcss.com/docs/installation.
Create a main-CSS file for example in /src/main/resources/style.css with the Tailwind directives and the style-definitions you like.
Then you can build your CSS with the following command:

npx tailwindcss -i ./src/main/resources/style.css -o ./src/main/resources/META-INF/resources/css/generated-tailwind.css

Integrate the CSS in your templates like this:

    <link href="/css/generated-tailwind.css" rel="stylesheet">

qute-blog's People

Contributors

simeonlin avatar dwamara avatar

Stargazers

 avatar  avatar  avatar Roy Manigley avatar

Watchers

 avatar

Forkers

webapps-ch

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.