Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 15 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,22 @@ DOCKER_DATABASE_NAME="startui"
DOCKER_DATABASE_USERNAME="startui"
DOCKER_DATABASE_PASSWORD="startui"

DOCKER_MINIO_API_PORT="9000"
DOCKER_MINIO_UI_PORT="9001"
DOCKER_MINIO_USERNAME="minioadmin"
DOCKER_MINIO_PASSWORD="minioadmin"

# S3
S3_ENDPOINT="http://127.0.0.1:${DOCKER_MINIO_FORWARD_PORT}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix undefined variable reference.

Line 15 references DOCKER_MINIO_FORWARD_PORT which is not defined anywhere in this file. This will cause the S3 endpoint configuration to fail.

Apply this diff to use the correct variable:

-S3_ENDPOINT="http://127.0.0.1:${DOCKER_MINIO_FORWARD_PORT}"
+S3_ENDPOINT="http://127.0.0.1:${DOCKER_MINIO_API_PORT}"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
S3_ENDPOINT="http://127.0.0.1:${DOCKER_MINIO_FORWARD_PORT}"
S3_ENDPOINT="http://127.0.0.1:${DOCKER_MINIO_API_PORT}"
🤖 Prompt for AI Agents
In .env.example around line 15, the S3_ENDPOINT references an undefined variable
DOCKER_MINIO_FORWARD_PORT; either change that reference to the actual port
variable used elsewhere in this file (for example DOCKER_MINIO_PORT or
MINIO_PORT) or add a definition for DOCKER_MINIO_FORWARD_PORT above so the
variable is defined; update the line so S3_ENDPOINT uses a defined port
variable.

S3_BUCKET_NAME="start-ui-bucket"
S3_ACCESS_KEY_ID="startui-access-key"
S3_SECRET_ACCESS_KEY="startui-secret-key"
S3_REGION="default"

# PUBLIC CONFIG
VITE_S3_BUCKET_PUBLIC_URL="http://127.0.0.1:${DOCKER_MINIO_API_PORT}/${S3_BUCKET_NAME}"
VITE_BASE_URL="http://localhost:${VITE_PORT}"

# Use the following environment variables to show the environment name.
VITE_ENV_NAME="LOCAL"
VITE_ENV_EMOJI="🚧"
Expand All @@ -20,7 +34,7 @@ VITE_IS_DEMO="false"
DATABASE_URL="postgres://${DOCKER_DATABASE_USERNAME}:${DOCKER_DATABASE_PASSWORD}@localhost:${DOCKER_DATABASE_PORT}/${DOCKER_DATABASE_NAME}"

# AUTH
BETTER_AUTH_SECRET="REPLACE ME" # You can use `npx @better-auth/cli@latest secret` to a generated secret
BETTER_AUTH_SECRET="REPLACE ME" # You can use `npx @better-auth/cli@latest secret` to a generated secret
SESSION_EXPIRATION_IN_SECONDS=2592000 # 30 days
SESSION_UPDATE_AGE_IN_SECONDS=86400 # 1 day (every 1 day the session expiration is updated)
AUTH_TRUSTED_ORIGIN="start-ui-native://,start-ui-native://*" # Mobile app scheme for trustedOrigins config
Expand Down
38 changes: 38 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,41 @@ services:
interval: 10s
timeout: 5s
retries: 5

minio:
image: minio/minio:RELEASE.2025-07-23T15-54-02Z-cpuv1
ports:
- '${DOCKER_MINIO_API_PORT}:9000'
- '${DOCKER_MINIO_UI_PORT}:9001'
environment:
- MINIO_ROOT_USER=${DOCKER_MINIO_USERNAME}
- MINIO_ROOT_PASSWORD=${DOCKER_MINIO_PASSWORD}
volumes:
- minio:/data/minio
command: minio server /data/minio --console-address :${DOCKER_MINIO_UI_PORT}
healthcheck:
test: ['CMD', 'mc', 'ready', 'local']
interval: 5s
timeout: 5s
retries: 5

createbucket:
image: minio/mc:RELEASE.2025-08-13T08-35-41Z-cpuv1
profiles:
- init
depends_on:
minio:
condition: service_healthy
entrypoint: ['']
command: ["sh", "-c", "
mc alias set default http://minio:${DOCKER_MINIO_API_PORT} \"${DOCKER_MINIO_USERNAME}\" \"${DOCKER_MINIO_PASSWORD}\";
mc admin user add default ${S3_ACCESS_KEY_ID} ${S3_SECRET_ACCESS_KEY};
mc admin policy attach default readwrite --user ${S3_ACCESS_KEY_ID};
mc mb --ignore-existing default/${S3_BUCKET_NAME} 2>/dev/null;
mc anonymous set download default/${S3_BUCKET_NAME};
echo 'Bucket configuration completed successfully';
"]
restart: "no"

volumes:
minio:
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"test:ui": "vitest",
"e2e": "dotenv -- cross-env playwright test",
"e2e:ui": "dotenv -- cross-env playwright test --ui",
"dk:init": "docker compose up -d",
"dk:init": "docker compose --profile init up -d",
"dk:start": "docker compose start",
"dk:stop": "docker compose stop",
"dk:clear": "docker compose down --volumes",
Expand All @@ -42,6 +42,7 @@
"db:seed": "dotenv -- cross-env node ./run-jiti ./prisma/seed/index.ts"
},
"dependencies": {
"@aws-sdk/client-s3": "3.864.0",
"@base-ui-components/react": "1.0.0-beta.1",
"@bearstudio/ui-state": "1.0.2",
"@fontsource-variable/inter": "5.2.6",
Expand All @@ -67,6 +68,7 @@
"@tanstack/zod-adapter": "1.132.31",
"@uidotdev/usehooks": "2.4.1",
"better-auth": "1.2.10",
"better-upload": "2.0.1",
"boring-avatars": "1.11.2",
"class-variance-authority": "0.7.1",
"clsx": "2.1.1",
Expand Down
Loading
Loading