diff --git a/.env.example b/.env.example
index ce81892..a33877b 100644
--- a/.env.example
+++ b/.env.example
@@ -1 +1,11 @@
+BASE_URL=
DATABASE_URL=
+BODY_SIZE_LIMIT=
+
+MINIO_URL=
+MINIO_ACCESS_KEY=
+MINIO_SECRET_KEY=
+MINIO_BUCKET=
+
+THUMBOR_ENDPOINT=
+THUMBOR_SECRET=
\ No newline at end of file
diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml
index 7048a51..47a66bb 100644
--- a/docker-compose.dev.yml
+++ b/docker-compose.dev.yml
@@ -7,3 +7,17 @@ services:
MARIADB_ROOT_PASSWORD: development
ports:
- '3306:3306'
+ thumbor:
+ build:
+ dockerfile: thumbor.Dockerfile
+ restart: always
+ ports:
+ - '8888:80'
+ extra_hosts:
+ - 'host.docker.internal:host-gateway'
+ environment:
+ - 'SECURITY_KEY=development'
+ - 'ALLOW_UNSAFE_URL=False'
+ - 'STORAGE=thumbor.storages.no_storage'
+ - 'ENGINE=thumbor_video_engine.engines.video'
+ # - 'FILTERS=[thumbor_video_engine.filters.format,thumbor_video_engine.filters.still]'
diff --git a/prisma/migrations/20240829084742_thumbnails/migration.sql b/prisma/migrations/20240829084742_thumbnails/migration.sql
new file mode 100644
index 0000000..677c751
--- /dev/null
+++ b/prisma/migrations/20240829084742_thumbnails/migration.sql
@@ -0,0 +1,12 @@
+-- CreateTable
+CREATE TABLE `Thumbnail` (
+ `id` VARCHAR(191) NOT NULL,
+ `uploadId` VARCHAR(191) NOT NULL,
+ `placeholder` VARCHAR(191) NOT NULL,
+
+ UNIQUE INDEX `Thumbnail_uploadId_key`(`uploadId`),
+ PRIMARY KEY (`id`)
+) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
+
+-- AddForeignKey
+ALTER TABLE `Thumbnail` ADD CONSTRAINT `Thumbnail_uploadId_fkey` FOREIGN KEY (`uploadId`) REFERENCES `Upload`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
diff --git a/prisma/migrations/20240829085742_thumbnails/migration.sql b/prisma/migrations/20240829085742_thumbnails/migration.sql
new file mode 100644
index 0000000..7889008
--- /dev/null
+++ b/prisma/migrations/20240829085742_thumbnails/migration.sql
@@ -0,0 +1,10 @@
+/*
+ Warnings:
+
+ - You are about to drop the column `placeholder` on the `Thumbnail` table. All the data in the column will be lost.
+ - Added the required column `fileName` to the `Thumbnail` table without a default value. This is not possible if the table is not empty.
+
+*/
+-- AlterTable
+ALTER TABLE `Thumbnail` DROP COLUMN `placeholder`,
+ ADD COLUMN `fileName` LONGTEXT NOT NULL;
diff --git a/prisma/migrations/20240829095034_thumbnail_id/migration.sql b/prisma/migrations/20240829095034_thumbnail_id/migration.sql
new file mode 100644
index 0000000..53d8bc2
--- /dev/null
+++ b/prisma/migrations/20240829095034_thumbnail_id/migration.sql
@@ -0,0 +1,11 @@
+/*
+ Warnings:
+
+ - The primary key for the `Thumbnail` table will be changed. If it partially fails, the table could be left without primary key constraint.
+ - You are about to alter the column `id` on the `Thumbnail` table. The data in that column could be lost. The data in that column will be cast from `VarChar(191)` to `Int`.
+
+*/
+-- AlterTable
+ALTER TABLE `Thumbnail` DROP PRIMARY KEY,
+ MODIFY `id` INTEGER NOT NULL AUTO_INCREMENT,
+ ADD PRIMARY KEY (`id`);
diff --git a/prisma/schema.prisma b/prisma/schema.prisma
index 7775c27..1d9c495 100644
--- a/prisma/schema.prisma
+++ b/prisma/schema.prisma
@@ -53,11 +53,12 @@ model Upload {
uploader User @relation(fields: [uploaderId], references: [id])
uploaderId Int
- fileName String @db.LongText
- internalName String @db.LongText
+ fileName String @db.LongText
+ internalName String @db.LongText
size Int
- public Boolean @default(true)
- uploaded DateTime @default(now())
+ public Boolean @default(true)
+ uploaded DateTime @default(now())
+ thumbnail Thumbnail?
}
model APIKey {
@@ -69,6 +70,13 @@ model APIKey {
permissions Int
}
+model Thumbnail {
+ id Int @id @default(autoincrement())
+ upload Upload @relation(fields: [uploadId], references: [id])
+ uploadId String @unique
+ fileName String @db.LongText
+}
+
enum Role {
ADMINISTRATOR
USER
diff --git a/src/lib/components/Upload.svelte b/src/lib/components/Upload.svelte
new file mode 100644
index 0000000..dc57959
--- /dev/null
+++ b/src/lib/components/Upload.svelte
@@ -0,0 +1,35 @@
+
+
+
+