{"id":24064500,"url":"https://github.com/dfm18/spring-boot-firebase-upload","last_synced_at":"2026-04-09T20:03:32.802Z","repository":{"id":263600854,"uuid":"832903020","full_name":"dfm18/spring-boot-firebase-upload","owner":"dfm18","description":"A demonstration of how to upload files to Firebase Storage using Spring Boot.","archived":false,"fork":false,"pushed_at":"2024-07-24T00:59:29.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-09T10:38:29.563Z","etag":null,"topics":["cloud","firebase","firebase-storage","java","junit","maven","spring","spring-boot","upload-file"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dfm18.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-24T00:59:26.000Z","updated_at":"2024-07-25T20:47:13.000Z","dependencies_parsed_at":"2024-11-19T12:59:38.739Z","dependency_job_id":"626a85e4-86da-4651-9caf-a72b96804dbf","html_url":"https://github.com/dfm18/spring-boot-firebase-upload","commit_stats":null,"previous_names":["dafexdev/spring-boot-firebase-upload","dfm18/spring-boot-firebase-upload"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfm18%2Fspring-boot-firebase-upload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfm18%2Fspring-boot-firebase-upload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfm18%2Fspring-boot-firebase-upload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfm18%2Fspring-boot-firebase-upload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dfm18","download_url":"https://codeload.github.com/dfm18/spring-boot-firebase-upload/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240907853,"owners_count":19876691,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud","firebase","firebase-storage","java","junit","maven","spring","spring-boot","upload-file"],"created_at":"2025-01-09T10:37:15.005Z","updated_at":"2026-04-09T20:03:32.743Z","avatar_url":"https://github.com/dfm18.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring Boot Firebase Upload\n\n[![Java](https://img.shields.io/badge/Java-ED8B00?style=for-the-badge\u0026logo=openjdk\u0026logoColor=white)](https://www.java.com/es/)\n[![Maven](https://img.shields.io/badge/Apache_Maven-C71A36?style=for-the-badge\u0026logo=apachemaven\u0026logoColor=white)](https://maven.apache.org/)\n[![Spring](https://img.shields.io/badge/Spring-6DB33F?style=for-the-badge\u0026logo=spring\u0026logoColor=white)](https://spring.io/)\n[![Spring Boot](https://img.shields.io/badge/Spring_Boot-F2F4F9?style=for-the-badge\u0026logo=spring-boot)](https://spring.io/projects/spring-boot)\n[![JUnit](https://img.shields.io/badge/JUnit-25A162?style=for-the-badge\u0026logo=junit5\u0026logoColor=white)](https://junit.org/junit5/)\n[![Firebase](https://img.shields.io/badge/firebase-ffca28?style=for-the-badge\u0026logo=firebase\u0026logoColor=black)](https://firebase.google.com)\n\nThis project is a demonstration of how to upload files to Firebase Storage using Spring Boot.\n\n## Requirements\n\n- Java 21\n- Maven\n- Firebase account with access to Firebase Storage and a JSON credentials file\n\n## Configuration\n\n1. **Configure Firebase**\n\n   Make sure you have a project in Firebase and download the JSON credentials file. This file is used to authenticate the application with Firebase.\n\n2. **Set up environment variables**\n\n   We use environment variables to configure access to Firebase. Create a `.env` file in the root directory of the project based on the example file `.env.example`:\n\n   ```env\n   FIREBASE_CREDENTIALS_PATH=/path/to/your/firebase/credentials.json\n   FIREBASE_STORAGE_BUCKET_NAME=your-firebase-storage-bucket\n   ```\n\n   Replace `/path/to/your/firebase/credentials.json` with the path to the JSON credentials file and `your-firebase-storage-bucket` with the name of your Firebase Storage bucket.\n\n3. **Configure the `application.properties` file**\n\n   The `src/main/resources/application.properties` file should contain:\n\n   ```conf\n   spring.application.name=spring-firebase-upload\n\n   firebase.credentials-path=${FIREBASE_CREDENTIALS_PATH}\n   firebase.storage.bucket-name=${FIREBASE_STORAGE_BUCKET_NAME}\n   ```\n\n## Running the application\n\n1. **Load the environment variables**\n\n   Make sure the environment variables are set. In IntelliJ IDEA, you can add the variables from the `.env` file to the environment variables in the run configurations:\n\n   - Open the \"Run/Debug Configurations\" dialog.\n   - Select your run configuration.\n   - In the \"Environment Variables\" field, click the folder button.\n   - Choose the `.env` file in the file chooser.\n   - Save the changes.\n\n   You can find the Jetbrains Official Tutorial [here](https://www.jetbrains.com/help/objc/add-environment-variables-and-program-arguments.html#add-environment-variables).\n\n2. **Run the application**\n\n   ```bash\n   mvn spring-boot:run\n   ```\n\n   The application will be available at `http://localhost:8080`.\n\n## Endpoints\n\n   - **POST `/upload`**\n\n      This endpoint allows you to upload files to Firebase Storage. You can send files using the file parameter in the request.\n\n      Example usage with curl:\n\n      ```bash\n      curl -F \"file=@/path/to/your/file.txt\" http://localhost:8080/upload\n      ```\n\n      It will return the public link of the uploaded file.\n\n## Tests\n\nTests are set up to verify the upload, retrieval, and deletion of files in Firebase Storage. To run the tests, use the following command:\n\n```bash\nmvn test\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfm18%2Fspring-boot-firebase-upload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfm18%2Fspring-boot-firebase-upload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfm18%2Fspring-boot-firebase-upload/lists"}