Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Full Stack Quarkus and React

You're reading from  Full Stack Quarkus and React

Product type Book
Published in Nov 2022
Publisher Packt
ISBN-13 9781800562738
Pages 324 pages
Edition 1st Edition
Languages
Author (1):
Marc Nuri San Felix Marc Nuri San Felix
Profile icon Marc Nuri San Felix

Table of Contents (21) Chapters

Preface 1. Part 1– Creating a Backend with Quarkus
2. Chapter 1: Bootstrapping the Project 3. Chapter 2: Adding Persistence 4. Chapter 3: Creating the HTTP API 5. Chapter 4: Securing the Application 6. Chapter 5: Testing Your Backend 7. Chapter 6: Building a Native Image 8. Part 2– Creating a Frontend with React
9. Chapter 7: Bootstrapping the React Project 10. Chapter 8: Creating the Login Page 11. Chapter 9: Creating the Main Application 12. Chapter 10: Testing Your Frontend 13. Chapter 11: Quarkus Integration 14. Part 3– Deploying Your Application to the Cloud
15. Chapter 12: Deploying Your Application to Kubernetes 16. Chapter 13: Deploying Your Application to Fly.io 17. Chapter 14: Creating a Continuous Integration Pipeline 18. Index 19. Other Books You May Enjoy Appendix – Answers

Chapter 1

  1. Quarkus is a Java web application framework similar to Spring Boot. Its main focus is on minimizing the application startup time and memory footprint while boosting the developer experience.
  2. You can create a Quarkus project from scratch by leveraging its CLI tool, a Maven goal, or most conveniently, by using the https://code.quarkus.io page.
  3. To run a Quarkus project in development mode, you need to invoke the following command: ./mvnw quarkus:dev.
  4. TDD stands for test-driven development, which is a software development process that aims to improve the developer’s productivity and the overall code quality.
  5. There are several packaging modes for Quarkus. You can easily package the application by running the following command: ./mvnw clean package.

Chapter 2

  1. Hibernate is one of the most mature object-relational mapping (ORM) libraries for the Java programming language. It also provides an implementation for the Java Persistence API (JPA) specification.
  2. Yes, with Quarkus you can implement a fully reactive persistence layer.
  3. You can implement an entity that leverages the Active Record pattern in Quarkus by extending the PanacheEntity base class.
  4. An easy way to load initial application data to the database is by using the quarkus.hibernate-orm.sql-load-script configuration option and SQL scripts in the resources folder.
  5. Quarkus Dev Services automatically provisions containers with the services our application relies on and configures them for our application, running in dev mode or its integration testing phase.

Chapter 3

  1. Yes, RESTEasy Reactive can be used to implement blocking endpoints too.
  2. The two types provided by Mutiny to start a reactive pipeline are Uni and Multi.
  3. A Bean is an object managed by a CDI container that supports a set of services such as life cycle callbacks, dependency injection, and interceptors.
  4. Annotating a class with the @ApplicationScoped annotation is the easiest way to declare a singleton bean in Quarkus.
  5. bcrypt is the preferred password-hashing function because it’s a slow algorithm, which makes it more resilient to brute-force attacks.
  6. To add a path parameter to a URL in Quarkus, you can declare it in the path by enclosing it in curly braces and then use the @PathParam annotation to retrieve it.
  7. It’s not necessary to add an @Produces annotation if the response type is JSON and the quarkus-resteasy-reactive-jackson dependency is declared, since it will be automatically inferred.
  8. You can intercept Java exceptions to...

Chapter 4

  1. JWT stands for JSON web token, a proposed standard that can be used to represent and securely exchange claims between two parties.
  2. To verify a JWT signature, we’ll need the public key.
  3. To generate a JWT in Quarkus, you can use the SmallRye JWT build dependency.
  4. Yes, we need to store a copy of the configured keys; however, the configuration for the path where these keys are stored can be overridden at runtime.
  5. We can use the @ConfigProperty annotation to retrieve a configuration value in Quarkus.
  6. If the @RolesAllowed annotation is applied both at a class level and then in a specific method, the method annotation takes precedence over the other.

Chapter 5

  1. We should use the %test.quarkus.hibernate-orm.sql-load-script configuration property and SQL scripts in the resources folder to add data to the testing environment database.
  2. You can automatically create a test suite class in IntelliJ by right-clicking on a production class declaration and clicking on the Go To Test menu.
  3. When you run a Quarkus test, Quarkus starts your application in the background.
  4. The @TestSecurity annotation overrides the application’s security context when the test is run.

