ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก

Building a RESTful API with Cloud Functions and Firestore - CRUD OPERATTIONS For Beginners

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ส.ค. 2024
  • In this FREE training, I will show you how simple it is to create a fully function RESTFULL API Services using , Firebase Cloud Functions.....👇
    Source Links:
    ..........
    Project File:
    GitHub:- github.com/Vetrivel-VP/cloudF...
    Follow us on:
    codewithvetri.web.app/
    Follow us on:
    codewithvetri.web.app/
    ---------------------------------------------------------------------------------------------------------------------
    Suggested Videos
    React Dashboard - • ReactJS Tutorial for B...
    Animated Landing Page : • Animated Fashion Desig...
    Bootstrap 5 : Full Screen Image Background : • Bootstrap 5 : Full Scr...
    Sliding Sign In & Sign Up Form | Rsponsive : • Sliding Sign In & Sign...
    Glassmorphism | Neumorphism : • Glassmorphism | Neumor...
    ---------------------------------------------------------------------------------------------------------------------
    Social Media:
    Facebook:
    / velvetri452
    Instagram:
    @vetrivel_ravi
    Linkedin:
    / velvetri
    ---------------------------------------------------------------------------------------------------------------------
    Music :-
    Song: Atch - Echoes
    Music provided by Vlog No Copyright Music.
    Creative Commons - Attribution 3.0 Unported
    Video Link: • Atch - Echoes (Vlog No...
    Chapters
    00:00 - Intro
    01:42 - Project Setup
    12:59 - Configurations
    16:16 - Configuring Security Key
    18:20 - Creating App
    22:54 - Creating API Create - POST
    33:48 - Fetching Specific Data - GET
    38:46 - Fetch All Data - GET
    45:45 - Update Data - PUT
    50:21 - Delete Data - DELETE
    52:30 - Deploying API

ความคิดเห็น • 69

  • @felixizarra8513
    @felixizarra8513 ปีที่แล้ว

    Incredible video, thank you very much I was able to follow everything. Very concrete and useful, you rock.

  • @Leavoda
    @Leavoda 5 หลายเดือนก่อน

    Finally it wooorks! Thank you very much for great tutorial!

  • @chethiyakd
    @chethiyakd 2 ปีที่แล้ว +1

    dude! finally I found the tutorial I was looking for, I love your explanations. Thank you so much!

  • @GabrielObadia
    @GabrielObadia 11 หลายเดือนก่อน

    this was super helpful, couldn't find a lot of this info anywhere until this video.

    • @VetrivelRavi
      @VetrivelRavi  11 หลายเดือนก่อน

      Glad you enjoyed it!

  • @jetcurioso6349
    @jetcurioso6349 2 ปีที่แล้ว

    Great tutorial for REST API with Firebase. Keep doing great things bro! 👊🔥

  • @meteor1
    @meteor1 ปีที่แล้ว

    Thanks for the video, helped me to understand and do first deploy to firebase, I needed some light/easy to set up backend over my NextJS app, works perfectly fine.

  • @ramiaboomar2261
    @ramiaboomar2261 2 ปีที่แล้ว +1

    Thank you! you helped me out a lot keep up the good work!

  • @nilangagayashan5650
    @nilangagayashan5650 5 หลายเดือนก่อน

    thank you brother crystal clear explanation

  • @junior666kimera
    @junior666kimera ปีที่แล้ว

    Hi dude, thanks! you are the best!

  • @BenQuackenbush-wv6qw
    @BenQuackenbush-wv6qw ปีที่แล้ว +1

    You're my hero. Thank you!

  • @Explorers05
    @Explorers05 4 หลายเดือนก่อน

    its a great tutorial all concepts cleared

  • @johnmackenzie3871
    @johnmackenzie3871 ปีที่แล้ว

    Thank you for this video, it's perfect!

  • @kennardsugirotok7374
    @kennardsugirotok7374 ปีที่แล้ว

    You're a great teacher !

  • @johnmartin9329
    @johnmartin9329 9 หลายเดือนก่อน

    best best video till now thankuu bro for this awsom tutorial

  • @akashkrishnan4524
    @akashkrishnan4524 ปีที่แล้ว

    Excellent Work Vetri

  • @tikilish_yeh69
    @tikilish_yeh69 2 ปีที่แล้ว

    I am so happy i found this...

  • @razafimandimbymamynantenai2339
    @razafimandimbymamynantenai2339 2 ปีที่แล้ว

    Thank you very much for that tutorial bro, You help me very much 😉

  • @randikamuhammad1369
    @randikamuhammad1369 ปีที่แล้ว

    maybe god always bless you, thnks for help 🙏

  • @rutvikpawar9812
    @rutvikpawar9812 หลายเดือนก่อน

    best video

  • @daco9464
    @daco9464 7 หลายเดือนก่อน

    Great video! Maybe the best I ever saw for Firestore API usage. But here 3:07 I don't understand one thing. I have so or so to switch later in production mode, if I want to use my API in commercial projects. Wich code should have the rules block , so I can use the API ?

  • @chuckdeez810
    @chuckdeez810 11 หลายเดือนก่อน

    This was a great tutorial, however, I got all the way to deploy without issues, but when I run 'firebase deploy' I get an error - if I rerun it then sometimes it successfully deploys in terminal, but on the console it still says function deployment failed - any ideas?

  • @rajblr6656
    @rajblr6656 ปีที่แล้ว

    Hi Vetri, thanks for this awesome video. It would be great if you can tell us how to handle relationship between the collections using the REST API using Cloud Functions. For example, connecting Students to the Teacher. and querying students of a teacher using REST API URL Params. Thanks.

    • @VetrivelRavi
      @VetrivelRavi  ปีที่แล้ว

      Hi can you please elaborate your question.......

    • @johnmartin9329
      @johnmartin9329 9 หลายเดือนก่อน

      he means to say when he has more than one db one for teacher one for student and they connected with each other through some ids so how to manage this i Think@@VetrivelRavi

    • @VetrivelRavi
      @VetrivelRavi  9 หลายเดือนก่อน

      Handling relationships between collections using REST API and Cloud Functions is a common and important use case. To connect Students to a Teacher, you can structure your Firestore database like this:
      Create a 'Teachers' collection where each document represents a teacher, and each document contains information about the teacher.
      Create a 'Students' collection where each document represents a student, and each document contains information about the student. Additionally, you can include a field that links each student to a teacher, such as a 'teacherId' field.
      When creating or updating a student's information, be sure to include the 'teacherId' field to indicate their relationship with a specific teacher.

  • @janelleschannel-nn4mx
    @janelleschannel-nn4mx ปีที่แล้ว

    Once I deployed the api successfully, when I try to go to my post route using insomnia, I get a google signin page. Why is this happening? I also have a couple of questions - does the app only fire up when an endpoint is hit? So is this a slower way than just doing the crud operations through the application itself instead of hitting endpoints in the functions api? Just wondering because I have three apps using the same firestore database so I thought having all the curd operations in one place (a firebase function api) would simplify it. But, if it slows it down that would be a problem.

  • @PCAALWINRAJAS
    @PCAALWINRAJAS 2 ปีที่แล้ว +1

    👍👌🤩✌️

  • @BCS_Mdadilkhan
    @BCS_Mdadilkhan ปีที่แล้ว

    will u plz make trigger function like onDocumentCreated onDocumentUpdated onDocumentDeleted batch write etc in nodejs

  • @benhmidasaif6946
    @benhmidasaif6946 ปีที่แล้ว

    if i need to make some attribute required how should i do ? ( for example i need to make the user name required )
    thanks for the good tuto

    • @VetrivelRavi
      @VetrivelRavi  ปีที่แล้ว

      That we can do it on client side itself

  • @unexpert
    @unexpert ปีที่แล้ว

    Thanks for the detailed tutorial!
    One question, is it possible to pass a query parameters as such?
    'api/getAll?id=123456'

    • @VetrivelRavi
      @VetrivelRavi  ปีที่แล้ว

      you do the following
      app.get("/api/getUser/:userId",(req, res) => {
      const userId = req.params.userId;
      --------- your code here -------
      });
      While calling : localhost:3500/api/getUser/102114

  • @aramabdulrahman2087
    @aramabdulrahman2087 2 ปีที่แล้ว +1

    please sir i have some question 1-please add another video means add auth and user roles management to this article.. 2-which better to more search request realtime db or firestore db depending on price loots of thanks for your best tutorial.............

    • @VetrivelRavi
      @VetrivelRavi  2 ปีที่แล้ว +1

      Noted...I try make this video simple as possible only because for beginners its easy to understand. On upcoming video all the features will be included....

    • @zakblacki
      @zakblacki 2 ปีที่แล้ว

      @@VetrivelRavi Bro we're still waiting for auth ...following this

  • @frankboateng8846
    @frankboateng8846 ปีที่แล้ว

    Thanks for you explanation. Can you add user profile to this API?

    • @VetrivelRavi
      @VetrivelRavi  ปีที่แล้ว

      Yes you can!.....That will be saved in the firebase authentication tab.....from there we need to access those details

  • @arnoldoalvarez6057
    @arnoldoalvarez6057 ปีที่แล้ว +1

    The video i was looking for, nice. Let me ask you something, i am running 'firebase login' command but a i got an error of 'Not a command" or something. Do you have to install something before you run 'firebase login' and 'firebase init'? Thanks

    • @VetrivelRavi
      @VetrivelRavi  ปีที่แล้ว

      install firebase-admin-tools package

    • @arnoldoalvarez6057
      @arnoldoalvarez6057 ปีที่แล้ว

      @@VetrivelRavi Thanks Ravi, i finished the video and it was a great introduction to what i needed to learn. It would've been nice if you would've added another end point in order to get docs from a collection that matches a specific criteria. Example: 'Get all users from a specific city', 'Get all orders from a specific customer' etc etc. But again, super thanks for the value of this video....

    • @VetrivelRavi
      @VetrivelRavi  ปีที่แล้ว

      Glad you enjoyed it...I will prepare one video soon

  • @smitpatel260
    @smitpatel260 ปีที่แล้ว

    ui: Fatal error occurred:
    Emulator UI has exited: Error: spawn node ENOENT,
    stopping all running emulators
    Getting this after npm run serve

  • @kareemmarwan3436
    @kareemmarwan3436 ปีที่แล้ว

    How can I upload a file or image within the sent data please help
    I want to create an item consisting of a personal photo, name and phone number

    • @VetrivelRavi
      @VetrivelRavi  ปีที่แล้ว +1

      That has to be done on the frontend......From the front end we will upload the image and pass the downloadurl of the image or a file to the backend.....

  • @O-EllysaNovelyaHarefa
    @O-EllysaNovelyaHarefa ปีที่แล้ว

    hello, i got an error message after follow the instruction in creating app, the error message said that was an internal server error status code 500. how to solve this?

    • @VetrivelRavi
      @VetrivelRavi  ปีที่แล้ว

      this might happens only if you server code having some errors.....please do check the place where we are creating our server app

  • @thearmourman9816
    @thearmourman9816 ปีที่แล้ว

    sir i am getting eslint error while writing async function how to fix it?

    • @VetrivelRavi
      @VetrivelRavi  ปีที่แล้ว +1

      You need updated the eslint file or recreate the functions without eslint

  • @lollingx1
    @lollingx1 ปีที่แล้ว +1

    You don't really need to set the Id using the date, Firebase will create a unique ID

    • @VetrivelRavi
      @VetrivelRavi  ปีที่แล้ว

      Yes....But I dont want to use that, I need to use my own ID for my own reference in the front end

  • @kennardsugirotok7374
    @kennardsugirotok7374 ปีที่แล้ว

    ggwp b ro

  • @user-pr6fn1jz6m
    @user-pr6fn1jz6m 2 ปีที่แล้ว +1

    Brother frontend

    • @VetrivelRavi
      @VetrivelRavi  2 ปีที่แล้ว +1

      That's just a back end brother..You can use it as an API to access it int front end

    • @user-pr6fn1jz6m
      @user-pr6fn1jz6m 2 ปีที่แล้ว +1

      @@VetrivelRavi ok thanks bhaiya

  • @poter3480
    @poter3480 3 หลายเดือนก่อน

    Tamila bro ??

  • @elias8294
    @elias8294 ปีที่แล้ว

    for some reason, the async function on line 28 keeps giving me a parsing error:
    app.post("/api/create", (req, res) => {
    (async () => {
    try {
    await db.collection("userDetails").doc(`${Date.now()}`).create({
    id : Date.now(),
    name : req.body.name,
    phone : req.body.phone,
    address : req.body.address
    });
    return res.status(200).send({status : "Sucess" , msg: "Data Saved"});
    } catch(error){
    console.log(error)
    return res.status(500).send({ status: "Failed", msg: error });
    }
    })();
    });

    • @elias8294
      @elias8294 ปีที่แล้ว

      are you using es7? when I switch that, its gone but then the function times out.

    • @elias8294
      @elias8294 ปีที่แล้ว

      I firgured it out, I had change my parser options in .jslint because I'm using node 18 and ECMAScript 10

    • @VetrivelRavi
      @VetrivelRavi  ปีที่แล้ว

      I am not sure, please do share me the exact error code