All Projects â†’ oktadeveloper â†’ Generator Jhipster Ionic

oktadeveloper / Generator Jhipster Ionic

Licence: apache-2.0
Ionic for JHipster 💥

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Generator Jhipster Ionic

Generator M Ionic
Advanced workflows and setup for building rock-solid Ionic apps
Stars: ✭ 677 (+360.54%)
Mutual labels:  yeoman-generator, protractor, ionic
Facebook Login With Ionic Framework
Ionic example app of how to add Facebook Native authentication into an Ionic Framework v1 app. Add facebook login to your ionic app!
Stars: ✭ 83 (-43.54%)
Mutual labels:  ionic, ionic-framework
Ionic Firebase Starter App
Ionic 4 firebase CRUD tutorial to learn how to create a firebase application to perform Authentication and all CRUD operations in an ionic 4 application. You can use this FREE Ionic Firebase Starter App as a base to create your Ionic App with Firebase backend :)
Stars: ✭ 77 (-47.62%)
Mutual labels:  ionic, ionic-framework
Building A Complete Mobile App With Ionic Framework
JSConfUY 2015 Ionic workshop app. Ionic example conference app.
Stars: ✭ 89 (-39.46%)
Mutual labels:  ionic, ionic-framework
Ionic Example App
A Ionic Example App (previously known as ionic 2 examples). Contains different examples on how to use the Ionic Framework
Stars: ✭ 61 (-58.5%)
Mutual labels:  ionic, ionic-framework
Nativescript Ionic Template
📱 🖥 Create Mobile First apps, Web and Native sharing the code with Angular 🎉
Stars: ✭ 65 (-55.78%)
Mutual labels:  ionic, ionic-framework
Ionic Pwa
🚀 Build a Progressive Web App with Ionic and Angular. Push Notifications. Deployed to Firebase Hosting. The Complete guide to build your PWA. Service Workers. Lighthouse. Web Manifest
Stars: ✭ 87 (-40.82%)
Mutual labels:  ionic, ionic-framework
Ionic4
This repo contains example code for ionic4. Get Step by Step tutorial of this repo examples using https://ampersandacademy.com/tutorials/ionic-framework-4
Stars: ✭ 37 (-74.83%)
Mutual labels:  ionic, ionic-framework
Ionic Stencil Hn App
Ionic Stencil HackerNews App
Stars: ✭ 105 (-28.57%)
Mutual labels:  ionic, ionic-framework
Cnodejs Ionic
The mobile app of https://cnodejs.org made by Ionic 1.x, web demo http://lanceli.com/cnodejs-ionic
Stars: ✭ 1,537 (+945.58%)
Mutual labels:  ionic, ionic-framework
Ionic4 Starter App Tutorial
Ionic 4 To Do List App. FREE Ionic 4 example app. Learn how to start using Ionic 4 to create a simple app with lists, forms and navigation.
Stars: ✭ 123 (-16.33%)
Mutual labels:  ionic, ionic-framework
Ionic Google Login
Ionic 4 starter app to show you how to add Google Log In to an Ionic App using Google Sign-In Cordova Plugin.
Stars: ✭ 61 (-58.5%)
Mutual labels:  ionic, ionic-framework
Ion Affix
A directive for Ionic framework for creating affix headers.
Stars: ✭ 58 (-60.54%)
Mutual labels:  ionic, ionic-framework
Tutorial Photo Gallery Angular
Photo Gallery Tutorial: Ionic Angular and Capacitor
Stars: ✭ 73 (-50.34%)
Mutual labels:  ionic, ionic-framework
Ionic5 Starter App Tutorial
Free Ionic Starter Template - Ionic 5 example app. Learn how to start using Ionic 5 to create a simple app with lists, forms and navigation and more!.
Stars: ✭ 47 (-68.03%)
Mutual labels:  ionic, ionic-framework
Generator Jhipster Quarkus
Quarkus blueprint for JHipster
Stars: ✭ 85 (-42.18%)
Mutual labels:  jhipster, ejs
Ionic Typescript Starter
📱 Platform and IDE agnostic starter project for building mobile apps with Ionic and TypeScript.
Stars: ✭ 124 (-15.65%)
Mutual labels:  ionic, ionic-framework
Google Login With Ionic Framework
Ionic example app of how to add Google Plus authentication into an Ionic Framework app. Add google login to your ionic app!
Stars: ✭ 24 (-83.67%)
Mutual labels:  ionic, ionic-framework
Ionic Navigation And Routing
🎉 Ionic 5 tutorial to learn how to master Routing and Navigation in Ionic Angular Apps as well as some usability tricks you can add to your Ionic Framework apps to make them look even better!
Stars: ✭ 35 (-76.19%)
Mutual labels:  ionic, ionic-framework
Ionic Collection
🤘 Looking for about Ionic Framework?
Stars: ✭ 101 (-31.29%)
Mutual labels:  ionic, ionic-framework