Chapter 6

  1. GraalVM Native Image is an ahead-of-time compilation technology that generates standalone native executables.
  2. Quarkus moves to the build phase many of the tasks that regular Java applications perform at runtime, which reduces drastically its startup time.
  3. No, native image packaging doesn’t always improve the application’s performance.
  4. Short-lived applications benefit from native image packaging.
  5. The quarkus.native.resources.includes config property can be used to include additional resources in the application’s native image.
  6. Because we’ll be distributing our application as a Linux container image.

Chapter 7

  1. Material Design is a system of guidelines and tools created by Google to support the best practices and principles of good design when creating and designing user interfaces.
  2. A frontend routing library can be useful to create bookmarkable and user-friendly URLs for your application.
  3. No, React doesn’t prescribe any routing library.
  4. Redux Toolkit is an opinionated distribution of Redux, which includes utilities that simplify its configuration for the most common use cases.
  5. React hooks allow users to use state and other features without writing a class.
  6. JSX or JavaScript XML is an extension to the JavaScript language provided by React.
  7. React guidelines recommend composition.

Chapter 8

  1. Cross-origin resource sharing is a mechanism that allows a server to share resources to origins different from its own.
  2. The easiest way to consume an HTTP API and persist its results in a Redux store is by using the createApi function provided by Redux Toolkit Query.
  3. Redux Toolkit Query supports read-only query operations and read and write mutation operations.
  4. In Material Design, Snackbars are used to display temporary short messages near the bottom of the screen.
  5. The default URL for React’s development server is http://localhost:3000.

Chapter 9

  1. The most appropriate MUI component to display short messages in a way that attracts the user’s attention is Alert.
  2. React’s built-in useState hook is used to preserve a local state within a component.
  3. The action buttons in a modal dialog are usually located at the bottom.
  4. You need to add the reducer and its middleware to the main application’s store.
  5. You need to configure the route path with a param definition, which can then be retrieved using the useParams hook.

Chapter 10

  1. The describe function blocks are used to group test cases that are related to each other.
  2. Jest will execute the beforeAll function once before any of the tests in the surrounding describe block are executed.
  3. Yes, you can run asynchronous tests in Jest.
  4. You can use the userEvent function to emulate a user typing into a text field.
  5. With the Create React App test script and Jest, calculating the code coverage is as easy as specifying the --coverage argument when executing the npm test command.

Chapter 11

  1. Microservices scale easily, provide high redundancy, and are programming language-agnostic.
  2. Microservices require additional infrastructure, are harder to debug, and are more challenging when dealing with data consistency and transactionality.
  3. You can configure the Maven Resources Plugin to include resources from multiple locations by using the resources configuration and adding an entry for each location.
  4. The Maven Exec plugin allows the execution of programs and Java programs in separate processes.
  5. To include additional resources in a native image, you can use the quarkus.native.resources.includes configuration property or the resources-config.json configuration file.

Chapter 12

  1. Kubernetes manages container-based applications.
  2. Container-based applications are those that are distributed using container images, which allow system administrators to treat applications as standard units that can be managed in a uniform and consistent way.
  3. Application containers provide environment consistency, lightweight runtimes, efficient resource consumption, and many more advantages.
  4. A Kubernetes Pod is an object that represents the smallest deployable computing unit that can be managed in Kubernetes.
  5. A Kubernetes Ingress is an object to configure external access and routing to a Service deployed in the cluster.
  6. No, Jib doesn’t require a Docker-compatible daemon.

Chapter 13

  1. Fly.io allows developers to deploy their workloads close to where their users are, improving the latency and performance of their applications.
  2. You can override the configured database URL when running a Quarkus native application by providing the -Dquarkus.datasource.reactive.url command-line argument.
  3. Yes, JKube supports Dockerfiles too.
  4. flyctl reads the application’s deployment configuration from the fly.toml file.
  5. Yes, you can deploy existing container images to Fly.io.

Chapter 14

  1. Continuous delivery is a natural extension of continuous integration, where each set of changes is not only integrated into a central repository but is ready to be deployed into production after a successful build and test iteration, in a safe, quick, agile, and sustainable way.
  2. Continuous deployment is an extension of continuous delivery and includes the release and deployment of the application steps to the end of the automated pipeline.
  3. GitHub Actions is tightly integrated into the rest of the GitHub ecosystem.
  4. You can initialize a local Git repository by executing the following command: git init -b main.
  5. Yes, you can trigger a GitHub Actions workflow manually, provided that you configure it using the workflow_dispatch event.
lock icon The rest of the chapter is locked
arrow left Previous Chapter
You have been reading a chapter from
Full Stack Quarkus and React
Published in: Nov 2022 Publisher: Packt ISBN-13: 9781800562738
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}