WEBVTT 00:00.840 --> 00:06.570 So welcome to building Web applications with Go the intermediate level, and this course is not intended 00:06.570 --> 00:10.770 for absolute beginners, as the subtitle intermediate level might suggest. 00:11.190 --> 00:16.860 I do assume that you have a working knowledge of HTML and a basic understanding of the go programming 00:16.860 --> 00:20.220 language and how to work with databases and things like that. 00:20.520 --> 00:23.490 And if you don't have that skill set yet, this course isn't for you. 00:24.350 --> 00:26.780 I recommend you take an introductory course first. 00:27.330 --> 00:31.200 There are many to choose from on Udemy and I have one up and you can have a look at that if you wish, 00:31.230 --> 00:33.100 but assuming you have that basic skill set. 00:33.660 --> 00:37.590 Let's talk about the kinds of things we're going to cover in this course. 00:40.010 --> 00:45.950 So we'll be looking at how to build multiple applications from a single code base. 00:46.190 --> 00:47.840 I want to talk about multiple applications. 00:47.840 --> 00:52.640 I'm talking about the front end, the back end micro services, things like that. 00:52.940 --> 00:56.390 So we'll have a single git repository of code. 00:56.990 --> 01:01.430 And from that single repository will produce multiple applications. 01:01.730 --> 01:02.860 One will be the front end. 01:02.870 --> 01:05.590 And of course, that's what the user sees in a Web browser. 01:06.020 --> 01:08.270 One will be the back end, which is an API. 01:08.270 --> 01:11.540 We can call to fetch data to update data, things like that. 01:12.080 --> 01:16.310 We also have one that's a micro service because Go excels with micro services. 01:16.310 --> 01:19.340 And I thought I'd include an example micro service in this course. 01:20.000 --> 01:26.090 We'll also be working with stripe processing, credit card transactions, refunding credit card transactions, 01:26.240 --> 01:27.230 that sort of thing. 01:27.530 --> 01:31.730 And we'll also look at how to purchase a monthly subscription to a service. 01:32.990 --> 01:37.070 Now, while we're building the front and back end, there's various things you obviously need for a 01:37.070 --> 01:40.370 modern Web application, and we'll be covering the vast majority of them. 01:40.520 --> 01:44.960 For example, we'll have authentication both on the front end and on the back end. 01:45.320 --> 01:49.490 So on the front end will authenticate with a username and password and we'll set some sessional variables 01:49.490 --> 01:50.540 and keep the user logged in. 01:50.540 --> 01:56.690 And that sort of thing will also, for the back end, be using stateful tokens for API authentication. 01:56.930 --> 02:00.350 And there's a fair bit of work to set that up, but it's absolutely worth it. 02:00.350 --> 02:05.750 And it ensures that you have a very secure Web application will also cover user management, how to 02:05.750 --> 02:10.660 add, edit and delete users, how to allow users to reset their passwords if they forget them. 02:11.030 --> 02:14.000 And as I said, we'll also be looking at micro services. 02:14.000 --> 02:19.400 We'll build a single micro service that actually just received some information in a particular JSON 02:19.400 --> 02:19.970 format. 02:20.060 --> 02:26.840 Doesn't care where it comes from and it will produce a PDF version of an invoice based upon the information 02:26.840 --> 02:29.130 it receives and send that to an end user. 02:29.180 --> 02:33.010 So we'll email invoices to people as PDF attachments. 02:33.590 --> 02:36.540 So let me give you a look at the kinds of things we're going to be building. 02:38.030 --> 02:43.970 So this is a very simple website, not graphically attractive, but we're not interested in making things 02:43.970 --> 02:46.890 graphically attractive because this is not a course in graphic design. 02:47.240 --> 02:49.300 Instead, we're interested in functionality. 02:49.340 --> 02:54.740 So this is a fictitious website or fictitious company that sells widgets which are actually fidget spinners 02:54.740 --> 02:55.890 or so my daughters tell me. 02:55.890 --> 02:57.080 But I called them widgets. 02:57.080 --> 02:58.060 It doesn't matter. 02:59.120 --> 03:05.150 So we have a home page and as a non authenticated user, I can come over here and say, I want to buy 03:05.180 --> 03:07.910 one widget and here's a picture of the widget. 03:07.910 --> 03:09.110 It costs ten dollars. 03:09.110 --> 03:15.320 I fill out the basic information, put in a credit card number and this front end after we submit this 03:15.320 --> 03:20.810 form or as soon as we click that charge card actually gathers the information from the form, builds 03:20.810 --> 03:27.890 JSON request, sends it off to the back end, which is also written in go process is a credit card transaction 03:27.890 --> 03:29.120 and sends a response back. 03:29.210 --> 03:29.960 Very straightforward. 03:30.740 --> 03:34.260 Now I can buy a single widget or I can buy a subscription. 03:34.370 --> 03:38.750 So again, we're going to call strike after we get this information and we're going to charge someone 03:38.750 --> 03:43.330 twenty dollars a month and they will get three widgets for the price of two every month. 03:43.700 --> 03:44.540 Very straightforward. 03:45.080 --> 03:55.700 Now, if I log in as an authenticated user admin at example, dot com with a password. 03:58.430 --> 04:04.130 Once I log in, I have this admin menu available to me and from here, and this is the first major thing 04:04.130 --> 04:09.340 we'll build in this course, we have a virtual terminal that allows us to simply charge a credit card. 04:09.350 --> 04:14.780 So, for example, someone phones me, says, I'd like to pay my bill and I charge a credit card, very 04:14.780 --> 04:15.370 straightforward. 04:16.220 --> 04:18.410 Then we can look at all sales. 04:18.410 --> 04:23.540 And as you can see, the data here is pagination so I can go from one page to the next. 04:23.540 --> 04:28.910 And this is all handled on the back end where we send a request off to our back end API saying, get 04:28.910 --> 04:32.410 me this page of data and we draw the table based on JSON response. 04:32.960 --> 04:38.480 We have the same sort of thing for subscriptions, of course, and we finally we can manage all of our 04:38.480 --> 04:39.080 users. 04:39.080 --> 04:46.150 So I can edit a user, I can make changes, I can add a user and I can also delete users naturally. 04:46.400 --> 04:51.170 Now, this all might seem pretty straightforward, but in fact we have multiple applications, including 04:51.170 --> 04:56.300 a micro service running in the background, and we have to communicate between the front and the back 04:56.300 --> 04:57.590 end and the micro service. 04:57.590 --> 05:02.330 And there's a great deal we have to cover in this course in order to make this an efficient, safe and 05:02.330 --> 05:04.030 scalable Web application. 05:04.340 --> 05:05.170 So let's get started.