Ionic for JHipster

NPM version Build Status Dependency Status

A JHipster Module that generates an Ionic Client

Introduction

This is a JHipster module. You can use it to generate an Ionic app that talks to a JHipster backend. It uses the Ionic JHipster Starter as a base template, then applies functionality (e.g. entity generation) on top of it.

To learn more about this module, see Build Mobile Apps with Angular, Ionic 4, and Spring Boot.

Prerequisites

As this is a JHipster module, we expect you to have an existing JHipster, Ionic, and Angular CLI already installed.

Or just run:

npm i -g generator-jhipster @ionic/cli @angular/cli

Installation

To install this module:

npm install -g generator-jhipster-ionic yo

To update this module:

npm update -g generator-jhipster-ionic

Usage

Create a JHipster app using jhipster, or a backend-only with yo jhipster:server. Choose JWT or OAuth 2.0 as the authentication type.

In a directory alongside your JHipster app, run this module.

- jhipster-app
- ionic-app

The following command will create an Ionic app (and its directory) for you and install the necessary code for it to communicate with your JHipster backend.

yo jhipster-ionic

This module also ships with an ionic4j CLI that you can use as a shortcut.

  • Use ionic4j to generate a new app
  • ionic4j entity <name> generates entities
  • ionic4j import-jdl <file.jdl> imports JDL and generates entities

Add PWA Support

To add PWA support to your Ionic app, run:

ng add @angular/pwa

Watch use the Angular CLI to transform your Ionic app into a PWA to learn more.

Okta for Authentication

Choosing OAuth 2.0 / OIDC for authentication will allow you to use Keycloak or Okta for identity. In theory, you should be able to use any OIDC-compliant identity provider, and these are the only ones we've tested against. JHipster ships with Keycloak configured and ready to go by default. You simply have to start it in your JHipster backend.

docker-compose -f src/main/docker/keycloak up -d

See JHipster's security docs to see how to configure JHipster for Okta.

NEW: You can use the Okta CLI to add JHipster integration in seconds! After running okta register, run okta apps create jhipster. Then, source the created .okta.env file and start your app.

source .okta.env
./gradlew # or ./mvnw

In addition to having a OIDC app for your JHipster backend, you'll need to create a Native app on Okta too.

Create a Native Application in Okta

Run okta apps create. Select the default app name, or change it as you see fit. Choose Native and press Enter.

