Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/odisseu93/file-storage-node

Example of a backend created to save, retrieve and delete files in Google Cloud Storage, using Node.js, Express and the Firebase SDK.
https://github.com/odisseu93/file-storage-node

back-end bun file-storage google-cloud image-storage multer prisma sqlite typescript

Last synced: 1 day ago
JSON representation

Example of a backend created to save, retrieve and delete files in Google Cloud Storage, using Node.js, Express and the Firebase SDK.

Awesome Lists containing this project

README

        

# File storage
Backend for uploading, downloading and deleting files on Google Cloud.

## Environment variables
```bash

API_URL="http://localhost:8080"
SERVICE_ACCOUNT_CREDENTIALS_PATH="./path_to_my_credential/credentials.json"

# Firebase environment variables
# https://firebase.google.com/docs/app-distribution/authenticate-service-account?platform=ios
API_KEY="my_api_key"
AUTH_DOMAIN="my_domain"
DATABASE_URL="my_database_url"
PROJECT_ID="firebase_project_id"
STORAGE_BUCKET="my-bucket.com"
MESSAGING_SENDER_ID="0000000"
APP_ID="id:00dsfdsljkjadslfkj"

```

## Running locally
**Bun (JavaScript runtime and toolkit)**: [installation link](https://bun.sh/)

To install project dependencies:
```bash
bun install
```

**[Prisma (ORM)](https://www.prisma.io/docs/getting-started)**

Apply prisma migrations:
```bash
# https://www.prisma.io/docs/orm/prisma-client/deployment/deploy-database-changes-with-prisma-migrate
npx prisma migrate deploy
```
Generate Prisma Client

```bash
# https://www.prisma.io/docs/orm/prisma-client/deployment/deploy-database-changes-with-prisma-migrate
npx prisma generate
```

To Run
```bash
bun run
```

## Some important links
- [Multer NPM package](https://www.npmjs.com/package/multer)
- [Firebase - Authenticate with a service account](https://firebase.google.com/docs/app-distribution/authenticate-service-account?platform=ios)
- [Firebase Admin SDK](https://firebase.google.com/docs/admin/setup)
- [Google cloud - Streaming-downloads](https://cloud.google.com/storage/docs/streaming-downloads)
- [Google cloud - Upload objects from memory](https://cloud.google.com/storage/docs/uploading-objects-from-memory)
- [Google cloud - Create a GET-signed URL](https://cloud.google.com/storage/docs/samples/storage-generate-signed-url-v4)

## License
[MIT](./LICENSE.md)
## Developer


developer: Ulisses Silvério





Ulisses Silvério