Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/bentlyy/Clinica/llms.txt

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

Clinica runs entirely via Docker Compose — a single command starts the PostgreSQL database, the Node.js API on port 3000, and the React frontend on port 5173. Before you make your first booking, you’ll register a patient account, log in to receive a JWT, and confirm the API is healthy. The steps below take you through the full flow.
1

Clone the repository

git clone https://github.com/bentlyy/Clinica
cd Clinica
2

Configure environment variables

Clinica reads its configuration from a .env file in the project root. A working default is already checked in, but you should review and update the values before running in any shared environment.
# .env
DATABASE_URL=postgresql://postgres:postgres@db:5432/clinic
PORT=3000
JWT_SECRET=change-this-to-a-long-random-string
EMAIL_USER=your_email@example.com
EMAIL_PASS=your_email_password
VariablePurpose
DATABASE_URLFull PostgreSQL connection string. In Docker Compose this points to the db service.
PORTPort the API listens on. Defaults to 3000.
JWT_SECRETSecret used to sign JWT tokens. Change this to a long random string.
EMAIL_USERGmail address used to send appointment reminders.
EMAIL_PASSPassword or App Password for the Gmail account above.
See Environment variables and configuration for a full reference.
3

Start with Docker Compose

From the project root, build and start all three services — the database, API, and frontend — with a single command:
docker compose up --build
Docker Compose starts the db service first. The API waits until PostgreSQL is ready, then seeds the admin account and begins accepting requests. On first run, the build step may take a few minutes to pull base images and install dependencies.
4

Verify the API health endpoint

Once the containers are running, confirm the API is up and connected to the database:
curl http://localhost:3000/health
You should receive:
{ "status": "ok", "db": "connected" }
If you see "db": "down", the API container started before the database was ready — wait a few seconds and try again.
5

Register a patient account

New users register with an email address and password. The default role is patient.
curl -X POST http://localhost:3000/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{"email": "patient@example.com", "password": "yourpassword"}'
A successful registration returns the new user’s id and email:
{ "id": 2, "email": "patient@example.com" }
6

Log in to get a JWT token

Log in with the same credentials to receive a signed JWT. You’ll include this token in the Authorization header for all protected endpoints.
curl -X POST http://localhost:3000/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "patient@example.com", "password": "yourpassword"}'
The response contains your token:
{ "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." }
Tokens expire after 24 hours.
7

Browse available doctors

The /api/doctors/public endpoint is open — no token required. It returns the list of doctors patients can book with.
curl http://localhost:3000/api/doctors/public
You’ll see an empty array until an admin creates doctor accounts. To do that, log in as the seeded admin (admin@clinic.com / admin123) and call POST /api/doctors.

What was seeded automatically

On first startup, Clinica creates a default admin account if no admin user exists:
FieldValue
Emailadmin@clinic.com
Passwordadmin123
Roleadmin
Change the admin password after your first login. The seed runs only once — it skips creation if an admin already exists.

Frontend

The React frontend is available at http://localhost:5173 once the containers are running. It provides a full UI for patients to browse doctors and book appointments, and for admins to manage the platform.

Next steps

Build docs developers (and LLMs) love