Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
8bbeca0
Merge pull request #42 from derGraph/main
derGraph Jun 10, 2025
81ed932
non working, implement own auth code, next find all lucia functions a…
derGraph Jun 10, 2025
1389dd0
removing lucia auth
derGraph Jun 11, 2025
4e50118
cookie settings
derGraph Jun 11, 2025
6afa715
package updates
derGraph Jun 11, 2025
f0f0545
updated versions, GUI needs fixing
derGraph Jun 11, 2025
f8dae26
fix layout + dark mode
derGraph Jun 16, 2025
9feebed
fix trips page
derGraph Jun 16, 2025
7df5c04
fix trips page and layout
derGraph Jun 16, 2025
143022c
fix trips page pagination
derGraph Jun 16, 2025
80a5340
fix avatar
derGraph Jun 17, 2025
85ef051
fixes for skeleton change
derGraph Jun 17, 2025
17fe3a9
change transparany of searchBar
derGraph Jun 19, 2025
06274c7
implement new permission into Datapoint/Datapoints
derGraph Jun 19, 2025
7be0d1d
formatting in schema.prisma
derGraph Jun 19, 2025
9b53beb
Merge commit '94338fdfb5064d4e083736eefcd22b9a0d6c64a5' into development
derGraph Jun 19, 2025
0445657
add roles to media + trips
derGraph Jun 21, 2025
73afdeb
roles implementation finished
derGraph Jun 21, 2025
9b813df
first steps of create user
derGraph Jun 22, 2025
3c76941
finished createUser in backend, todo: roles in frontend!
derGraph Jun 23, 2025
eff09f5
fix in layout, session handling when logging in
derGraph Jun 23, 2025
df53bac
fix primary key for magicLink/paswordHash
derGraph Jun 23, 2025
75c5e66
testdeploy
derGraph Jun 25, 2025
3da22d3
add debug buffer
derGraph Jun 25, 2025
8db03c7
fix cloudflare chaching
derGraph Jun 25, 2025
df026d8
another try
derGraph Jun 25, 2025
be29614
fixed cloudflare caching
derGraph Jun 25, 2025
4f65175
finish uploadMedia
derGraph Jun 28, 2025
cd6eb43
fix Datapoint order
derGraph Jun 29, 2025
037de5d
implement location in media
derGraph Jun 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ Section 8 -- Interpretation.
Creative Commons is not a party to its public
licenses. Notwithstanding, Creative Commons may elect to apply one of
its public licenses to material it publishes and in those instances
will be considered the �Licensor.� The text of the Creative Commons
will be considered the �Licensor.� The text of the Creative Commons
public licenses is dedicated to the public domain under the CC0 Public
Domain Dedication. Except for the limited purpose of indicating that
material is shared under a Creative Commons public license or as
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### This is a project to share and record voyage data when sailing. It is my first attempt in svelte.

It uses prisma for Database and lucia for authentication. The project should adhere to EU-GDPR rules.
It uses prisma for Database Management. The project should adhere to EU-GDPR rules.
The companion app is written in flutter and is used to inject the data into the database.
All API-Endpoints used in the project are also available to the public. Log in via POST to /login and then use the cookie!

