/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.

Primary LanguageTypeScriptMIT LicenseMIT

File storage

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

Environment variables

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

To install project dependencies:

bun install

Prisma (ORM)

Apply prisma migrations:

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

Generate Prisma Client

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

To Run

bun run 

Some important links

License

MIT

Developer

developer: Ulisses Silvério

Ulisses Silvério