This project demonstrates how to integrate Firebase with a Spring Boot application for performing CRUD operations. The project uses Firebase Firestore as the database to store user data.
- Java 17
- Maven
- Firebase Account
- A Spring Boot application
git clone https://github.com/yourusername/firebase-integration.git
cd firebase-integration- Go to the Firebase Console.
- Click "Add project" and follow the setup steps.
- Once your project is created, navigate to the project dashboard.
- Create a Firestore Database within the project.
- In the Firebase Console, go to Project Settings.
- Navigate to the "Service accounts" tab.
- Click "Generate new private key" and download the JSON file.
- Place this file in the src/main/resources directory and rename it to serviceAccountKey.json.
- Navigate to
firebase-integration/. Run:
mvn clean install
mvn spring-boot:run- Create a User
curl -X POST http://localhost:8080/users -H "Content-Type: application/json" -d "{\"id\": \"1\", \"name\": \"John Doe\", \"subjectMarks\": {\"Math\": 90, \"Science\": 85}}"- Get a User
curl -X GET http://localhost:8080/users/1- Update a User
curl -X PUT http://localhost:8080/users -H "Content-Type: application/json" -d "{\"id\": \"1\", \"name\": \"Updated Name\", \"subjectMarks\": {\"Math\": 95, \"Science\": 90}}"- Delete a User
curl -X DELETE http://localhost:8080/users/1You can watch a demonstration of this project in action in the following video: https://drive.google.com/file/d/1R8zT61qSSGm6-lmzSx1v7yN229lFSCVq/view?usp=drive_link
Thanks for visiting!!