diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..735f871 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,48 @@ +# Use the official Bun image +FROM oven/bun:1 as base +WORKDIR /usr/src/app + +# Install dependencies into temp directory +# This will cache them and speed up future builds +FROM base AS install +RUN mkdir -p /temp/dev +COPY package.json bun.lock /temp/dev/ +RUN cd /temp/dev && bun install --frozen-lockfile + +# Install with --production (exclude devDependencies) +RUN mkdir -p /temp/prod +COPY package.json bun.lock /temp/prod/ +RUN cd /temp/prod && bun install --frozen-lockfile --production + +# Copy node_modules from temp directory +# Then copy all (non-ignored) project files into the image +FROM base AS prerelease +COPY --from=install /temp/dev/node_modules node_modules +COPY . . + +# [Optional] Tests & Build +ENV NODE_ENV=production +# RUN bun test +# RUN bun run build + +# Final stage for app image +FROM base AS release +COPY --from=install /temp/prod/node_modules node_modules +COPY --from=prerelease /usr/src/app/src src +COPY --from=prerelease /usr/src/app/package.json . +COPY --from=prerelease /usr/src/app/bun.lock . +COPY --from=prerelease /usr/src/app/tsconfig.json . +COPY --from=prerelease /usr/src/app/tailwind.config.js . +COPY --from=prerelease /usr/src/app/postcss.config.js . + +# Ensure the DB directory/file exists or is volume mounted +# We will handle the DB via volume in docker-compose +# Copy the seed script so we can run it if needed +COPY --from=prerelease /usr/src/app/src/db/seed.ts src/db/seed.ts +COPY --from=prerelease /usr/src/app/src/db/schema.ts src/db/schema.ts + +# Expose port +EXPOSE 3000/tcp + +# Start the server +ENTRYPOINT [ "bun", "run", "src/index.tsx" ] diff --git a/docker-compose.yml b/docker-compose.yml index 56c85f5..36db8c3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,7 +14,9 @@ services: keycloak: image: quay.io/keycloak/keycloak:23.0 - command: start-dev + command: start-dev --import-realm + volumes: + - ./realm-export.json:/opt/keycloak/data/import/realm.json environment: KC_DB: postgres KC_DB_URL: jdbc:postgresql://postgres:5432/keycloak @@ -22,6 +24,7 @@ services: KC_DB_PASSWORD: password KEYCLOAK_ADMIN: admin KEYCLOAK_ADMIN_PASSWORD: admin + KC_HOSTNAME_URL: http://localhost:8080/ ports: - "8080:8080" depends_on: @@ -34,4 +37,4 @@ volumes: networks: keycloak_network: - driver: bridge + driver: bridge \ No newline at end of file diff --git a/package.json b/package.json index f6bf4f3..91fb298 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,8 @@ "version": "1.0.50", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "dev": "bun run --watch src/index.ts" + "dev": "bun run --watch src/index.ts", + "db:migrate": "bun run src/db/migrator.ts" }, "dependencies": { "@elysiajs/cookie": "^0.8.0", diff --git a/realm-export.json b/realm-export.json new file mode 100644 index 0000000..fabf3d0 --- /dev/null +++ b/realm-export.json @@ -0,0 +1,35 @@ +{ + "id": "myrealm", + "realm": "myrealm", + "enabled": true, + "users": [ + { + "username": "user", + "enabled": true, + "credentials": [ + { + "type": "password", + "value": "password" + } + ], + "realmRoles": ["admin"] + } + ], + "clients": [ + { + "clientId": "cv-app", + "enabled": true, + "clientAuthenticatorType": "client-secret", + "secret": "urBMT3daJQQvPc05RvePnOlaK6MdQdSJ", + "redirectUris": [ + "http://localhost:3000/admin/callback" + ], + "webOrigins": [ + "http://localhost:3000" + ], + "publicClient": false, + "standardFlowEnabled": true, + "directAccessGrantsEnabled": true + } + ] +} diff --git a/src/components/AdminForms.tsx b/src/components/AdminForms.tsx index 51a3253..c208853 100644 --- a/src/components/AdminForms.tsx +++ b/src/components/AdminForms.tsx @@ -122,4 +122,53 @@ export const EducationForm = ({ edu }: any) => ( -); \ No newline at end of file +); + +export const ProjectForm = ({ proj }: any) => ( +
+); diff --git a/src/components/BaseHtml.tsx b/src/components/BaseHtml.tsx index 6595889..ba56242 100644 --- a/src/components/BaseHtml.tsx +++ b/src/components/BaseHtml.tsx @@ -44,13 +44,148 @@ export const BaseHtml = ({ children }: elements.Children) => ` opacity: 0.8; /* Slight transparency */ } /* Class for the ghost/placeholder when item is dragged */ - .sortable-ghost { - background-color: theme('colors.blue.50'); /* Lighter background */ - border: 1px dashed theme('colors.blue.300'); /* Dashed border */ - } - - - - ${children} -