Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/0Crazy-0/ClinicFlow/llms.txt

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

ClinicFlow runs on .NET 10 and uses PostgreSQL 17 as its data store. The fastest path to a working local environment is a single docker compose command for the database plus a few dotnet CLI commands for migrations and tests. This guide walks you through every step.
ClinicFlow does not yet have an HTTP API layer. There is no web server to start — the project currently exposes its domain and application logic as a class library. Running the project locally means applying the database schema and executing tests.

Prerequisites

Before you begin, ensure the following tools are installed and available on your PATH:
ToolMinimum VersionPurpose
.NET SDK10.0Build, test, and run EF Core CLI tools
Docker24+Container runtime for PostgreSQL
Docker Compose2.20+Orchestrate the local Postgres service
Verify your installation:
dotnet --version      # should print 10.x.x
docker --version      # should print 24.x.x or later
docker compose version

Setup Steps

1
Clone the repository
2
git clone https://github.com/0Crazy-0/ClinicFlow.git
cd ClinicFlow
3
Start PostgreSQL with Docker Compose
4
ClinicFlow ships a dedicated docker-compose.local.yml file that starts a single PostgreSQL 17 container pre-configured for local development. Start it with:
5
docker compose -f docker-compose.local.yml up -d
6
The compose file creates a named volume so your data persists across container restarts:
7
services:
  postgres:
    image: postgres:17-alpine
    container_name: ClinicFlowDb_Local
    environment:
      POSTGRES_DB: ClinicFlowDb
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
    ports:
      - "5432:5432"
    volumes:
      - clinicflow-db-data:/var/lib/postgresql/data

volumes:
  clinicflow-db-data:
8
Confirm the container is healthy before proceeding:
9
docker ps --filter name=ClinicFlowDb_Local
10
Apply EF Core migrations
11
With the database running, apply all pending migrations to create the schema. The --project flag tells the EF Core CLI where the DbContext and migration history live:
12
dotnet ef database update --project ClinicFlow.Infrastructure
13
This command discovers ApplicationDbContextFactory at design time, connects to localhost:5432, and runs every migration under ClinicFlow.Infrastructure/Migrations/ in order.
14
(Optional) Seed development data
15
The ApplicationDbContextFactory is wired to call DbSeeder.Seed via EF Core’s UseSeeding hook. Seeding runs automatically when you use dotnet ef database update if the database has no users yet — the seeder checks context.Users.Any() before writing anything.
16
To trigger seeding on an already-migrated database, drop and recreate the schema:
17
dotnet ef database drop --project ClinicFlow.Infrastructure --force
dotnet ef database update --project ClinicFlow.Infrastructure
18
The seeder creates a realistic dataset including 35 doctors, 120 patients, 500 appointments, 250 medical records, and associated penalties.
19
The seeding layer is powered by Bogus, a widely used .NET fake-data library included in ClinicFlow.Infrastructure. It uses a fixed random seed (Randomizer.Seed = new Random(42)) so the generated data is fully deterministic — every dotnet ef database update on a fresh database produces the identical dataset.
20
Run the test suite
21
Confirm everything is wired correctly by running all three test projects at once:
22
dotnet test
23
The command discovers and executes tests in:
24
  • ClinicFlow.Domain.Tests — pure unit tests, no external dependencies
  • ClinicFlow.Application.Tests — unit tests with mocked infrastructure
  • ClinicFlow.Infrastructure.Tests — integration tests that spin up a real PostgreSQL container via Testcontainers
  • 25
    To collect code coverage in OpenCover format (same format used by CI):
    26
    dotnet test --collect:"XPlat Code Coverage" \
      -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
    

    Stopping and cleaning up

    Stop the Postgres container without removing the data volume:
    docker compose -f docker-compose.local.yml stop
    
    To remove the container and the persistent volume:
    docker compose -f docker-compose.local.yml down -v
    

    Build docs developers (and LLMs) love