Skip to main content

Medical Center API Documentation

Complete REST API for managing medical appointments, doctors, patients, and administrative operations. Built with Express.js, Prisma, and PostgreSQL.

Quick Start

Get up and running in minutes

1

Clone and install dependencies

Clone the repository and install the required packages.
git clone https://github.com/Bran258/api_centro_medico.git
cd api_centro_medico
npm install
2

Configure environment variables

Create a .env file with your database and Supabase credentials.
DATABASE_URL="postgresql://user:password@localhost:5432/centro_medico"
SUPABASE_URL="https://your-project.supabase.co"
SUPABASE_ANON_KEY="your-anon-key"
SUPABASE_SERVICE_ROLE_KEY="your-service-role-key"
See the Environment Variables guide for detailed configuration options.
3

Set up the database

Run Prisma migrations to create your database schema.
npx prisma migrate dev
npx prisma db seed
4

Start the server

Launch the development server and start making API requests.
npm run dev
The API will be available at http://localhost:3000. Test it with a public endpoint:
curl http://localhost:3000/api/especialidades

Key Features

Everything you need to manage a medical center

Appointment Management

Complete workflow for scheduling, confirming, and managing patient appointments with multiple states.

Role-Based Access

Secure authentication with admin and assistant roles using Supabase JWT tokens.

Public Endpoints

Allow patients to book appointments and view doctors without authentication.

Dashboard Analytics

Real-time statistics on appointments, patient volume, and operational metrics.

Ready to get started?

Follow our quickstart guide to set up the Medical Center API in minutes and start building your healthcare application.

View Quickstart Guide

Build docs developers (and LLMs) love