Configuration in the Porfolio & Blog CMS follows ASP.NET Core’s standard layered settings system. The baseDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Andrespeerez/porfolio-blog/llms.txt
Use this file to discover all available pages before exploring further.
appsettings.json file defines values that apply across all environments, while appsettings.{Environment}.json layers environment-specific overrides on top. The three key knobs you’ll interact with are the SQLite connection string, logging verbosity levels, and — in the Development environment only — the seed credentials used to bootstrap the first admin user.
appsettings.json
This file is always loaded regardless of environment. It sets the shared baseline for logging and database access.appsettings.json
| Key | Description |
|---|---|
ConnectionStrings.Default | Path to the SQLite database file. The default value Data Source=blog.db places the database in the project root directory. In production, update this to a persistent absolute path outside the application directory. |
Logging.LogLevel.Default | Minimum log level applied to all log categories that don’t have a more specific rule. Information means informational messages, warnings, and errors are all captured. |
Logging.LogLevel.Microsoft.AspNetCore | Overrides the log level specifically for ASP.NET Core framework internals. Set to Warning to suppress the high volume of request-routing and middleware trace messages that would otherwise flood your logs. |
AllowedHosts | A semicolon-delimited list of hostnames the server will respond to. The wildcard * accepts every hostname. In production, replace this with your actual domain (e.g., "yourdomain.com") to prevent host-header injection attacks. |
appsettings.Development.json
WhenASPNETCORE_ENVIRONMENT is Development, ASP.NET Core merges this file on top of appsettings.json. It extends logging configuration and introduces the Seed section consumed exclusively by AdminUserSeeder at startup.
appsettings.Development.json
Seed section provides the credentials that AdminUserSeeder uses to create the first admin account. AdminEmail becomes the login username and AdminPassword is hashed before being stored in the database. Because AdminUserSeeder checks IWebHostEnvironment.IsDevelopment() before doing anything, these values are completely ignored in Production — you do not need to strip them from the file when deploying, but it is best practice to do so. See the Seeding page for a full walkthrough of how the seeder works.
Launch profiles
TheProperties/launchSettings.json file defines two run profiles that the dotnet run command and IDEs can use. Both profiles set ASPNETCORE_ENVIRONMENT=Development automatically, so appsettings.Development.json is always active during local development.
| Profile | URL(s) | Notes |
|---|---|---|
http | http://localhost:5058 | HTTP only; simplest option for local development |
https | https://localhost:7140 and http://localhost:5058 | Enables TLS; requires a trusted development certificate |
"launchBrowser": true, so your default browser opens automatically on startup. To disable this behaviour, set "launchBrowser": false in the relevant profile inside launchSettings.json.
Cookie authentication configuration
Authentication is handled via ASP.NET Core’s built-in cookie middleware, registered inProgram.cs as follows:
Program.cs
LoginPath = "/login" tells the cookie middleware where to redirect unauthenticated users when they attempt to access a protected resource. Any request that arrives without a valid authentication cookie is automatically redirected to /login with the original URL preserved in a ReturnUrl query parameter, so the user lands back on the page they requested after a successful sign-in.
The cookie authentication scheme is set as the default scheme via
CookieAuthenticationDefaults.AuthenticationScheme, meaning you don’t need to specify it explicitly on individual [Authorize] attributes.