1 00:00:00,910 --> 00:00:03,580 Now we've got some initial setup of our application complete. 2 00:00:03,610 --> 00:00:07,180 We can start to think about writing code for our actual application. 3 00:00:07,210 --> 00:00:12,040 So in this video I want to focus on the overall project structure we're going to use in general for 4 00:00:12,040 --> 00:00:13,870 all the applications you and I are gonna build. 5 00:00:13,870 --> 00:00:19,450 We're gonna create a collection of different files every different file is going to contain one single 6 00:00:19,450 --> 00:00:24,980 class in each of those classes represents one different thing inside of our project. 7 00:00:25,030 --> 00:00:29,530 Now in some cases I'm going to have you kind of figure out the different schema or the different classes 8 00:00:29,530 --> 00:00:30,430 we're gonna create. 9 00:00:30,430 --> 00:00:32,620 But in this case we're going to do it together. 10 00:00:32,620 --> 00:00:37,730 So when I look at this mockup right here I really see three different things going on. 11 00:00:37,840 --> 00:00:40,870 I see one type of object for our user. 12 00:00:40,870 --> 00:00:46,070 So I think we should probably create a single file called Class dot or something user dot t yes that 13 00:00:46,090 --> 00:00:48,710 will hold a User class inside of it. 14 00:00:49,030 --> 00:00:53,890 That User class is going to have some methods and properties associate with it that define exactly what 15 00:00:53,890 --> 00:00:56,650 it means to be a user. 16 00:00:56,650 --> 00:00:59,530 Next up I see a company thing inside of here as well. 17 00:00:59,530 --> 00:01:04,840 So likewise I think we should create a separate file to house a company class that will also represent 18 00:01:04,840 --> 00:01:07,940 what a company is inside of our application. 19 00:01:07,990 --> 00:01:12,320 And then finally the last obvious piece that we have here is the map itself. 20 00:01:12,370 --> 00:01:16,840 So I think we should probably create some separate file that's going to hold a class to represent the 21 00:01:16,840 --> 00:01:21,610 map and probably have some methods attached to it to actually get the map to show up on the screen and 22 00:01:21,610 --> 00:01:24,040 render some markers on it. 23 00:01:24,040 --> 00:01:26,650 So in total I think we've got three separate classes here. 24 00:01:26,650 --> 00:01:33,460 We've got like a map file a user file and a company file then to actually get all these different classes 25 00:01:33,460 --> 00:01:34,500 to work together. 26 00:01:34,660 --> 00:01:40,630 We will import them into our root index dot test file and that's where we're going to actually initialize 27 00:01:40,630 --> 00:01:46,360 our project create a map create a user create a company and have some code to actually show the user 28 00:01:46,360 --> 00:01:50,310 and the company on that map that's the general idea. 29 00:01:51,650 --> 00:01:54,770 So right now let's get started on our user dot t yes. 30 00:01:55,040 --> 00:02:00,910 Back inside my code editor I'm going to find my SRT folder and inside there I'm going to make a new 31 00:02:00,910 --> 00:02:06,410 file called user dot t s and one thing on I want to point out right away. 32 00:02:06,480 --> 00:02:13,020 You'll notice that I called the file index dot t s what they lowercase i but user I labeled with a capital 33 00:02:13,020 --> 00:02:13,840 U. 34 00:02:13,980 --> 00:02:16,000 So what's with the difference there. 35 00:02:16,000 --> 00:02:22,710 Well by convention anytime we have a file whose primary purpose is to create an export a class we're 36 00:02:22,710 --> 00:02:25,290 usually going to give it a capital name. 37 00:02:25,290 --> 00:02:31,420 So in this case capital U user because we're going to create an export a class from this file. 38 00:02:31,500 --> 00:02:36,510 However in index dot T.S. we're not gonna have any classes we're gonna have just some code to import 39 00:02:36,510 --> 00:02:39,960 some classes and then use those to actually make something happen. 40 00:02:41,010 --> 00:02:43,820 You're going to most commonly see lower case file names. 41 00:02:43,860 --> 00:02:48,420 Anytime you have a file that either serves as something like the index not t s file so I come to the 42 00:02:48,420 --> 00:02:56,890 root of your application where a file that exports plain objects plain functions or constants All right. 43 00:02:56,890 --> 00:02:58,960 So now we've got the user dot t s file. 44 00:02:58,960 --> 00:03:05,630 I'm going to get started inside of here by declaring a new class called User like so and that's where 45 00:03:05,630 --> 00:03:07,280 we're going to leave it for right now. 46 00:03:07,280 --> 00:03:09,920 So let's take a quick pause with just this inside of here. 47 00:03:10,070 --> 00:03:14,150 By the way if you see any error inside this file right now when we save this that's totally fine we're 48 00:03:14,150 --> 00:03:16,100 going to fix it up in just a second. 49 00:03:16,100 --> 00:03:18,980 So let's take a quick pause right here and I'll see you in just a minute.