Applied AI Programming with Node.js
Duration
2 days (can be taught as 4-half days)
Description
This course offers an in-depth exploration of advanced JavaScript development tools and techniques. You will start by mastering NPM, including package management, scripts, configuration, and security practices with tools like GitHub Dependabot. Next, dive into TypeScript for a better development experience with static typing and efficient transpiling workflows. Learn the intricacies of asynchronous programming, focusing on event loops, promises, and async/await to write efficient, non-blocking code. The course culminates in a hands-on project where you connect to a PostgreSQL database and implement a Retrieval-Augmented Generation (RAG) app using Node.js, OpenAI APIs, and pgvector.
Objectives
- Understand the fundamentals of NPM, including package management and configuration.
- Learn semantic versioning to manage dependencies in JavaScript projects.
- Utilize NPM CLI and scripts for automating workflows and managing project tasks.
- Implement best practices in NPM security using NPM audit and GitHub Dependabot.
- Gain proficiency in publishing and managing Node.js packages with NPM.
- Explore TypeScript, its compiler, and configuration for strong static typing in JavaScript.
- Master asynchronous programming concepts, including callbacks, promises, and async/await.
- Develop a Node.js app integrating PostgreSQL and OpenAI APIs for database-driven AI solutions.
Prerequisites
All students must have JavaScript and Node.js programming experience.
Training Materials
All students receive comprehensive courseware covering all topics in the course. Courseware is distributed via GitHub in the form of documentation and extensive code samples. Students practice the topics covered through challenging hands-on lab exercises.
Software Requirements
Students will need a free, personal GitHub account to access the courseware. No local student setup is required, this course is delivered with GitHub Codespaces. The free allotment of Codespaces hours from GitHub is sufficient to complete the course. If students prefer to use a local environment, instructions will be provided.
Outline
- Introduction
- NPM
- Package Management
- Semantic Versioning
- NPM Scripts
- NPM CLI
- NPM Configuration
- NPM Audit
- GitHub Dependabot
- Publishing Packages
- TypeScript
- What is TypeScript?
- TypeScript Compiler
- TypeScript Configuration
- TypeScript Static and Strong Typing
- Run TypeScript with a Transpiler
- Run TypeScript with a Runner
- Run TypeScript Natively
- Asychronous Programming
- What is Asynchronous Programming?
- Event Loop
- Callbacks
- Promises
- Async/Await
- Calling OpenAI REST APIs
- Database Programming
- Connecting to a PostgreSQL Database
- Executing SQL Queries Asynchronously
- Implement a Basic Retrieval Augmented Generation (RAG) App with Node.js, PostgreSQL (using pgvector), and OpenAI
- Conclusion