Expand Down
Binary file modified filePath
Binary file not shown.
58 changes: 24 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,43 +13,39 @@
"format": "prettier --write ."
},
"devDependencies": {
"@skeletonlabs/skeleton": "^2.10.3",
"@skeletonlabs/tw-plugin": "^0.4.0",
"@sveltejs/adapter-auto": "^3.3.1",
"@sveltejs/adapter-auto": "^6.0.1",
"@sveltejs/adapter-node": "^5.2.9",
"@sveltejs/kit": "^2.7.4",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@sveltejs/kit": "^2.21.4",
"@sveltejs/vite-plugin-svelte": "^5.1.0",
"@tailwindcss/forms": "^0.5.9",
"@tailwindcss/typography": "0.5.15",
"@tailwindcss/typography": "0.5.16",
"@types/leaflet": "^1.9.14",
"@types/node": "22.8.7",
"autoprefixer": "10.4.20",
"postcss": "8.4.47",
"@types/node": "24.0.0",
"autoprefixer": "10.4.21",
"prettier": "^3.3.3",
"prettier-plugin-svelte": "^3.2.7",
"prisma": "^6.1.0",
"prisma": "^6.10.1",
"svelte": "^5.1.9",
"svelte-check": "^4.0.5",
"tailwindcss": "3.4.14",
"tailwindcss": "^4.1.9",
"tslib": "^2.8.1",
"typescript": "^5.6.3",
"utility-types": "^3.11.0",
"vite": "^5.4.10",
"vite-plugin-tailwind-purgecss": "0.3.3"
"vite": "^6.3.5"
},
"type": "module",
"dependencies": {
"@lucia-auth/adapter-prisma": "^4.0.1",
"@node-rs/argon2": "^2.0.0",
"@prisma/client": "^6.1.0",
"@skeletonlabs/skeleton": "^2.10.3",
"@skeletonlabs/tw-plugin": "^0.4.0",
"@sveltejs/adapter-auto": "^3.3.1",
"@prisma/client": "^6.10.1",
"@skeletonlabs/skeleton": "^3.1.3",
"@skeletonlabs/skeleton-svelte": "^1.2.3",
"@sveltejs/adapter-auto": "^6.0.1",
"@sveltejs/adapter-node": "^5.2.9",
"@sveltejs/kit": "^2.7.4",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@sveltejs/vite-plugin-svelte": "^5.1.0",
"@tailwindcss/forms": "^0.5.9",
"@tailwindcss/typography": "0.5.15",
"@tailwindcss/postcss": "^4.1.10",
"@tailwindcss/typography": "0.5.16",
"@tailwindcss/vite": "^4.1.10",
"@tiptap/core": "^2.9.1",
"@tiptap/extension-blockquote": "^2.9.1",
"@tiptap/extension-bullet-list": "^2.9.1",
Expand All @@ -63,27 +59,21 @@
"@tiptap/extension-text-align": "^2.9.1",
"@tiptap/extension-typography": "^2.9.1",
"@types/leaflet": "^1.9.14",
"@types/node": "22.8.7",
"autoprefixer": "10.4.20",
"@types/node": "24.0.0",
"autoprefixer": "10.4.21",
"compression": "^1.7.5",
"express": "^4.21.1",
"exif-reader": "^2.0.2",
"express": "^5.1.0",
"geolib": "^3.3.4",
"isomorphic-dompurify": "^2.16.0",
"leaflet": "^1.9.4",
"lucia": "^3.2.2",
"pm2": "^5.4.2",
"postcss": "8.4.47",
"pm2": "^6.0.8",
"prettier": "^3.3.3",
"prettier-plugin-svelte": "^3.2.7",
"prisma": "^6.1.0",
"sailblog": "file:",
"sharp": "^0.33.5",
"sharp": "^0.34.2",
"svelte-check": "^4.0.5",
"tailwindcss": "3.4.14",
"tiptap-extension-resize-image": "^1.1.9",
"tslib": "^2.8.1",
"utility-types": "^3.11.0",
"vite": "^5.4.10",
"vite-plugin-tailwind-purgecss": "0.3.3"
"utility-types": "^3.11.0"
}
}
3 changes: 1 addition & 2 deletions postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {}
"@tailwindcss/postcss": {},
}
};
Binary file removed prisma/dev.db
Binary file not shown.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ CREATE TABLE `User` (
`email` VARCHAR(191) NOT NULL,
`firstName` VARCHAR(191) NULL,
`lastName` VARCHAR(191) NULL,
`description` VARCHAR(191) NULL,
`description` TEXT NULL,
`profilePictureId` VARCHAR(191) NULL,
`dateOfBirth` DATETIME(3) NULL,
`roleId` VARCHAR(191) NOT NULL DEFAULT 'user',
`activeTripId` VARCHAR(191) NOT NULL,
`activeTripId` VARCHAR(191) NULL,
`crewedLengthSail` INTEGER NOT NULL DEFAULT 0,
`crewedLengthMotor` INTEGER NOT NULL DEFAULT 0,
`skipperedLengthSail` INTEGER NOT NULL DEFAULT 0,
`skipperedLengthMotor` INTEGER NOT NULL DEFAULT 0,
`recalculate` BOOLEAN NOT NULL DEFAULT true,
`lastPing` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),

