diff --git a/GermanApp/GermanApp.csproj b/GermanApp/GermanApp.csproj
index 824b0c5..da9d6b3 100644
--- a/GermanApp/GermanApp.csproj
+++ b/GermanApp/GermanApp.csproj
@@ -10,7 +10,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/GermanApp/Program.cs b/GermanApp/Program.cs
index 0133d3f..a7c0db3 100644
--- a/GermanApp/Program.cs
+++ b/GermanApp/Program.cs
@@ -16,12 +16,12 @@ builder.Services.AddOpenApi();
// INFRASTRUCTURE LAYER - Database & External Services
// ============================================
-// Add DbContext with SQLite (can be changed to SQL Server, PostgreSQL, etc.)
+// Add DbContext with PostgreSQL
builder.Services.AddDbContext(options =>
{
- // Using SQLite for development - configure in appsettings.json for production
- options.UseSqlite(builder.Configuration.GetConnectionString("DefaultConnection")
- ?? "Data Source=germanapp.db");
+ // Using PostgreSQL for production and development
+ options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection")
+ ?? "Host=localhost;Port=5432;Database=DeutschLernen;Username=postgres;Password=postgres");
// Enable sensitive data logging in development
if (builder.Environment.IsDevelopment())
diff --git a/GermanApp/appsettings.Development.json b/GermanApp/appsettings.Development.json
index ff66ba6..045b0f3 100644
--- a/GermanApp/appsettings.Development.json
+++ b/GermanApp/appsettings.Development.json
@@ -1,8 +1,11 @@
{
"Logging": {
"LogLevel": {
- "Default": "Information",
- "Microsoft.AspNetCore": "Warning"
+ "Default": "Debug",
+ "Microsoft.AspNetCore": "Information"
}
+ },
+ "ConnectionStrings": {
+ "DefaultConnection": "Host=localhost;Port=5432;Database=DeutschLernen;Username=postgres;Password=postgres"
}
}
diff --git a/GermanApp/appsettings.Production.json b/GermanApp/appsettings.Production.json
new file mode 100644
index 0000000..4dd231b
--- /dev/null
+++ b/GermanApp/appsettings.Production.json
@@ -0,0 +1,11 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Warning",
+ "Microsoft.AspNetCore": "Error"
+ }
+ },
+ "ConnectionStrings": {
+ "DefaultConnection": "Host=prod-db;Port=5432;Database=DeutschLernen;Username=postgres;Password=${DB_PASSWORD}"
+ }
+}
diff --git a/GermanApp/appsettings.Staging.json b/GermanApp/appsettings.Staging.json
new file mode 100644
index 0000000..4635bcd
--- /dev/null
+++ b/GermanApp/appsettings.Staging.json
@@ -0,0 +1,11 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ },
+ "ConnectionStrings": {
+ "DefaultConnection": "Host=staging-db;Port=5432;Database=DeutschLernen;Username=postgres;Password=${DB_PASSWORD}"
+ }
+}
diff --git a/GermanApp/appsettings.json b/GermanApp/appsettings.json
index 4d56694..7b19f94 100644
--- a/GermanApp/appsettings.json
+++ b/GermanApp/appsettings.json
@@ -5,5 +5,8 @@
"Microsoft.AspNetCore": "Warning"
}
},
- "AllowedHosts": "*"
+ "AllowedHosts": "*",
+ "ConnectionStrings": {
+ "DefaultConnection": "Host=localhost;Port=5432;Database=DeutschLernen;Username=postgres;Password=postgres"
+ }
}