This commit is contained in:
2026-08-22 19:34:10 +02:00
parent ebdd41d965
commit 4e3c5b641e
8 changed files with 57 additions and 15 deletions
+7 -8
View File
@@ -1,11 +1,10 @@
DB_DRIVER=postgres # ── SQLite (default for local dev) ──
POSTGRES_DB=surprise DB_DRIVER=sqlite
POSTGRES_USER=surprise
POSTGRES_PASSWORD=surprise_dev_password
POSTGRES_PORT=5432
DATABASE_URL=postgres://surprise:surprise_dev_password@localhost:5432/surprise?sslmode=disable
SQLITE_PATH=./data/surprise.db SQLITE_PATH=./data/surprise.db
# ── Postgres (uncomment and set DB_DRIVER=postgres to use) ──
# DATABASE_URL=postgres://surprise:surprise_dev_password@localhost:5432/surprise?sslmode=disable
PORT=8080 PORT=8080
CORS_ORIGIN=http://localhost:5173,http://127.0.0.1:5173 CORS_ORIGIN=http://localhost:5173,http://127.0.0.1:5173
SESSION_SECRET=local-development-session-secret-change-me SESSION_SECRET=local-development-session-secret-change-me
@@ -20,4 +19,4 @@ STORAGE_USE_SSL=false
MINIO_API_PORT=9000 MINIO_API_PORT=9000
MINIO_CONSOLE_PORT=9001 MINIO_CONSOLE_PORT=9001
VITE_API_BASE_URL=http://localhost:8080 VITE_API_BASE_URL=http://localhost:8080
+10
View File
@@ -0,0 +1,10 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Ignored default folder with query files
/queries/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
+9
View File
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="Go" enabled="true" />
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GoImports">
<option name="excludedPackages">
<array>
<option value="golang.org/x/net/context" />
</array>
</option>
</component>
</project>
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/backend.iml" filepath="$PROJECT_DIR$/.idea/backend.iml" />
</modules>
</component>
</project>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
+3 -3
View File
@@ -33,10 +33,10 @@ func Load() Config {
} }
return Config{ return Config{
DBDriver: envOrDefault("DB_DRIVER", "postgres"), DBDriver: envOrDefault("DB_DRIVER", "sqlite"),
Port: envOrDefault("PORT", "8080"), Port: envOrDefault("PORT", "8080"),
DatabaseURL: envOrDefault("DATABASE_URL", "postgres://surprise:surprise_dev_password@localhost:5432/surprise?sslmode=disable"), DatabaseURL: envOrDefault("DATABASE_URL", ""),
SQLitePath: envOrDefault("SQLITE_PATH", "./data/surprise.db"), SQLitePath: envOrDefault("SQLITE_PATH", ""),
CORSOrigin: envOrDefault("CORS_ORIGIN", "http://localhost:5173,http://127.0.0.1:5173"), CORSOrigin: envOrDefault("CORS_ORIGIN", "http://localhost:5173,http://127.0.0.1:5173"),
SessionSecret: envOrDefault("SESSION_SECRET", "local-development-session-secret-change-me"), SessionSecret: envOrDefault("SESSION_SECRET", "local-development-session-secret-change-me"),
CookieSecure: parseBoolEnv("COOKIE_SECURE", false), CookieSecure: parseBoolEnv("COOKIE_SECURE", false),
+4 -4
View File
@@ -3,11 +3,11 @@ services:
image: postgres:16-alpine image: postgres:16-alpine
restart: unless-stopped restart: unless-stopped
environment: environment:
POSTGRES_DB: ${POSTGRES_DB:-surprise} POSTGRES_DB: surprise
POSTGRES_USER: ${POSTGRES_USER:-surprise} POSTGRES_USER: surprise
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-surprise_dev_password} POSTGRES_PASSWORD: surprise_dev_password
ports: ports:
- "${POSTGRES_PORT:-5432}:5432" - "5432:5432"
volumes: volumes:
- postgres_data:/var/lib/postgresql/data - postgres_data:/var/lib/postgresql/data
- ./migrations:/migrations:ro - ./migrations:/migrations:ro