Having trouble implementing a login theme for keycloak using vue and vuetify

My goal is to set up a login page for keycloak using vue and vuetify.

After trying various guides and projects, I haven't been able to achieve success. While I managed to display some logs, the app itself didn't render.

To simplify, I intended to have separate projects for different areas of keycloak such as: [login, account, register].

Each project was structured as follows:

App.vue

This file contains the code for the login page.

main.js

import Vue from 'vue'
// Rest of the JS code...

index.ftl

// HTML template code...

static(folder)

theme.properties

// Properties related to theme settings...

template.ftl

// Another template code snippet...

package.json

{
  // JSON configuration details...
}

vue.config.js

// JavaScript configuration settings...

If additional information is required or if you prefer to clone my repository instead of creating a new app, you can access the GitHub link here.

Reference projects:

Vue TS project

Proof of Concept of vuetify

Answer №1

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b8cecdddcd616286">[email protected]</a>/dist/vuetify.min.css"></script>
    <script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="bec8cbdbcaccd2c3cd707d7e">[email protected]</a>/dist/vuetify.min.js"></script>
    
    </head>
    <body>
        <div id="app">
            <v-card class="mx-auto" max-width="344">
                <v-img src="https://cdn.vuetifyjs.com/images/cards/sunshine.jpg" height="200px" cover></v-img>
        
                <v-card-title>
                    Top western road trips
                </v-card-title>
        
                <v-card-subtitle>
                    1,000 miles of wonder
                </v-card-subtitle>
        
                <v-card-actions>
                    <v-btn color="orange-lighten-2" variant="text">
                        Explore
                    </v-btn>
        
                    <v-spacer></v-spacer>
        
                    <v-btn :icon="show ? 'mdi-chevron-up' : 'mdi-chevron-down'" @click="show = !show"></v-btn>
                </v-card-actions>
        
                <v-expand-transition>
                    <div v-show="show">
                        <v-divider></v-divider>
        
                        <v-card-text>
                            I'm a thing. But, like most politicians, he promised more than he could deliver. You won't have time
                            for sleeping, soldier, not with all the bed making you'll be doing. Then we'll go with that data
                            file! Hey, you add a one and two zeros to that or we walk! You're going to do his laundry? I've got
                            to find a way to escape.
                        </v-card-text>
                    </div>
                </v-expand-transition>
            </v-card>
        </div>
        
        <script>

            const { createApp } = Vue
            const { createVuetify } = Vuetify

            const vuetify = createVuetify()

            const app = createApp()
            app.use(vuetify).mount('#app')

        </script>
    </body>
    </html>

you can use CDN instance of package.json

<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c2b4b7a7afbaad84b7bab6bdb6">[email protected]</a>/dist/vuetify.min.css"></script>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="17616272636e717e572439253922">[email protected]</a>/dist/vuetify.min.js"></script>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The header component in Vue does not display updated data before the router enters

