This guide walks you through cloning the repository, wiring up your PostgreSQL credentials with .NET User Secrets, building the solution, and making your first authenticated API calls — all in under 5 minutes.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/marchena96/Paradigma-lab1/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before you begin, make sure you have:- .NET 8 SDK — download from microsoft.com
- A PostgreSQL database — a Supabase project (free tier works) or any local PostgreSQL 15+ instance
dotnet-efglobal tool v8.0.2 — used by the startup auto-migration (see Step 2 below)
Setup
Install the dotnet-ef global tool
If you don’t already have This tool is required for migration introspection and is used by
dotnet-ef v8.0.2 installed globally, run:db.Database.Migrate() at startup.Register your database credentials via User Secrets
The Replace
appsettings.json file ships with the placeholder [SUPABASE-PASSWORD] — no real credentials are stored in the repository. You must supply the real connection string through .NET User Secrets, which are loaded only in the Development environment.From the HackerRank1/ directory, run:<host>, <user>, and <password> with your actual PostgreSQL connection details. For Supabase, these are found under Project Settings → Database → Connection string (URI).Build the solution
From the solution root (A successful build reports 0 errors. Any warnings shown are cosmetic nullable-reference warnings and do not affect runtime behaviour.
Paradigma-lab1/), restore packages and compile:Run the API
Start the API using the You should see output similar to:On first run,
--project flag to target the correct project:Startup.cs automatically applies any pending EF Core migrations to your database (db.Database.Migrate()), creating the Libraries and Books tables if they do not yet exist.First API call
1 — Obtain a JWT token
Use the hardcoded development credentials (admin / 1234) to get a token:
token field containing the signed JWT:
token — you’ll use it as the Bearer token for protected endpoints.
2 — List all libraries
3 — Create a library
The app compiles and starts successfully even without valid database credentials. However,
Migrate() is called during startup and will throw a connection exception if the DefaultConnection string is not set (or still contains the [SUPABASE-PASSWORD] placeholder). Make sure User Secrets are configured before running.