StoreBytes is an object storage service that provides bucket-based file management. Ideal for personal projects, it offers a user-friendly web interface and API integration for easy file storage and retrieval. The platform is designed to be self-hosted, making it a cost-effective alternative to cloud providers by avoiding unexpected fees while maintaining control over your data.
The web interface allows users to manage their storage buckets and files easily. It provides an intuitive interface to:
- Create and view buckets.
- Retrieve and download files.
- Manage API keys
Sign up and try it out for yourself: https://storebytes.domsapps.com
The API supports:
- Authentication: Generate and use JWT tokens to authenticate requests.
- File Upload: Upload files directly to specific buckets.
- File Access: Retrieve files using unique, obfuscated URLs.
Access the API: https://storebytesapi.domsapps.com
- .NET 8.0 SDK
- PostgreSQL
- Docker (for deployment)
git clone <repository-url>
cd StoreBytesAPICreate a .env file in the root directory with the following variables:
DATABASE_URL=Host=<host>;Port=<port>;Database=<db>;Username=<user>;Password=<password>
HASH_SECRET=<hashing-secret>
JWT_SECRET=<jwt-secret>Create a .env file in the root directory with the following variables:
STOREBYTESAPI_URL=<url for your storebytes api>
JWT_SECRET=<jwt-secret>Run the SQL scripts located in StoreBytes.DataAccess/Scripts/SqlMigrations/ to create the required tables.
V1_CreateDB.sqlV1_CreateUser.sqlV1.1.sql
-
Build and run the Docker images:
docker build -f ./StoreBytes.API/Dockerfile -t storebytes-api ./StoreBytes.API docker run -d -p 8000:8080 -p 8001:8081 --env-file .env --name storebytes-api storebytes-api docker build -f ./StoreBytes.Web/Dockerfile -t storebytes-web ./StoreBytes.Web docker run -d -p 8010:8080 -p 8011:8081 --env-file .env --name storebytes-web storebytes-web
-
Verify the containers are running:
docker ps
Alternatively, you can download the current images from Docker Hub:
dominicspinks/storebytesapi:latestdominicspinks/storebytesweb:latest
POST /auth/token
Use this endpoint to generate a short-lived JWT token using an API key.
{
"apiKey": "your-api-key"
}{
"token": "generated-jwt-token"
}POST /files/upload
Use this endpoint to upload a file to a specific bucket.
- Headers:
Authorization: Bearer <jwt-token>
- Body (Form-Data):
bucketName: Name of the bucket.file: The file to upload.
{
"url": "shortened-url-for-file"
}GET /files/{bucketHash}/{fileHash}
Use this endpoint to retrieve a file using its unique URL.
GET /files/{bucketHash}/{fileHash}The file will be returned as binary data.
This project is licensed under the MIT License.