Change the Redirect URI to [http://localhost:8100/callback,dev.localhost.ionic:/callback] and the Logout Redirect URI to [http://localhost:8100/logout,dev.localhost.ionic:/logout].

NOTE: dev.localhost.ionic is the default scheme, but you can also use something more traditional like com.okta.dev-133337 (where dev-133337.okta.com is your Okta Org URL). If you change it, be sure to update the scheme in src/environments/environment.ts and the redirect URLs in src/app/auth/factories/auth.factory.ts.

The Okta CLI will create an OIDC App in your Okta Org. It will add the redirect URIs you specified and grant access to the Everyone group.

Okta application configuration:
Issuer:    https://dev-133337.okta.com/oauth2/default
Client ID: 0oab8eb55Kb9jdMIr5d6

NOTE: You can also use the Okta Admin Console to create your app. See Create a Native App for more information.

Open ionic/src/app/auth/auth-config.service.ts and add the client ID from your Native app. For example:

environment.oidcConfig.server_host = this.authConfig.issuer;
environment.oidcConfig.client_id = '<your-client-id>';

You'll also need to add a trusted origin for http://localhost:8100. In your Okta Admin Console, go to Security > API > Trusted Origins > Add Origin. Use the following values:

  • Name: http://localhost:8100
  • Origin URL: http://localhost:8100
  • Type: Check both CORS and Redirect

Click Save.

Add Claims to Access Token

In order to authentication successfully with your Ionic app, you have to do a bit more configuration in Okta. Since the Ionic client will only send an access token to JHipster, you need to 1) add a groups claim to the access token and 2) add a couple more claims so the user's name will be available in JHipster.

NOTE: These steps are not necessary if you're using a version of JHipster with a CustomClaimConverter. In other words, if you're using Spring a MVC-based monolith, you don't need it. Support has not been added to WebFlux, yet.

Navigate to Security > API > Authorization Servers, click the Authorization Servers tab and edit the default one. Click the Claims tab and Add Claim. Name it "groups" and include it in the Access Token. Set the value type to "Groups" and set the filter to be a Regex of .*. Click Create.

Add another claim, name it given_name, include it in the access token, use Expression in the value type, and set the value to user.firstName. Optionally, include it in the profile scope. Perform the same actions to create a family_name claim and use expression user.lastName.

iOS

Generate a native project with the following commands:

ionic build
ionic capacitor add ios

Add your custom scheme to ios/App/App/Info.plist:

<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleURLName</key>
    <string>com.getcapacitor.capacitor</string>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>capacitor</string>
      <string>dev.localhost.ionic</string>
      <string>com.okta.dev-737523</string>
    </array>
  </dict>
</array>

Open your project in Xcode and configure code signing.

npx cap open ios

Then, run your app from Xcode.

Android

Generate a native project with the following commands:

ionic build
ionic capacitor add android

Change the custom scheme in android/app/src/main/res/values/strings.xml to use dev.localhost.ionic or your reverse domain name:

<string name="custom_url_scheme">com.okta.dev-737523</string>

The SafariViewController Cordova Plugin is installed as part of this project. Capacitor uses AndroidX dependencies, but the SafariViewController plugin uses an older non-AndroidX dependency. Use jetifier to patch usages of old support libraries with the following commands:

npm install jetifier
npx jetify
npx cap sync android

Then, open your project in Android Studio and run your app.

npx cap open android

You'll need to run a couple commands to allow the emulator to communicate with your API and Keycloak.

adb reverse tcp:8080 tcp:8080
adb reverse tcp:9080 tcp:9080

If you see java.io.IOException: Cleartext HTTP traffic to localhost not permitted in your Android Studio console, enable clear text traffic in android/app/src/main/AndroidManifest.xml:

<application
    ...
    android:usesCleartextTraffic="true">

See this Stack Overflow Q&A for more information.

If that doesn't work, just use Okta (and its HTTPS-by-default feature 😉).

Entity Generator

To generate entities, run ionic4j entity <name> or yo jhipster-ionic:entity <name>.

Import JDL

To import JDL, run ionic4j import-jdl <entities.jdl> or yo jhipster-ionic:import-jdl <entities.jdl>.

Testing

You can run unit tests with:

npm test

See the testing section of the Ionic JHipster Starter for more information.

Contributing

Please read our guidelines before submitting an issue. If your issue is a bug, please use the bug template pre populated here. For feature requests and queries you can use this template.

License

Apache-2.0 © Okta, Inc

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].