
Build a time clock app with rest endpoints, enabling employees to submit start and end times, and managers to review or reject via a web dashboard.
Explore Hapi.js, a rich Node.js framework for building enterprise web apps, with a thriving plugin ecosystem, high-load resilience, and extensive tutorials and API documentation.
Set up a basic hapi server for a Node.js enterprise web app, creating a localhost /hello route that returns 'Hello world' and later updates to 'hello from time clock'.
Add an http post route for the shift path to the time clock app, defining the path, method, and handler, returning the request payload to verify the endpoint works.
Learn to validate incoming payloads with Joi in a Node.js and Hapi.js app by installing Joi and adding basic route validation to ensure correct payload formats.
Validate post payloads with Joi in a Node.js and Hapi.js app, defining required date fields, testing ISO dates, and returning clear errors via a fail action.
Learn advanced Joi validation for shift data: enforce ISO dates, ensure end is after start and not in the future, and adjust error handling beyond bail.
Focus on organizing and configuring large apps built from small plugins, using a manifest to glue components together and review the glue API.
Explore how glue composes a server from a manifest configuration file, registers plugins like the employee plugin, and uses a register function with server and options to add post route.
Configure a hapi.js server with glue and a manifest to set the port and register plugins, including requiring the employee plug-in, then move the manifest to its own file.
Explore manager-focused features in the employee plugin, plan to save shift inputs to a database later, and build a web page for managers to review upcoming shifts.
Register the in search plugin and configure the server to serve static content from the public directory. Define a home plugin to serve index files and assets like css.
Discover server-side rendering with hapi.js by delivering a manager review page via vision templating, rendering data on the server with engines like ejs, handlebars, mustache, nunjucks, or twig.
Register vision and handlebars in the manifest, configure the views path, and render dynamic data through a handlebars template on the root route, with plugin prefixes for manager and employee.
Render a ships list later by looping a hard-coded hours array with Handlebars each helper to populate a table of who entered by and hours, showing item count updates.
Configure Handlebars templates with Hapi.js to apply a layout across views, adding branding and menus—using layout paths and manifest options.
Secure a Node.js and Hapi.js app by enforcing manager-only access and exploring Hapi authentication options, including bell for third-party login and basic plugins, note that authorization is not covered.
Register the happy basic plugin and define a simple auth strategy to validate credentials for a route, returning a credentials object on success and 401 on failure.
Explore authenticating users against external providers with Hapi.js and the Bell plugin, avoiding local credentials and using third-party accounts from services like Azure, Facebook, and Google.
Register the bell plugin and configure an Azure AD strategy in Hapi.js, including tenant ID, client ID, secret, and a login route with redirect to the manager route.
Establish a cookie-based session strategy with hapi.js and Azure authentication, secure the login callback, and redirect users to their original destination, such as the manager route.
Learn how to preserve the originally requested route with a next parameter during login. Update the unauthenticated page and render views to redirect users back after sign-in.
Implement a logout route that clears the session cookie and redirects to the home page, while injecting the logged-in username into every view via a context function in vision configuration.
Enable persistence in a Node.js app by saving employee shifts to a relational database using Sequelize. Leverage associations, lifecycle hooks, migrations, and transactions to manage data with read replication.
Install the Sequelize package for the chosen dialect and test the database connection, then define a shift model with a UUID primary key and start and end dates in Hapi.
Learn to query the database in a Node.js and Hapi.js enterprise app by implementing a sync findAll method to fetch shifts, order by created_at descending, and render results.
Update shift records in the database to enable managers to approve or reject shifts, update state and reviewer via a service method, and display time worked with a Handlebars helper.
Update shift records in the database by posting to a new route, then refresh the manager view to show the approved or rejected status.
Refactor and reorganize the app around shifts, merge employee and manager routes into a single shift route, and update the server-side ui to render based on shift state.
Enable monitoring and logging with good to capture server, ops, and request events, then route them through reporters to destinations such as stdout and a file.
Configure a logging plugin to write to standard out, format events for the console, and monitor memory, uptime, and load averages; log a post request to /shift.
Add custom logging with a server log and request log in the Node.js and Hapi.js enterprise web apps course, using tag arrays and optional timestamps to structure messages.
Configure a file-based log in a node.js hapi.js enterprise app, capture request and response events with payload, status, and metadata, and explore censoring sensitive data.
Learn to scrub sensitive data from logs with good's censoring features, configuring write-out to remove or censor authorization fields in headers via route-specific filters.
Ship logs from multiple app instances to a central logging repository by sending events to Splunk with the HP event collector, using the endpoint and token, and verify ingestion.
Generate Swagger documentation for a hapi.js app using the happy Swagger plugin. Expose a human readable UI and a machine readable JSON by tagging routes and configuring the host.
Hi, welcome to the course!!
Through the 11 chapters of this course, you'll learn
What Hapi.js is
How to setup a Node.js & Hapi.js server
How to validate server input & payloads, then respond with proper error messages & status codes
Server composition and configuration for additions & modifications
How to serve simple static content & complex static content over HTTP
How to simplify your server content using templates & Handlebars
How to secure your web application with Basic Authentication and 3rd party Authentication providers like Azure Active Directory (AzureAD)
How to connect to, query, insert and update records into a relational database
How to monitor your server, output logs, and ship those logs to a centralized repository like Splunk
How to easily generate Swagger API documentation
How to unit test using Lab & Code
How to unit test using Jest
How to output code coverage reports
So much more!
What version of Hapi.js is used in this course?
The latest version major version of Hapi.js - 17.x.x
Comments? Questions? Suggestions?
Leave a question in the QA section of this course!