
We introduce the course, including a high level overview of what is - and is not - covered
We run through the structure of the course, explaining the reasoning for the different sections, and briefly highlighting the content of each
We run through the different technologies covered in this course, and which of them are "mandatory". For example, the course is Angular-focused and if you're interested in React, it's probably not the right course for you. But the course also uses Supabase databases, and in that case, if you want to use a different database technology, that should be relatively simple to achieve. We run through all the key technologies and third party providers and assign them a score. Also, we cover the meaning of test environment, and reiterate that this course will output a deployment-ready test environment, not a production ready app.
Course files are available as a zip file attached to the final video of each section (sections 3, 4, 5 & 6). This video shows you where to find them, how to download them and extract them to a repos folder; it shows you how to add that to your VS Code workspace and then runs through the various pre-requisites for simply trying to run my code as your code base. It will not run first time unless you have checked a few things!
Before you start wireframing or building, you need a vision! We go through the Precis vision: what the ultimate, production version of the Precis app would do, and why it was important to make it secure. If you want to build your own great application, it’s a good idea to work through this conceptual stuff for your idea before you wireframe. Who is it for? What does it do? What makes it different?
We go through the wireframe for the MVP (minimum viable proposition). This scales back our earlier Production vision and it’s important to understand since this is what we will build in this course.
We work through the Precis wireframe and explain why these images are crucial, whether you’re a solo coder or working in a team. We look at what you should DO with your wireframe, how to socialise it and seek feedback before you start coding, including focus groups and feedback. We consider the likely devices and bandwidth of your audience to help you decide whether you’re designing mobile-first, desktop-first, or some combination of the two.
We create a new Angular project using ng new, and see where that lives on our local computer. We do not enable server side rendering for this one page app, but I explain why you might want to do this if you are building a multi-page app. We add the newly created project folder into VS Code using Add Workspace. We look through the basic structure of an Angular app with the help of a diagram. We upgrade our Angular version from 17 to 20, and I explain how to upgrade Node to 22 (which is required for Supabase later in the course). It is safer and easier to upgrade before you begin coding. We initialise a Git repository, link the remote repo using git remote add origin to our local VS Code, and make our first commit. We check we can see the code on the Git website following our first push. I explain why node_modules should not be backed up to Git. We see the boilerplate Angular app at http://localhost:4200 after running ng serve.
We learn the basic file structure of an Angular application, the key root files, and which files should be copied over to Git. We see how the desired six-section layout will translate into six components, and that these all, by default, sit under the parent app component within Angular. We create the six components using the Angular command ng new. We replace the app component template boilerplate with references to our six new components, update the typescript imports to remove the errors, and check that we can see our new child components in the frontend by running ng serve and viewing http://localhost:4200. We use F12 and the element inspector to make sense of the element hierarchy. We place high-level styles such as the app’s background colour gradients into the app component’s stylesheet.
We lay out the row structure for our four steps, using template (html) and styles (scss). The row structure is the same for our four “step” components, so rather than repeating the code across multiple components, we use the central styles.scss sheet for this. I explain why this is risky, and how to mitigate the risk of leaky styles by being super specific in your class selectors. We work on the Upload component, and then copy the template design over to the other components. We do not need to copy their styles, since these are centrally placed. We use border colours to help us understand how the browser is interpreting our html elements and why they have the dimensions and positioning they do. We use flex to style. We import Noto Serif font from Google.
We build the header component and lay out the static template for the footer component with a set of three buttons. We pull in a new font family and use it to style the header. We create three buttons which each trigger a new toggleModal function. By the end of this video, the buttons will be present and styled, but when clicked they just log to the console. They don’t launch a modal window yet.
Now we build a conditional modal window (pop-up) shared by our three footer buttons. There are many possible ways to design the components here, but we keep it all within a single footer component. We use a Boolean toggle to display or hide the modal, which is a div element. We build a data object containing title and description, and when the user clicks on a button, the appropriate data are sent into the modal window for display. Users can click an X to close the modal or click “away” from the modal, which is actually clicking on a semi transparent full screen page overlay.
Our four steps should enable and disable in a specific order and at certain times. We want to co-ordinate the enablement and disablement of the steps centrally, in a way that any interested component can later access. So the best method here is to use a service. We build a Workflow State Service in a new folder called services, which is a sibling to components within our application. We paste in 200 lines of code, but go through it line by line. Much of the code is repetitive in nature. For example, we create a function that resets steps 2, 3, & 4 if a user deletes the text from Step 1; we create a function that resets steps 3 & 4 if the user removes their choice from Step 2. So although there is a lot of code, much of it is very similar. Overall, the service computes and keeps data on which steps are enabled and completed at any moment.
We build Step 1. This involves changing the template, stylesheet and typescript for the upload component, plus using the service we created in the last video. First, we create the textarea element in the template, adding in a “progress bar” underneath the text area, which changes colour depending on how many characters remain. We also add a small <p> element, which counts down the number of remaining characters. We paste in some styles to make it look attractive, and then we create all the types, properties and methods in upload.component.ts that are needed to support the template. Finally we check how it looks in the frontend, check the console logs from the Workflow State service, to ensure they’re working, tweak the styling a little and we’re done!
We build a <select> dropdown in the quote component, which lets the user choose the length of summary output they want. Their options will be: one paragraph, two paragraphs, A4 and A5. The quote component will have some conditional logic so that when Step 2 is disabled, they see a prompt telling them to type or paste text into Step 1. Once there is some text in Step 1, this message will disappear, the dropdown should appear along with text to encourage them to make a selection.
We build a function to calculate the quote from the input text and output summary size selection of the user. For now, we build this just within the quote component itself, using types and interfaces to ensure data quality. We create a calculateQuote function, which uses input text length to calculate input tokens, summary size to estimate output tokens, adds the two together and multiplies by a static 4 pence per variable. We display the quote in the console, and then adjust the Quote component to display the quote conditionally underneath the <select>.
We consider three “payment” options: no payment, Paypal or a Payment Platform. Within the latter, we consider alternatives to Stripe, such as Shopify, Lemon squeezy and Gumroad. We choose Stripe for this project because it is a good fit for Node and Angular; it offers support for test and prod, including for webhooks, which we use for secure confirmation of payment.
We consider three Stripe implementation options: payment via link; payment via custom embedded form; and payment via pre-built form. We see why the first and second do not suit an MVP web app. The pre-built form can be embedded or can redirect to Stripe, and we explain why we choose the redirecting version.
We set up Stripe via the Stripe website. We see that a single log in grants you access to both a Production and Sandbox environment. We explain that a sandbox is simply where you can play without causing any changes in Prod. We create a sandbox called Precis. We find the Developers area of Stripe, consider the sections on Workbench and Documents, and then access the API keys area. We learn that there are two keys, prefixed sk_test_ and pk_test_ for secret and public keys, respectively. We learn it’s important to keep the sk_test secret, and that we will have separate sk_live_ and pk_live_ keys when we move to a Production environment.
We set up a customer, product and price within Stripe for Precis. Stripe offers support for many types of product and price. We set up a single customer (so we can test the SQL code for customers within this course), and we set up a single product. We use dynamic pricing for our single product, which means we will be able to pass in a price from our application to Stripe.
We install Stripe to our angular project using npm install stripe. We discuss what a package manager is and understand that using your existing package manager – other than npm – might be fine. We discuss high severity vulnerabilities, what to do and what NOT to do. Once we have installed Stripe, we see what project files have automatically changed for us within Node modules, including both cjs and esm folders. We see what these two acronyms mean and how to identify which approach your project is using. We see that Stripe itself has dependencies, which can be found in package.json within the stripe folder, and we see that our own application’s package.json has automatically updated to list stripe as a dependency. We reinforce that the installation is a backend event, even though we can see all these things on our local machine, and we can run them with our local server.
We create a new backend folder and learn that although this is a sibling folder to src, it is fundamentally different in the way it is treated. We create a .end.test file within backend, for our test environment, and store our secret key from Stripe within this file. We ensure the dot env file is not backed up to github by editing our .gitignore file. We install dotenv package within our Angular project.
We create a Supabase account and an organisation, within which all projects must sit. I set up a new Precis project under my existing organisation. I create two tables - customer and orders - using SQL, and I enter a single row into the customer table, to match the customer created in Stripe in a previous video.
We create a server.js file and install Express. We examine why using Express is preferable to straight Node when creating endpoints. We write the basic code needed to get our Express server to run, including both stripe and dotenv libraries and ensuring we have a STRIPE_SECRET_KEY in place. We explain the benefit of using express.json() and we get our server running with confirmation in the terminal window. We consider that we need two powershell windows open at the same time, and we rename them to frontend and backend for ease of use.
We move our calculateQuote to the server and learn why this is important. We create our first proper API endpoint in our server file (/api/quotes/calculate). We inject httpClient into our component so we can call this server endpoint from our Angular application. We comment out all the previous types and functions that have now been recreated on the server. We see (eventually) that the quote is still showing on the frontend, but now that information is coming via our server.
We hit a couple of snags along the way, such as httpClient not being registered centrally within the app, and CORS issues preventing our backend (localhost:4242) talking to our frontend (localhost:4200). We fix this by installing cors, pulling it into our server file, and explicitly granting permission for our frontend to issue requests to our backend. After these one-time set-ups, creating future API endpoints should be a breeze!
We create another API endpoint in the server file (called /api/orders/create-pending) and explain why it is useful convention to prefix them with /api/ and group them with further subdivisions. We create a payNow function in the Payments component, and use httpClient to call the new post endpoint. We wire up the click event to the existing div, and get a 404 error on clicking. This is because summarySize is not recognised, and we realise this is because the workflow has never been sent this information. We create handlers for summarySize alongside sourceText in the service, and check it all works.
We create our first order row in the Supabase database orders table. We do this by editing our create pending endpoint, to include a supabase insert command. This requires us to install the supabase-js library and to create two entries in our .env.test file so Supabase can authenticate us. We cover a couple of common mistakes, which might prevent you getting your supabase insertion working correctly. We learn that we need this pending order created in the database before we redirect to Stripe, so we can send the Order ID over as metadata, and receive it back later. This will enable us to keep our database as the single version of truth in our project, and keep our data secure.
We trigger a checkout session in Stripe for the first time. We edit our skeleton create-checkout-session endpoint to add multiple actions. We use a select statement which takes the Order ID and returns the amount, id, currency and order status from the orders table in the database. Using the database means a user can’t hack our frontend to change the price or currency. Then, if we successfully retrieve these data, we use stripe.checkout.sessions.create for the first time. This instructs Stripe to create a payment page and provide us with the URL reference. We can redirect the user to this URL to pay, but we don’t do that yet. In this video, we use an InvokeRestMethod in our terminal window to call Stripe, and see if our code is working. We take our orderId from Supabase and paste it into this method, and see that it works.
Earlier in the course, we emitted the quoted price from the quote component using Output. We see how this can be passed via the parent component – in this case the app component – into any other child component. So we handle the quote in the app component, and insert it into the payment component. Eventually we display this in the console, to prove the payment component has received it. But first we have to deal with a bug in which some code lies wrongly outside of the next() handler.
We connect the Angular frontend to our API endpoint, so that clicking the frontend triggers the creation of the pending order, and redirects the user to the Stripe checkout, allowing us to enter pretend card details into Stripe, and return to our application. By the end of the video, this is working, although we don’t have an attractive button to click yet, and all the user inputs have been wiped, meaning we can’t progress to Step 4 until we have saved them to a session variable.
We add a new template element and some styles to make a nicely styled button. We handle the enablement and disablement of the payment button and row, testing it against a number of different scenarios: Step 1 text is entered; Step 2 size is chosen; Step 1 text is then deleted; Step 2 size is reset. We ensure the button and row enablement works across all the scenarios we can currently create.
We create a new folder called models, and a file within it called workflow.models.ts. We place any Type and Interface declarations into this file, and then use VS Code’s Search tool to hunt out any duplicate declarations, which we then delete and replace with an import.
We use a sessionStorage variable to keep the user inputs while they are redirected to Stripe to pay. We begin by creating a ‘precisPayment’ property within the session variable in payment component, which stores sourceText and summarySize. Then we extract the information in the app component after payment. We parse the URL first, so we know whether the user paid or cancelled, and if they paid, we know what the session ID is. We create a restoreWorkflowFromSessionStorage function, whose purpose is to repopulate our webpage with the user inputs. We note that parsing the success_url is not sufficient proof of payment: for that we need the backend to check with the database.
We learn what a webhook is, and how they work specifically for Stripe. We see that webhook endpoints must use express.raw() not express.json() and therefore they have to be placed in a particular location within server.js. We learn that our localhost server is not publicly available and that we have to open a special channel between Stripe and our localhost server in test, using Stripe CLI and a pairing code. We filter all possible Stripe events to just checkout.session.completed and we eventually remember to restart the server!
We use our webhook to update our order in the database to paid, and we also include the Stripe payment reference and a paid_at timestamp. Initially I place the code in the wrong place, and have to debug why the update isn’t working.
We create a new endpoint so we can securely confirm whether an order is paid. Our new get-status endpoint uses the Stripe session ID to look up the order in the database and return its status, amount and currency. (We can’t use the frontend amount because it could be hacked.) We use this status to update our Step 3 button, so the button will now say, in the correct situations: “Choose summary size before you pay”; “Pay £0.44”; “Paid £0.44”; or “Redirecting to payment”. The row and button also now enable and disable at the correct time. Meanwhile we edit our final component so that it is disabled until payment is complete.
When the user cancels a payment using the Stripe back button, the payment button should ask them to pay an amount of money but it shows the wrong message. We trace this back to this.amount being null within the Payment component. There are many potential ways to fix this, but the best one is to use the original code. So we refresh our memories about how this.amount originates as this.quote in the quote component and is transmitted via the app (parent) component. We re-trigger the quote calculation from the parent app component, and watch the button start to behave properly.
When the user pays successfully, they are currently returned to the homepage with a number of parameters showing in the URL address bar and with the payment button still enabled. In this video we redirect the user to the homepage, removing the query parameters, whether they have paid or cancelled. We discuss the importance of placing this code in the right location, as http calls are asynchronous, meaning we might accidentally trigger the route navigation while query parsing or endpoint calling are in progress. Then, in order to disable the payment button, we update the canPay computation.
What happens if the user presses the BROWSER back button, instead of the Stripe back button? We see that they are returned to the homepage with no query parameters, and they lose all their inputs. This does not match what the user would expect: they would expect to retain their inputs as though they had pressed the Stripe back button. We have all the information we need, but our app component ngOnInit lifecycle hook is poorly structured, and it’s hard to see how we can include the browser back button scenario within our existing code.
So we restructure our ngOnInit and constructor code, so we can handle successful payment, payment cancellation and browser back button all using the same code. We learn that Stripe provides many test card details that map to specific errors such as a generic payment decline or a CVV mismatch. With Stripe hosted payment, Stripe itself handles communicating this to the user, but if you are embedding Stripe in your application, you might need to handle these events.
We create an OpenAI account and provide it with some funding if needed. We create an API key and copy it over to our .env file. We understand that this key is like a password with direct access to your wallet, and how to treat it accordingly.
We build a buildPrompt function in a new prompt.js file on the backend. This pulls in the inputText, summarySize and mapping between summarySize and number of words. It includes these variables within a set of instructions to build a single prompt string using the user’s text and chosen output length. We don’t send anything to OpenAI yet: we simply build a JavaScript function as our first step on this journey.
We call our buildPrompt function from a new /api/openai/create-prompt endpoint within server.js that uses the get method. We create a function called previewPrompt to trigger the endpoint and we deliberately build this function to exist separate to the workflow so we can bypass the payment process. This means we can test prompt generation and communication between Angular and our backend without going through payment each time. We attach the previewPrompt function to a click event on the whole of our step 4 as a temporary measure. By the end of the video, clicking on Step 4 logs the prompt to the console.
We install openai using npm. We build a new /api/openai/generate-summary endpoint in server.js, which actually talks to OpenAI. We modify our existing http.get call to become an http.post that talks to our new endpoint. We learn some of the differences in structure and syntax between http.get and http.post.
We use OpenAI’s Responses API and see where to find documentation for alternatives, including Chat Completions. We log the response to the browser and terminal console as we don’t have anywhere to display it yet. By the end of the video, clicking on Step 4 logs the OpenAI response to the console.
We get Precis working end to end for the first time! First, we add a wide textarea to display the LLM’s response. Next, we remove the temporary click handler and trigger generateSummary automatically after the backend confirms payment. We restart Stripe’s local webhook forwarding, enter some text, choose an output size, complete a test payment and see the generated summary displayed in our new textarea.
We briefly tidy up the UI and logs to the console. We comment out most logs to the console, we fix a typo, change a text colour and add some padding, so that if you download the final source code, you don't have these errors in your code.
This course contains the use of artificial intelligence, primarily for image generation.
Build an AI-powered app—and understand how the pieces connect
Build Precis, an AI-powered text summarisation application, from product vision and wireframes through to a working full-stack MVP running on your own computer, ready to publish.
Using Angular, Node.js, Express, Stripe, Supabase and OpenAI, you’ll connect a user interface to a backend, database, payment provider and AI service. The emphasis is on security and understanding the integrations—not simply copying code until something works.
The finished application lets a user:
Enter text and choose an output length.
Receive a calculated quote.
Complete a Stripe sandbox payment for the quoted amount.
Return to the app without losing their inputs.
Generate an AI response and display to the user.
This course finishes with a local development application running on localhost. It does not cover public deployment or accepting real payments. Stripe payments use its sandbox. OpenAI requests use the actual API and may incur usage charges. Depending on demand, a second course might be created to cover going live in Production, including server deployment.
What you’ll learn
Plan the application before you build
Define the product vision, identify the minimum viable product, and map the user journey. Create and review wireframes so you understand what you’re building before writing application code.
Build the Angular frontend
Create the Angular project, organise the interface into components, and build the user-input and output-selection controls.
You’ll use a shared service to coordinate workflow state, pass data between parent and child components, and control when each step becomes available.
You’ll also build shared layout elements, a footer modal and a styled output area.
Create the Node.js and Express backend
Build API endpoints that connect the frontend to your application’s calculations and external services.
You’ll learn how to:
Send requests from Angular using HttpClient GET and POST.
Read and validate inputs on the server.
Return data and handle errors.
Keep API keys and other secrets out of the frontend and Git repository.
Reuse backend functions rather than duplicate important logic.
Throughout the course, diagrams explain the responsibilities of each part of the application and how requests move between them.
Integrate Stripe and Supabase DB
Create database tables in Supabase and use its JavaScript client to create, retrieve and update orders from your backend.
Calculate prices on the server, create pending orders, and redirect users to Stripe-hosted Checkout. Use the Stripe CLI to forward sandbox webhook events to your local backend, then update the database when payment is confirmed.
You’ll also preserve user inputs during the checkout redirect and handle successful payments, cancellations and browser-back navigation.
Add OpenAI
Build a prompt function using the user’s text and chosen output length. First preview the prompt without calling the model, then connect your backend to the OpenAI Responses API.
Finally, display the response in the interface and replace the temporary testing trigger with automatic generation after the application confirms payment.
Who this course is for
This course is for developers who have some Angular experience and want to move beyond standalone interfaces into full-stack integrations.
You should have:
A working knowledge of HTML and CSS.
Basic familiarity with JavaScript and TypeScript.
Some experience creating and running a basic Angular application - steep ramp up if this is missing
A basic understanding of databases and SQL.
You do not need previous experience integrating Stripe, Supabase or OpenAI.
This is not an introductory course in Angular, JavaScript, CSS or SQL. We build the application from scratch, but the focus is on how the systems work together. Some templates, styles and longer functions are pasted rather than typed and then explained line by line or with diagrams.
How the course is taught
Code alongside me as we build the application in manageable stages.
You’ll see diagrams, working code, console output and debugging as we connect each part of the system. We examine common integration problems, including missing configuration, CORS, asynchronous requests and restoring state after payment redirects.
Course files are provided for each module so you can compare your application with the supplied version when troubleshooting.
I use VS Code, Angular 20, Node.js 22 and CommonJS modules in the backend. You can use another editor.
What you’ll finish with
A working local MVP that connects an Angular frontend to an Express backend, a Supabase database, Stripe sandbox payments and OpenAI.
You’ll leave with both the application and a clearer understanding of how to structure similar integrations in your own projects.
Public deployment, production hardening and live-payment configuration are outside the scope of this course.
Practical points
We will build a complete Angular application together from scratch, and you will be able to access course files for each module so you can install and run my application and compare it to your own, if you're having trouble making yours work. You will get the most out of the course if you code alongside me.
We use VS Code throughout both courses as our text editor. You don't have to use the same one.
Course contents | what we teach on Angular
For someone who has never used Angular before, this course would be possible but a steep learning curve. I do create the application from nothing, and you will see every single Angular command I run, but Angular is quite a ramp up conceptually if you have never come across it before. The course is aimed mainly at people who have at least run <ng new my-app> before, or completed the "Angular tour of heroes" course. The more Angular you have used, the easier you will find the course, since we focus mostly on integrations and interfaces rather than creating the basic application.
I discuss how best to structure our components within the app and how the stylesheet, template and typescript all work together within each component. I define a service, explain why you should centralise types and interfaces, and show you how to pass variables between child and parent components.
I touch briefly upon the role of some key files within an Angular application, such as tsconfig.json, angular.json and package.json, as we need to make small edits or look up certain properties. But we do not dwell on the significance of all the boilerplate files within an Angular application.
Course contents | what we teach on HTML and SCSS
This course assumes you have a working knowledge of HTML and CSS, such that you could confidently create a webpage outside of Angular. I teach you how to structure a couple of templates to achieve our desired layout and you will have access to this code if you want to learn from it. But I do not explain the stylesheets or template I'm using. For the most part, I copy and paste the HTML and CSS into our Angular application and I do not go through it line by line.
If you are unfamiliar with HTML and CSS, you will find this course too fast paced, because creating the template is regarded as an early stepping stone to focus on interfaces and integrations, rather than a focus in its own right.
Course contents | what we teach on backend and server creation
The backend - meaning the server file, environment variables, and database - is crucial to this course.
I use diagrams to illustrate the concepts here, as well as demonstrating and supplying the code. To make our application professional grade and secure, the backend must orchestrate everything. Only the backend can access the database, our golden source of truth. Only the backend can therefore instruct Stripe to take a payment or confirm that a payment has been made. Only the backend can talk to OpenAI, send the prompt and handle the response.
Angular applications do not install with a backend folder, so you will create the folder, and then a server.js file within it. Later you will create a quote.js file and a .env.test file too.
The server.js file uses Node and Express and I observe that Node could achieve the same goals by itself but Express makes the code easier to read and maintain. By the end of the course, the server.js file requires and uses dotenv, supabase-js, stripe and cors as well as Express and openai.
We use CommonJS in our server file, meaning we use 'require' terminology instead of 'import' terminology associated with ECMAScript Modules (ESM). I show you how to identify which you are using if you are accessing an existing project.
After pulling in the required libraries of code, the server.js file is home to a number of API endpoints that we create. I prefix all of those with /api/ to make server configuration easier if we deploy to Prod in a second course.
I show you how to call these endpoints from Angular using httpClient post and get, and I show you how to select from, update and insert into the database from the endpoints. I explain - and repeat, multiple times - how important it is for security that you keep your backend as the middle man between your Angular frontend and any updates to the database, Stripe or OpenAI. I use diagrams to emphasize this, and to discourage any direct contact between Angular and your provider systems (though it would be far easier to code it this way!).
I point out the importance of keeping .env.test in your backend folder and never altering your project structure so that folder becomes compiled. I point out that sometimes in an existing Angular project you will find an environments folder within /src and I explain why you must never place the .env files here.
Course contents | what we teach on SQL
I show you how to set up the database in Supabase and I share all the code on screen for creating the tables within it. However I do not dwell on the SQL for table creation. It is assumed that you have sufficient knowledge of SQL and also that the database provider and structure for your project will be different to mine. I spend longer on the SQL within our backend server.js file, and how it works within the context of the endpoint, rather than explaining the table creation queries in Supabase.
Course contents | what we teach on Git
I create a Git repo at the start of the course for this application, and I back up my code at the end of each video. I show you how I do this, but I do not explain what Github is, or what the alternatives are. I use a single branch throughout, unlike the planned second course in this series, which will swap between test and prod branches. I explain the importance of the gitignore file, and encourage you to exclude node_modules from any Git back up and insist (with good reason!) that you exclude your environment .env.test files from any back up. This file and the secrets it contain must never be pushed over to Git. Ultimately you will recreate this file on your server as and when you publish your app.
Course contents | what we teach on TypeScript and JavaScript
A basic working knowledge is expected on TypeScript and JavaScript for this course. If you have successfully created a basic Angular application, you will have used these sufficiently already. I do not teach either of these languages from scratch, but I do explain the structure and purpose of the code that we use in the course.
For the first component file we create, the footer component, I use a diagram to explain the structure of the TypeScript code for an Angular component: imports, type definitions, configuration, class definition, data and methods. The first time we use a service, I explain how the stylesheet, html and ts files of a component work together, and why only the ts file can talk to the service. For more complex functions, I use diagrams to annotate the purpose of the function, rather than going through line by line. All the code will be made available to you if you wish to check between the actual code and the annotated explanation.
While I don't dwell on every single line of each function that is used, I try to always illustrate and explain the concepts at play the first time we see them in the course. Often I copy-paste functions into position but I go through them afterwards. I try to explain why certain positions matter in the code, as particularly within server.js, certain functions must occur before or after others.
Course chronology
You will begin by defining the app’s MVP, product vision, user journey and wireframes, and learn how to validate the design before writing code. Next up, you will create an Angular application from scratch, structure components around the user flow, build shared layout elements, and finally create a header and footer component. The latter has some conditionality and uses a modal window. By the end of this module, you will have a broadly static Angular app running on localhost.
Then we move on to user interaction. We start to build the form components needed for our app. We begin with a text area input with some validations, and then create a dropdown so the user can select the kind of output they want. We manage workflow state with a new Angular service, so that Step 2 only unlocks once Step 1 is completed. We generate a price quotation for the user based on these two inputs.
The module that follows this is the longest and most complex module in the course. It focuses on integrating Stripe sandbox for accepting dummy payments. This is the real work full of interfaces and integrations. This module has more than 20 videos, and I use a diagram to help you understand where we are in that process, and a colour coding system so you can see what kind of interface we are making. I repeat - until you are sick of hearing about it - that your hand-offs must always go via the backend server endpoints, and you should never instruct Supabase, Stripe or OpenAI directly from your Angular.
This payment module begins by creating an account on Stripe and understanding their offering. Then we install Stripe using CLI so we can mimic webhooks in test. We set up a database in Supabase and an environment file to hold our secret passwords. We move our quote calculation from the payment component to a new file called quote.js on the server for security and so we can access the same function from multiple places.
With all the prep work done, we create a pending order in the database using a new server.js endpoint. We take the order number from this to instruct Stripe to make a new checkout session. We pass the quote data into our Payment component so the customer can see what they will be paying and we enable the user to begin the Stripe checkout by clicking a Pay button. We centralise our types and interfaces within our /src folder and we save the user's text input and output selection to both the workflow service and a new sessionStorage variable, so that we can reinstate these inputs when the user returns from the Stripe-hosted webpage. We add a webhook to validate payment and we kick that off in a test environment via command line interface (CLI, powershell terminal in VS Code in our example).
The webhook updates the pending order in the database to paid, which unlocks Step 4 in the user interface. We clear the sessionStorage variable, reset the URL and build handlers for cancellation, payment failure or clicking the back button.
Now that the user has provided their input, made their selection and paid, we create a template prompt and use the user inputs to modify that prompt. We bypass payment so we can test the prompt code without entering card details each time. We send the string prompt to OpenAI and receive a response. We display the result in the console, and then adapt the final Step of the UI (Step 4) to display the result. We encourage the user to copy and save the result.
External providers
We use Supabase for our database, Stripe for payments and OpenAI as our LLM in this course.
Versions used
I use Angular v20. I use Node v22, as this is the minimum requirement for Supabase. I use CommonJS and not ESM within the JavaScript file.