1 00:00:02,300 --> 00:00:07,040 Now for that, I'm back in my code and first of all, we need a server. 2 00:00:07,040 --> 00:00:12,080 Now I won't write my own server-side code because this course of course is not about server-side 3 00:00:12,080 --> 00:00:14,300 technologies like NodeJS, 4 00:00:14,450 --> 00:00:20,870 instead we can use Firebase which is a free-to-use service or free to get started at least, where we 5 00:00:20,870 --> 00:00:24,890 don't need to write any server-side code to still get a server-side API 6 00:00:24,890 --> 00:00:25,960 we can work with. 7 00:00:26,250 --> 00:00:27,860 For that you just need a Google account 8 00:00:27,860 --> 00:00:33,600 and with that on firebase.google.com, you can go to that console and there create a new Firebase 9 00:00:33,600 --> 00:00:40,440 project. Simply click on add project there and give it any name you want, like rn-complete-guide, 10 00:00:40,460 --> 00:00:46,490 any name you like, set this checkmark here and create the project and wait for this to be done which 11 00:00:46,490 --> 00:00:48,010 will be super fast. 12 00:00:48,070 --> 00:00:53,690 Now getting started with Firebase won't cost you anything and you don't need a credit card to get started, 13 00:00:53,690 --> 00:00:59,210 check out the Firebase pricing documentation if you plan on using this in your production-ready application 14 00:00:59,210 --> 00:01:00,630 of course. 15 00:01:00,680 --> 00:01:05,900 So this was created and now we're taken to this newly created app and Firebase actually has a bunch 16 00:01:05,900 --> 00:01:06,850 of services, 17 00:01:06,920 --> 00:01:11,100 it's a fully managed backend which we all won't need, 18 00:01:11,270 --> 00:01:14,600 I just need the database there and that's important by the way, 19 00:01:14,600 --> 00:01:18,700 Firebase sounds like it's a database which we connect to our app. 20 00:01:18,800 --> 00:01:23,520 Actually you never directly connect a cloud database to your application, 21 00:01:23,540 --> 00:01:27,230 instead your application will always communicate with an API, 22 00:01:27,230 --> 00:01:33,530 typically a REST API which then in turn talks to a database because directly setting up a connection 23 00:01:33,530 --> 00:01:35,510 would be insecure. 24 00:01:35,510 --> 00:01:36,580 So that's how we'll do it 25 00:01:36,590 --> 00:01:43,400 and Firebase will give us both a REST API and then a database to which that API talks behind the scenes 26 00:01:43,580 --> 00:01:46,340 without us writing any query code. 27 00:01:46,370 --> 00:01:51,020 Still, we need to enable that database by clicking on database here and there, 28 00:01:51,020 --> 00:01:56,900 make sure you scroll down to the real time database and you click create there, real time database, not 29 00:01:56,900 --> 00:01:57,650 Firestore. 30 00:01:58,130 --> 00:02:05,090 Instead use the real time database and important, start in test mode which makes sure that the rules, 31 00:02:05,090 --> 00:02:09,660 the security rules are set up such that no authentication is required, 32 00:02:09,740 --> 00:02:15,080 we'll change that later to require authentication but for now, we have no users so we will start like 33 00:02:15,080 --> 00:02:16,180 this. 34 00:02:16,190 --> 00:02:21,800 Now this is later where you will see your data which you write to Firebase and its database and this 35 00:02:21,800 --> 00:02:28,970 is the URL or a part of the URL you need to send requests to to store data there or to fetch 36 00:02:28,970 --> 00:02:30,190 data from there 37 00:02:30,300 --> 00:02:35,690 and the cool thing about Firebase real time database is that it kind of gives you a database hidden 38 00:02:35,690 --> 00:02:42,410 behind the REST API where you can target dynamic REST API endpoints which will then automatically 39 00:02:42,410 --> 00:02:47,360 be translated to write or update requests on your database. 40 00:02:47,360 --> 00:02:53,240 So it looks like you're directly talking to a database but you always will talk to a REST API and then 41 00:02:53,240 --> 00:02:57,500 your incoming requests are kind of automatically translated to database queries 42 00:02:57,500 --> 00:03:04,290 you could say. This however is the URL or an important part of the URL we will talk to though. 43 00:03:04,580 --> 00:03:11,480 So with that, this is the URL we'll talk to and why don't we start with making sure that we can actually 44 00:03:11,480 --> 00:03:16,190 create new products and store them there, so that when I submit a new product, we don't just save it 45 00:03:16,190 --> 00:03:22,080 here in memory but we actually send a request to Firebase to store it on its servers. 46 00:03:22,100 --> 00:03:25,740 That is exactly what I want to do here because to me that makes a lot of sense.