I am facing an issue while trying to update data before entering a route in VueJs 2. In my component, I attempted the following: data: function () { return { name: "test" } }, beforeRouteEnter (to, from, next) { next(vm =& ...

React failing to fetch GraphQL query successfully

I've been experimenting with using GraphQL in React through the useQuery API as shown below: const {loading, data, error} = useQuery<BaseUser, BaseUserVars>( GET_DASHBOARD_USER, {variables: {id: "1"}} ) Withi ...

.class selector malfunctioning

I'm currently developing a card game system where players can select a card by clicking on it and then choose where to place it. However, I've encountered an issue where nothing happens when the player clicks on the target place. Here is the li ...

Strategies for resolving duplicate jQuery code in my project

Trying to simplify my jQuery code that handles video selection and playback functionality. Users can click on a thumbnail or button to play a specific video, with the title of the video changing accordingly. Despite achieving the desired outcome, the cur ...

Convert AngularJS JSON.stringify to PHP

I am looking to pass additional data to the PHP script along with the form values. I have a JavaScript function called "cart.items()" that returns a string of items selected in the cart. How can I send this value to the PHP function? form.html ...

Switch between different URL tabs seamlessly in NEXT.JS without needing to refresh the page

I have implemented Material UI tabs in my project and I am updating the tab in the URL. However, I do not want the page to refresh every time I switch the tab. Despite using shallow:true in my code, the issue persists. const tabs = [ { label: &apos ...

Should one consider building a web application by relying on browser AJAX requests a sound practice?

When developing a standard MVC web application, is it acceptable to rely heavily on ajax calls for rendering content? For instance, looking at Facebook as an example, they dynamically load a majority of their content. Should we emulate this strategy? What ...

Safari is having trouble loading all the resources on the webpage

I'm encountering a strange issue with Safari when trying to open my web app. Here's the setup: I have a Vuejs application hosted in an S3 Bucket on AWS. The app is exposed through an API Gateway. The Problem: When I try to access the app, only ...

Vuelidate validation for passwords seems to consistently be seen as invalid

I am facing a major hurdle with this problem. For some reason, Vuelidate is failing to validate the password field correctly. No matter what input I provide, it always shows up as invalid, and I can't figure out why. I've attempted various soluti ...

Sending messages through a Discord Bot without the use of a command

I have code that is constantly running in the background in JavaScript, 24/7. I am looking to configure a discord.js bot to send a notification message if any issues or errors occur within the code. Is there a way to send a message to any channel without ...

What is the reason behind my button appearing beneath my links in React?

https://i.sstatic.net/Qmm4z.jpg Here is an image showcasing the current header render. The header consists of a HeaderMenu and 3 Links. While the links are functioning properly, the HeaderMenu is causing the links to be positioned below it. The HeaderMenu ...

The npm run dev command is not functioning properly within the HackerNews example on Vue.js

I attempted to launch the vue-hackernews-2.0 demo from the vuejs' github repository The setup section provides instructions on how to set up the project: # install dependencies npm install # or yarn # run in dev mode, with hot reload at localhost:8 ...

What is the process for canceling an href="javascript:void(null)"?

Lately, I've encountered a frustrating issue with the javascript:void(null); bug when using it in my hrefs for images. In my specific version of Safari (4.0.3 on Leopard PPC), applying an href of javascript:void(null); to an image causes the image to ...

Serving pages with Node JS and loading .js files on the client side

Here is a simple JS file that will be familiar to those who have worked with Socket.IO in NodeJS and Express: var express = require('express'), app = express(), server = require('http').createServer(app), io = require(&apos ...

Notification system for managing recurring tasks

Situation I am currently working on an application where users are assigned daily tasks such as "wash the window, clean the floor," and so on. Each task has a specific recurrence interval and must be completed at least once within that time frame. For e ...

Encountered a glitch when attempting to retrieve a Redux state within an async function in Next.js 13

"activate customer" import SearchResultPage from "./resultSearchPage"; import axios from "axios"; import { useSelector } from "react-redux"; const fetchProduct = async () => { const response = await axios.get( ...

Puppeteer encountered an error when trying to evaluate the script: ReferenceError: TABLE_ROW_SELECTOR was not defined

https://i.stack.imgur.com/PJYUf.jpg Recently, I started exploring pupeteer and node while using vscode. My goal is to log into a website and scrape a table. So far, this is what I have: (async () => { const browser = await puppeteer.launch({ headle ...

While using Ckeditor, typing or deleting text will cause an input checkbox to become unchecked and its value to be altered

Whenever I try to make any changes or use the backspace key in Ckeditor, the checkbox gets unchecked and the value resets to 0. Despite my efforts, I have been unable to find a solution to this issue. How can I resolve this problem? CKEDITOR.replace( &ap ...

Determine the number of centimeters on the page as you scroll with jQuery

While searching for plugins that count up and down, I came across many. However, I am looking for something more unique: Imagine having an HTML page that is 70,000cm high. Now picture a counter in one corner that displays the height you are currently at a ...

Exploring provider flags with Vee-validate version 3

Currently, I am utilizing the Vee-Validate v3 library for handling validations within my project. My goal is to have the second div displayed only if the first validation provider has a validated flag set (indicating that it has been validated at least onc ...