WEBVTT

1
00:00:01.479 --> 00:00:08.620
The core features are laid out here, as mentioned, it'll be an API which we'll build that

2
00:00:08.620 --> 00:00:14.240
allows users to create and share events and sign up for events shared by others.

3
00:00:15.500 --> 00:00:21.280
And as a first step, I now want to use ChatGPT here in my case.

4
00:00:21.540 --> 00:00:26.460
Of course, you could also use Cloud or Google Gemini or whichever AI chatbot you prefer,

5
00:00:26.880 --> 00:00:35.280
but I want to use such an external AI service to plan the application or to take my core

6
00:00:35.280 --> 00:00:39.660
requirements and get some help regarding the general application structure and the core

7
00:00:39.660 --> 00:00:41.940
features so that I don't forget anything.

8
00:00:43.440 --> 00:00:49.220
In the next steps, we'll then use AI tools like Cursor to build the actual application

9
00:00:49.220 --> 00:00:50.020
and write code.

10
00:00:51.100 --> 00:00:57.380
Therefore, the prompt I'm sending to ChatGPT here is a prompt where I assign a role to

11
00:00:57.380 --> 00:00:59.200
give ChatGPT some extra context.

12
00:00:59.800 --> 00:01:04.800
And then I describe what I want to build, that it's a REST API that uses Node and Express

13
00:01:05.559 --> 00:01:10.020
and that it's a REST API that should have user authentication and that authenticated

14
00:01:10.020 --> 00:01:17.180
users can then manage events, that authenticated users can register for events and unregister,

15
00:01:18.000 --> 00:01:23.700
that I plan on adding this authorization and that events are made up of a title, description,

16
00:01:23.880 --> 00:01:24.620
date and location.

17
00:01:25.700 --> 00:01:31.420
I did not have that on the slide, but that's how I plan on building this and an image which

18
00:01:31.420 --> 00:01:31.940
is uploaded.

19
00:01:33.620 --> 00:01:38.420
Now, I don't want ChatGPT to generate any code at this point.

20
00:01:38.560 --> 00:01:43.480
I'll do that from inside the code editor from inside Cursor with Cursor, for example,

21
00:01:44.240 --> 00:01:47.960
but I want to get some help regarding the key building blocks and the general project

22
00:01:47.960 --> 00:01:48.460
structure.

23
00:01:50.020 --> 00:01:54.020
So, I'll send this prompt to ChatGPT and see what I'll get.

24
00:01:55.380 --> 00:02:00.780
And for example, here I get one possible project structure I could use.

25
00:02:01.760 --> 00:02:06.560
Now, I don't have to use that structure, of course, there might be parts I don't like.

26
00:02:07.520 --> 00:02:12.060
For example, I already see that I won't like this uploads folder in the source folder.

27
00:02:13.740 --> 00:02:17.960
That should instead be some folder that's publicly available when the app is running.

28
00:02:18.300 --> 00:02:23.140
It's not really part of my source code, but other parts are fine like controllers, models

29
00:02:23.140 --> 00:02:23.740
and so on.

30
00:02:24.840 --> 00:02:28.800
It also tells me that I might want to use JSON Web Tokens for authentication.

31
00:02:29.320 --> 00:02:30.820
That's what I had in mind too.

32
00:02:31.840 --> 00:02:37.920
It tells me that I'll need routes like this and that I'll need a user model in the end,

33
00:02:38.100 --> 00:02:41.140
which could be made up of a username, email and password field.

34
00:02:42.040 --> 00:02:46.380
That the password should be hashed, that's very important so that we don't store the

35
00:02:46.380 --> 00:02:50.060
plain text password in the database, which would be a security problem.

36
00:02:51.180 --> 00:02:57.420
That we could have created and updated add fields and that we could use the bcrypt package

37
00:02:57.420 --> 00:02:58.700
for password hashing.

38
00:03:01.160 --> 00:03:08.540
That I'll need these possible endpoints to implement authentication and that then thereafter

39
00:03:09.160 --> 00:03:13.860
I also need an event model with all the fields I specified.

40
00:03:15.440 --> 00:03:20.400
It also tells me, and that's important and that shows that AI is really helping me here,

41
00:03:20.680 --> 00:03:26.900
that I'll need a creator ID or a user ID field in my event model to link an event to a user.

42
00:03:28.320 --> 00:03:33.460
I did not specify this here when I described how an event should look like, but the AI

43
00:03:33.460 --> 00:03:35.160
tells me that I need this.

44
00:03:36.500 --> 00:03:41.900
And I knew this too, but it's great to have this extra confirmation here so that I don't

45
00:03:41.900 --> 00:03:45.700
forget it when I actually use AI tools to generate the code later.

46
00:03:46.920 --> 00:03:52.560
It tells me which endpoints, which paths I might want to set up to manage events, to

47
00:03:52.560 --> 00:03:54.680
get all events, a single event and so on.

48
00:03:56.160 --> 00:04:03.600
And that I need some paths for event registration, including one route, which I did not specify

49
00:04:03.600 --> 00:04:08.160
in my requirements to fetch all registrations for a specific event.

50
00:04:09.540 --> 00:04:10.940
And again, that's nice to have.

51
00:04:11.160 --> 00:04:15.900
It is something I might have forgotten and ultimately during building the app at some

52
00:04:15.900 --> 00:04:19.579
point I probably would stumble across that and add this feature.

53
00:04:19.760 --> 00:04:23.540
But it's nice to have it here right from the start, thanks to AI, that it tells me that

54
00:04:23.700 --> 00:04:25.900
this is another route I might consider adding.

55
00:04:27.600 --> 00:04:31.920
It tells me that I can use the malter library to implement image upload.

56
00:04:32.140 --> 00:04:36.640
That's what I planned to, but again, nice to see this here.

57
00:04:36.860 --> 00:04:41.520
Or if I had a different library in mind, it would be nice to get an alternative suggested

58
00:04:41.520 --> 00:04:47.060
here where I could then do some research to find out which option I prefer.

59
00:04:49.440 --> 00:04:54.760
And then it tells me about some files I might want to add to, well, implement or to hold

60
00:04:54.760 --> 00:04:58.240
the code for all these things.

61
00:04:58.320 --> 00:05:03.720
Though we'll do that code generation and also some of the file generation from inside

62
00:05:03.720 --> 00:05:06.680
Cursor and with help of GitHub Copilot later on.

63
00:05:09.080 --> 00:05:13.900
And I also won't add all these files it's suggesting here, because these are of course

64
00:05:13.900 --> 00:05:16.460
just some suggestions, not what you have to do.

65
00:05:17.320 --> 00:05:21.140
Basically it's you who's in the driver's seat and therefore you decide which structure

66
00:05:21.140 --> 00:05:25.260
you want to have, which filenames you want to have and where you want to put which code.

67
00:05:26.260 --> 00:05:29.400
And I will definitely deviate from what's suggested here.

68
00:05:30.540 --> 00:05:33.440
But it's nice to have these extra suggestions.

69
00:05:33.980 --> 00:05:39.840
I also won't use Mongoose for database management, also not SQLite, instead I'll use a different

70
00:05:39.840 --> 00:05:42.200
approach, but again, nice to have these suggestions.

71
00:05:44.080 --> 00:05:50.280
And with that, we have a plan and as a next step, I'll now switch to Cursor to actually

72
00:05:50.280 --> 00:05:52.020
get started building this application.