UNIQUE INDEX `User_username_key`(`username`),
Expand All @@ -22,6 +27,9 @@ CREATE TABLE `Session` (
`id` VARCHAR(191) NOT NULL,
`userId` VARCHAR(191) NOT NULL,
`expiresAt` DATETIME(3) NOT NULL,
`ip` VARCHAR(191) NULL,
`session_created` DATETIME(3) NULL,
`last_use` DATETIME(3) NULL,

PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Expand Down Expand Up @@ -50,15 +58,16 @@ CREATE TABLE `Key` (
CREATE TABLE `Trip` (
`id` VARCHAR(191) NOT NULL,
`name` VARCHAR(191) NOT NULL,
`description` VARCHAR(191) NULL,
`description` TEXT NULL,
`startPointId` VARCHAR(191) NULL,
`endPointId` VARCHAR(191) NULL,
`start` DATETIME(3) NULL,
`end` DATETIME(3) NULL,
`last_update` DATETIME(3) NOT NULL,
`length` DECIMAL(65, 30) NULL,
`length_sail` DECIMAL(65, 30) NULL,
`length_motor` DECIMAL(65, 30) NULL,
`skipperName` VARCHAR(191) NULL,
`visibility` BOOLEAN NOT NULL DEFAULT false,
`visibility` INTEGER NOT NULL DEFAULT 1,
`recalculate` BOOLEAN NOT NULL DEFAULT true,
`deleted` BOOLEAN NOT NULL DEFAULT false,

UNIQUE INDEX `Trip_startPointId_key`(`startPointId`),
UNIQUE INDEX `Trip_endPointId_key`(`endPointId`),
Expand All @@ -83,11 +92,19 @@ CREATE TABLE `Datapoint` (
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `Location` (
`name` VARCHAR(191) NOT NULL,

PRIMARY KEY (`name`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `Media` (
`id` VARCHAR(191) NOT NULL,
`visibility` INTEGER NOT NULL DEFAULT 1,
`username` VARCHAR(191) NOT NULL,
`alt` VARCHAR(191) NULL,

PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Expand All @@ -101,14 +118,23 @@ CREATE TABLE `_crew` (
INDEX `_crew_B_index`(`B`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `_LocationToTrip` (
`A` VARCHAR(191) NOT NULL,
`B` VARCHAR(191) NOT NULL,

UNIQUE INDEX `_LocationToTrip_AB_unique`(`A`, `B`),
INDEX `_LocationToTrip_B_index`(`B`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- AddForeignKey
ALTER TABLE `User` ADD CONSTRAINT `User_profilePictureId_fkey` FOREIGN KEY (`profilePictureId`) REFERENCES `Media`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `User` ADD CONSTRAINT `User_roleId_fkey` FOREIGN KEY (`roleId`) REFERENCES `Role`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `User` ADD CONSTRAINT `User_activeTripId_fkey` FOREIGN KEY (`activeTripId`) REFERENCES `Trip`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
ALTER TABLE `User` ADD CONSTRAINT `User_activeTripId_fkey` FOREIGN KEY (`activeTripId`) REFERENCES `Trip`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `Session` ADD CONSTRAINT `Session_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `User`(`username`) ON DELETE CASCADE ON UPDATE CASCADE;
Expand All @@ -126,7 +152,7 @@ ALTER TABLE `Trip` ADD CONSTRAINT `Trip_endPointId_fkey` FOREIGN KEY (`endPointI
ALTER TABLE `Trip` ADD CONSTRAINT `Trip_skipperName_fkey` FOREIGN KEY (`skipperName`) REFERENCES `User`(`username`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `Datapoint` ADD CONSTRAINT `Datapoint_tripId_fkey` FOREIGN KEY (`tripId`) REFERENCES `Trip`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
ALTER TABLE `Datapoint` ADD CONSTRAINT `Datapoint_tripId_fkey` FOREIGN KEY (`tripId`) REFERENCES `Trip`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `Media` ADD CONSTRAINT `Media_username_fkey` FOREIGN KEY (`username`) REFERENCES `User`(`username`) ON DELETE RESTRICT ON UPDATE CASCADE;
Expand All @@ -136,3 +162,9 @@ ALTER TABLE `_crew` ADD CONSTRAINT `_crew_A_fkey` FOREIGN KEY (`A`) REFERENCES `

-- AddForeignKey
ALTER TABLE `_crew` ADD CONSTRAINT `_crew_B_fkey` FOREIGN KEY (`B`) REFERENCES `User`(`username`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `_LocationToTrip` ADD CONSTRAINT `_LocationToTrip_A_fkey` FOREIGN KEY (`A`) REFERENCES `Location`(`name`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `_LocationToTrip` ADD CONSTRAINT `_LocationToTrip_B_fkey` FOREIGN KEY (`B`) REFERENCES `Trip`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
Warnings:

- Added the required column `secret` to the `Session` table without a default value. This is not possible if the table is not empty.

*/
-- AlterTable
ALTER TABLE `session` ADD COLUMN `secret` LONGBLOB NOT NULL;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- AlterTable
ALTER TABLE `session` MODIFY `session_created` DATETIME(3) NULL DEFAULT CURRENT_TIMESTAMP(3),
MODIFY `secret` LONGBLOB NOT NULL;
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-- AlterTable
ALTER TABLE `role` ADD COLUMN `canAddDatapoint` BOOLEAN NOT NULL DEFAULT true,
ADD COLUMN `canAddMedia` BOOLEAN NOT NULL DEFAULT true,
ADD COLUMN `canDeleteAllTrips` BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN `canDeleteCrewedTrips` BOOLEAN NOT NULL DEFAULT true,
ADD COLUMN `canDeleteOwnTrips` BOOLEAN NOT NULL DEFAULT true,
ADD COLUMN `canEditAllTrips` BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN `canEditAllUser` BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN `canEditOwnTrips` BOOLEAN NOT NULL DEFAULT true,
ADD COLUMN `canEditOwnUser` BOOLEAN NOT NULL DEFAULT true,
ADD COLUMN `canSeeAllMedia` BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN `canViewAllTrips` BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN `canViewAllUserdata` BOOLEAN NOT NULL DEFAULT false;

-- AlterTable
ALTER TABLE `session` MODIFY `secret` LONGBLOB NOT NULL;
2 changes: 2 additions & 0 deletions prisma/migrations/20250619201422_formatting/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE `session` MODIFY `secret` LONGBLOB NOT NULL;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- AlterTable
ALTER TABLE `role` ADD COLUMN `canCreateAllTrips` BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN `canCreateOwnTrips` BOOLEAN NOT NULL DEFAULT true;

-- AlterTable
ALTER TABLE `session` MODIFY `secret` LONGBLOB NOT NULL;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE `role` ADD COLUMN `canCreateUser` BOOLEAN NOT NULL DEFAULT false;

-- AlterTable
ALTER TABLE `session` MODIFY `secret` LONGBLOB NOT NULL;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE `session` MODIFY `secret` LONGBLOB NOT NULL;

-- AlterTable
ALTER TABLE `user` MODIFY `email` VARCHAR(191) NULL;
7 changes: 7 additions & 0 deletions prisma/migrations/20250622121740_/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- AlterTable
ALTER TABLE `role` ADD COLUMN `canUseMagicLink` BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN `canViewRoles` BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN `needsPassword` BOOLEAN NOT NULL DEFAULT true;

-- AlterTable
ALTER TABLE `session` MODIFY `secret` LONGBLOB NOT NULL;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE `session` MODIFY `secret` LONGBLOB NOT NULL;
5 changes: 5 additions & 0 deletions prisma/migrations/20250622152108_test/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- DropIndex
DROP INDEX `User_email_key` ON `user`;

-- AlterTable
ALTER TABLE `session` MODIFY `secret` LONGBLOB NOT NULL;
2 changes: 2 additions & 0 deletions prisma/migrations/20250623162111_/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE `session` MODIFY `secret` LONGBLOB NOT NULL;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- AlterTable
ALTER TABLE `media` ADD COLUMN `created` DATETIME(3) NULL,
ADD COLUMN `lat` DECIMAL(65, 30) NULL,
ADD COLUMN `long` DECIMAL(65, 30) NULL,
ADD COLUMN `tripId` VARCHAR(191) NULL;

-- AlterTable
ALTER TABLE `session` MODIFY `secret` LONGBLOB NOT NULL;

-- AddForeignKey
ALTER TABLE `Media` ADD CONSTRAINT `Media_tripId_fkey` FOREIGN KEY (`tripId`) REFERENCES `Trip`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
4 changes: 2 additions & 2 deletions prisma/migrations/migration_lock.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
provider = "mysql"
# It should be added in your version-control system (e.g., Git)
provider = "mysql"
Loading