This section contains a deterministic blueprint designed for AI agents or LLM clients to completely rebuild LuminaBooks from scratch.
Provide this prompt to your AI client to spin up the decoupled workspace structures securely without tracking junk data:
System Initialization Prompt: "Create a decoupled workspace directory for an inventory application called 'LuminaBooks'. Establish a root-level
.gitignorethat excludes OS files,.vscode/,.idea/, standard C# backend build folders (bin/,obj/), and React frontend folders (node_modules/,dist/). Under the root workspace, initialize two sub-directories:/backendand/frontend."
Instruct the AI client to model the high-performance decoupled backend using robust Data Transfer Objects (DTOs) rather than letting internal database schemas leak:
Backend Architecture Prompt: *"Inside the
/backenddirectory, initialize an empty ASP.NET Core web project targeting.NET 10.0.
- Add packages for
Microsoft.EntityFrameworkCoreand Npgsql PostgreSQL drivers.- Create a
/DTOsdirectory containingBookDto,BookCreateDto, andBookUpdateDtoto safely abstract fields. Add validation attributes like[Required]directly to the DTO parameters.- Implement a static
MappingExtensions.csclass to cleanly transform internal Entity models to/from public DTO layers.- In
Program.cs, set up a modern Minimal API using.MapGroup("/api/books")to map clean REST endpoints. Configure the database connection string parsing to read from an environment variable namedDefaultConnection. Ensure CORS is configured before mapping routes to safely allow connections from the React frontend SPA."*
Orchestrate the user interface layer cleanly by linking it to the backend endpoint variables:
Frontend Architecture Prompt: "Inside the
/frontenddirectory, use Vite to scaffold a standard React application. Build out a responsive inventory tracking board. Ensure that all API fetch/Axios requests prefix their targets using a configurable environment variable namedVITE_API_URL. Ensure that thepackage.jsonfile contains a native"build": "vite build"pipeline script."
To prevent automated deployment engines from getting stuck, use a completely non-interactive, fail-safe infrastructure script layout:
Deployment Script Prompt: *"Generate a non-interactive bash deployment script named
deploy-to-azure.shthat targets a single location input argument, defaulting safely tocentralus. The script must perform the following actions sequentially using the Azure CLI:
- Verify
az account showlogin state.- Set an isolated random uppercase/lowercase ASCII suffix variable using
LC_ALL=C trto avoid duplicate name errors across macOS/Linux.- Create a resource group and provision an Azure Database for PostgreSQL (Flexible Server) using the Burstable
Standard_B1mscompute tier.- Explicitly split database creation into a separate step using
az postgres flexible-server db createto avoid cluster bugs.- Create a PostgreSQL firewall rule mapping
AllowAllAzureIPswith0.0.0.0start/end parameters.- Provision a Linux App Service plan (SKU B1) and create a
.NET 10web app with--runtime "DOTNET:10.0".- Inject the connection strings and
ASPNETCORE_ENVIRONMENT=Productionvariables into the Web App settings.- Publish and zip the backend, deploy it via zip deploy, then provision an Azure Static Web App in
centralusto build and host the React frontend app assets using its deployment token."*
For an exhaustive, walk-through guide on managing routes and structuring this layer, you can watch this helpful Building REST APIs with .NET Minimal API Tutorial. This specific video breaks down how to decouple routes, plug in database contexts via Entity Framework Core, and implement clean status code practices that perfectly match your LuminaBooks requirements.
🍿 Enjoy 🫡