Last Updated: 4/7/2026
Configuration & Environment
Agricultural Microworlds uses environment variables and configuration files to control development server behavior, Docker services, and ASP.NET Core settings. This reference guide documents all configuration options available in the project.
Vite Development Server Configuration
The Vite configuration file (vite.config.js) controls the client-side development server and build process. Configuration is primarily driven by environment variables.
Environment Variables
| Variable | Type | Default | Description |
|---|---|---|---|
ASPNETCORE_HTTPS_PORT | number | 7050 | HTTPS port for the ASP.NET Core backend server |
ASPNETCORE_URLS | string | https://localhost:7050 | Semicolon-separated list of URLs the backend listens on; first URL is used if ASPNETCORE_HTTPS_PORT is not set |
DEV_SERVER_PORT | number | 5000 | Port for the Vite development server |
OPEN_SVG | boolean | false | When set to "true", opens /indexsvg.html instead of /index.html on server start |
Vite Server Settings
The Vite server is configured with the following fixed settings:
| Setting | Value | Purpose |
|---|---|---|
host | 0.0.0.0 | Allows external connections (required for Docker/Codespaces) |
base | /development-project-agopsimulation | Base public path for assets |
proxy | ^/weatherforecast → backend | Proxies API requests to the ASP.NET Core backend |
https | Auto-generated certificate | Uses .NET dev certificates for HTTPS support |
Certificate Management
Vite automatically generates HTTPS certificates using dotnet dev-certs https. Certificates are stored in:
- Windows:
%APPDATA%/ASP.NET/https/ - Linux/macOS:
~/.aspnet/https/
Certificate files:
agricultural-microworlds.client.pem(certificate)agricultural-microworlds.client.key(private key)
Docker & Devcontainer Configuration
The development environment runs in Docker containers orchestrated by Docker Compose. Configuration is split between docker-compose.yml and devcontainer.json.
Docker Compose Services
| Service | Image | Purpose |
|---|---|---|
app | mcr.microsoft.com/devcontainers/universal:2-focal | Main development container with Node.js, .NET, and development tools |
db | postgres:17-alpine | PostgreSQL database server (not yet integrated into the application) |
PostgreSQL Environment Variables
The database service is configured with the following environment variables:
| Variable | Default Value | Description |
|---|---|---|
POSTGRES_PASSWORD | postgres | Password for the PostgreSQL superuser |
POSTGRES_USER | postgres | PostgreSQL superuser username |
POSTGRES_DB | postgres | Default database name |
Note: The PostgreSQL database is provisioned but not yet integrated into the application. See the Planned Database Schema guide for future schema details.
Devcontainer Port Forwarding
The devcontainer forwards the following ports from the container to the host:
| Port | Protocol | Service |
|---|---|---|
5000 | HTTPS | Vite development server |
5001 | HTTPS | ASP.NET Core backend (alternative port) |
5432 | HTTPS | PostgreSQL database |
Devcontainer Features
The devcontainer includes the following features:
- Prettier: Latest version installed via npm-features
- VS Code Extensions:
ms-dotnettools.csharp: C# language supportdbaeumer.vscode-eslint: ESLint integrationesbenp.prettier-vscode: Prettier code formatter
Post-Create Command
After the container is created, the following command runs automatically:
cd agricultural-microworlds.client && npm installThis ensures all Node.js dependencies are installed before development begins.
ASP.NET Core Configuration
The ASP.NET Core backend uses appsettings.json and appsettings.Development.json for configuration.
appsettings.json (Production)
| Setting | Value | Description |
|---|---|---|
Logging.LogLevel.Default | Information | Default log level for all categories |
Logging.LogLevel.Microsoft.AspNetCore | Warning | Log level for ASP.NET Core framework logs |
AllowedHosts | * | Allowed host headers (wildcard allows all) |
appsettings.Development.json (Development)
| Setting | Value | Description |
|---|---|---|
Logging.LogLevel.Default | Information | Default log level for development |
Logging.LogLevel.Microsoft.AspNetCore | Warning | Framework log level for development |
Note: The backend currently only contains a stub WeatherForecast controller. Authentication, database connections, and lesson management are not yet implemented.
Configuration File Locations
| File | Path | Purpose |
|---|---|---|
| Vite config | agricultural-microworlds.client/vite.config.js | Client build and dev server settings |
| Docker Compose | .devcontainer/docker-compose.yml | Container orchestration |
| Devcontainer | .devcontainer/devcontainer.json | VS Code devcontainer settings |
| ASP.NET settings | Agricultural-Microworlds.Server/appsettings.json | Production backend config |
| ASP.NET dev settings | Agricultural-Microworlds.Server/appsettings.Development.json | Development backend config |
| Package config | agricultural-microworlds.client/package.json | npm scripts and dependencies |
| Babel config | agricultural-microworlds.client/babel.config.js | Jest/test transpilation |
No .env File
Agricultural Microworlds does not use a .env file for configuration. All environment variables are set through:
- Docker Compose: Environment variables in
docker-compose.yml - Devcontainer: Port forwarding and features in
devcontainer.json - Shell Environment: Variables set in the terminal before running
npm run dev
To override default values during development, set environment variables before running commands:
# Example: Change dev server port and open SVG page
export DEV_SERVER_PORT=3000
export OPEN_SVG=true
npm run devWhat’s Next
- Installation & Setup: Learn how to set up the development environment from scratch
- Testing Guide: Understand how to run tests and check code coverage
- Planned Database Schema: Review the database design for future features