1
00:00:00,330 --> 00:00:06,090
In this lecture, we were going to start working on the mini project, I have planned for this course

2
00:00:06,420 --> 00:00:08,160
before digging into the code.

3
00:00:08,310 --> 00:00:10,320
Let's find out what will build.

4
00:00:10,620 --> 00:00:15,570
We are going to develop an image processing app for the sake of simplicity.

5
00:00:15,720 --> 00:00:19,050
The app will apply a grayscale effect to an image.

6
00:00:19,380 --> 00:00:24,900
Users will be able to upload their colored images to convert to a black and white image.

7
00:00:25,410 --> 00:00:32,040
It's a simple project, but it'll give us insight into building web assembly projects by the end of

8
00:00:32,040 --> 00:00:32,910
this project.

9
00:00:33,090 --> 00:00:36,720
You will know how to expand it to include other effects.

10
00:00:37,050 --> 00:00:44,340
For example, it should be pretty easy to resize images, add a blurry fact, or crop an area of an

11
00:00:44,340 --> 00:00:44,880
image.

12
00:00:45,150 --> 00:00:50,280
In fact, I encourage you to explore other effects after finishing this course.

13
00:00:51,000 --> 00:00:52,020
Let's get started.

14
00:00:52,320 --> 00:00:55,020
The first step is to generate a new project.

15
00:00:55,290 --> 00:00:59,280
Unlike before, we're not going to generate a binary project.

16
00:01:01,860 --> 00:01:06,330
Generally speaking, projects can fall into one of two categories.

17
00:01:06,600 --> 00:01:09,450
We have binary and library projects.

18
00:01:09,720 --> 00:01:17,550
Up until now, we've been creating binary projects a binary project compiles to an executable program.

19
00:01:17,940 --> 00:01:21,870
Users can run this program on their machines by default.

20
00:01:22,080 --> 00:01:28,800
Cargo generates binary projects On the other end of the spectrum, there are library projects.

21
00:01:29,130 --> 00:01:33,180
These projects compile into dependencies for other projects.

22
00:01:33,450 --> 00:01:37,140
If you think about it, that's what we need for our current project.

23
00:01:37,470 --> 00:01:43,650
We're not going to ask users to run an executable file on their machines for safety reasons.

24
00:01:43,830 --> 00:01:48,000
Browsers don't allow users to run executables in the browser.

25
00:01:48,660 --> 00:01:54,120
We are going to be using HTML and JavaScript for handling the UI in their browser.

26
00:01:54,510 --> 00:01:56,850
Russ will handle processing files.

27
00:01:57,150 --> 00:02:00,510
We can think of Roest as a dependency for our project.

28
00:02:00,870 --> 00:02:06,540
Therefore, it makes sense to create a library project instead of a binary project.

29
00:02:09,130 --> 00:02:15,970
Creating a library project can be done through the cargo net command inside the command line and the

30
00:02:15,970 --> 00:02:19,150
following command cargo in its lib.

31
00:02:21,820 --> 00:02:25,750
The Library option will generate a library project.

32
00:02:26,110 --> 00:02:32,860
We can run the command to initialize the project after a couple of moments, a new project should have

33
00:02:32,860 --> 00:02:33,670
been created.

34
00:02:34,060 --> 00:02:37,390
It's not going to be much different than a library project.

35
00:02:37,720 --> 00:02:39,820
Let's quickly explore the files.

36
00:02:40,420 --> 00:02:44,140
The first file is the Cargo Actio Mail file.

37
00:02:44,470 --> 00:02:46,240
Nothing will change in this file.

38
00:02:46,540 --> 00:02:51,610
Cargo produces two tables, which are called package and dependencies.

39
00:02:51,970 --> 00:02:54,220
We're already familiar with these tables.

40
00:02:54,490 --> 00:02:55,930
We won't review them again.

41
00:02:56,320 --> 00:03:02,860
Back in the file tree, there's a folder called source with a file called Library Express.

42
00:03:05,400 --> 00:03:09,000
Unlike before, Russell does not define a main function.

43
00:03:09,390 --> 00:03:12,780
Library projects do not need to define this function.

44
00:03:13,080 --> 00:03:18,210
Previously, if this function was not defined, the compiler would throw an error.

45
00:03:18,600 --> 00:03:22,560
It's not necessary for a library project by default.

46
00:03:22,770 --> 00:03:25,950
Cargo has generated a test for our library.

47
00:03:26,370 --> 00:03:30,660
Testing rust objects is a topic we won't be covering in this course.

48
00:03:30,990 --> 00:03:34,740
It's safe to empty out the file in the next lecture.

49
00:03:34,860 --> 00:03:39,120
We are going to begin adding web pack to process rust files.

