Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/pabloeferreyra/Turnero/llms.txt

Use this file to discover all available pages before exploring further.

Getting Turnero running locally requires only a PostgreSQL server and the .NET 10 SDK. The entire setup — from cloning the repository to seeing the login page in your browser — takes fewer than ten minutes on a clean machine. Firebase is entirely optional and only needed if you want to enable the mobile push-notification and JWT authentication features.
1

Install Prerequisites

Make sure the following tools are available on your machine before you begin.
RequirementMinimum versionNotes
.NET SDK10.0Includes the dotnet CLI, EF Core tools can be installed on top
PostgreSQL13+Any edition; a local install or Docker container both work
EF Core CLI toolsInstall once globally with dotnet tool install --global dotnet-ef
GitTo clone the repository
Firebase projectOptional. Only required for push notifications and JWT auth
Verify your .NET installation:
dotnet --version
# Should print 10.0.x or later
2

Clone the Repository

Clone the Turnero source from GitHub and move into the project root:
git clone https://github.com/pabloeferreyra/Turnero.git
cd Turnero
The repository contains four .NET projects in a single solution:
Turnero/          ← ASP.NET Core MVC host (this is the startup project)
Turnero.DAL/      ← EF Core DbContext, models, repositories, migrations
Turnero.SL/       ← Business-logic services
Turnero.Utilities/← Shared helpers and Mapster mappings
3

Configure the Database Connection String

Turnero reads its PostgreSQL connection string from the ConnectionStrings:LocalConnection configuration key. Never commit credentials to source control. Use the .NET user-secrets store instead — it writes values to an OS-protected folder outside the repository.Initialise user secrets for the Turnero project (the UserSecretsId is already declared in Turnero.csproj):
dotnet user-secrets init --project Turnero
Set the connection string, replacing the placeholder values with your actual PostgreSQL host, port, database name, and credentials:
dotnet user-secrets set "ConnectionStrings:LocalConnection" \
  "Host=localhost;Port=5432;Database=turnero;Username=postgres;Password=yourpassword" \
  --project Turnero
If your PostgreSQL instance requires SSL, append ;SSL Mode=Require;Trust Server Certificate=true to the connection string.
The appsettings.json file committed to the repository intentionally omits the ConnectionStrings section. The application reads it exclusively from user secrets in development and from environment variables or a secured appsettings.json on the production server.
4

Apply EF Core Migrations

Turnero ships with a full migration history inside Turnero.DAL/Migrations/. Run all pending migrations against your PostgreSQL database in one command:
dotnet ef database update --project Turnero.DAL --startup-project Turnero
EF Core will create the database if it does not already exist, then apply every migration in order. On first run this creates tables for ASP.NET Identity (AspNetUsers, AspNetRoles, …) as well as the Turnero domain tables (Turns, Medics, TimeTurnViewModel, Patients, and all clinical sub-module tables).Confirm the migration succeeded by connecting with psql or pgAdmin and checking that the __EFMigrationsHistory table is present:
SELECT "MigrationId" FROM "__EFMigrationsHistory" ORDER BY 1;
5

Run the Application

Start the development server from the solution root:
dotnet run --project Turnero
The application boots, pre-warms its in-memory caches (time slots and doctors), then begins listening. You should see output similar to:
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: https://localhost:5001
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:5000
Open https://localhost:5001 in your browser. Accept any self-signed certificate warning in your browser — this is expected in local development.
6

First Login — Create the Admin User

Turnero uses ASP.NET Core Identity for authentication. There is no seeded default user, so you must register the first account yourself and then elevate it to the Admin role.
  1. Register an account. Click Register on the login page and fill in an email address and password. The password policy requires at least 6 characters with at least one digit and one lowercase letter.
  2. Assign the Admin role. Because no admin exists yet, you must assign the role directly in the database. Connect to PostgreSQL and run:
-- 1. Find your new user
SELECT "Id", "Email" FROM "AspNetUsers";

-- 2. Ensure the Admin role exists (insert if missing)
INSERT INTO "AspNetRoles" ("Id", "Name", "NormalizedName", "ConcurrencyStamp")
VALUES (gen_random_uuid()::text, 'Admin', 'ADMIN', gen_random_uuid()::text)
ON CONFLICT DO NOTHING;

-- 3. Link the user to the Admin role
INSERT INTO "AspNetUserRoles" ("UserId", "RoleId")
SELECT u."Id", r."Id"
FROM "AspNetUsers" u, "AspNetRoles" r
WHERE u."Email" = 'you@example.com'
  AND r."NormalizedName" = 'ADMIN';
  1. Log in. Return to the application and log in with the account you registered. You now have full Admin access and can create additional users and assign the Medico or Ingreso roles through the Administration panel without needing direct database access again.
After your first Admin is set up, all subsequent user management — creating accounts, assigning roles, managing doctors — is done entirely through the Turnero web UI under the Administration menu.
Optional: Firebase push notifications. If you want to enable desktop push notifications and Firebase JWT authentication, you need to create a Firebase project, download its service-account JSON file, and save it to the user-secrets folder at the path resolved by Program.cs. See the Firebase Configuration guide for full instructions.

Build docs developers (and LLMs) love