chatdesk-ui/storage_v1.19.1
hailin ccac741f70 . 2025-05-26 17:13:17 +08:00
..
.docker first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00
migrations . 2025-05-26 17:13:17 +08:00
monitoring first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00
src first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00
static first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00
.dockerignore first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00
.env.sample first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00
.env.test.sample first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00
.eslintrc.js first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00
.gitignore first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00
.prettierignore first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00
.prettierrc first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00
.releaserc first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00
Dockerfile first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00
LICENSE first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00
README.md first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00
build.js first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00
docker-compose-multi-tenant.yml first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00
docker-compose.yml first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00
fly.toml first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00
jest-setup.ts first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00
jest.config.js first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00
jest.sequencer.js first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00
package-lock.json first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00
package.json first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00
tsconfig.json first commit, based chatbot-ui and self hosted supabase. 2025-05-18 22:23:26 +08:00

README.md

Supabase Storage Engine

Coverage Status

A scalable, light-weight object storage service.

Read this post on why we decided to build a new object storage service.

  • Multi-protocol support (HTTP, TUS, S3)
  • Uses Postgres as its datastore for storing metadata
  • Authorization rules are written as Postgres Row Level Security policies
  • Integrates with S3 Compatible Storages
  • Extremely lightweight and performant

Supported Protocols

  • HTTP/REST
  • TUS Resumable Upload
  • S3 Compatible API

Architecture

Documentation

Development

  • Copy .env.sample to .env file.
  • Copy .env.test.sample to .env.test.
cp .env.sample .env && cp .env.test.sample .env.test

Your root directory should now have both .env and .env.test files.

  • Then run the following:
# this sets up a postgres database and postgrest locally via docker
npm run infra:restart
# Start the storage server
npm run dev

The server should now be running at http://localhost:5000/

The following request should insert and return the list of buckets.

# insert a bucket named avatars
curl --location --request POST 'http://localhost:5000/bucket' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoic2VydmljZV9yb2xlIiwiaWF0IjoxNjEzNTMxOTg1LCJleHAiOjE5MjkxMDc5ODV9.th84OKK0Iz8QchDyXZRrojmKSEZ-OuitQm_5DvLiSIc' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "avatars"
}'

# get buckets
curl --location --request GET 'http://localhost:5000/bucket' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoic2VydmljZV9yb2xlIiwiaWF0IjoxNjEzNTMxOTg1LCJleHAiOjE5MjkxMDc5ODV9.th84OKK0Iz8QchDyXZRrojmKSEZ-OuitQm_5DvLiSIc'

Testing

To perform your tests you can run the following command: npm test