Documentation Index
Fetch the complete documentation index at: https://mintlify.com/DUVAN100/saludya-api/llms.txt
Use this file to discover all available pages before exploring further.
This setup guide describes the intended implementation architecture for SaludYa API. The project is currently under development.
Prerequisites
The planned implementation will require the following:- Node.js (v16 or higher)
- PostgreSQL (v13 or higher)
- npm or yarn package manager
- Git for version control
Planned Installation
Install dependencies
Install all required Node.js packages:This will install Express, TypeORM, authentication libraries, and other dependencies defined in
package.json.Configure environment variables
Create a Update the
.env file in the root directory by copying the example file:.env file with your configuration:Set up the database
Create a PostgreSQL database for SaludYa:Run database migrations to create the required tables:
Database Schema
SaludYa API uses the following main database tables:| Table | Description |
|---|---|
users | User accounts (patients, doctors, admins) |
patients | Patient profiles and medical information |
doctors | Doctor profiles and specializations |
appointments | Medical appointment records |
schedules | Doctor availability and working hours |
medical_records | Patient medical history |
Production Deployment
Environment Configuration
For production deployments, update your environment variables:Build and Run
Docker Deployment
SaludYa API includes a Dockerfile for containerized deployments:docker-compose.yml includes the API server, PostgreSQL database, and Redis for caching.
Health Checks
Verify your deployment is healthy:Common Issues
Database connection failed
Database connection failed
Problem: Cannot connect to PostgreSQL database.Solutions:
- Verify PostgreSQL is running:
pg_isready - Check database credentials in
.env - Ensure the database exists:
psql -l - Check firewall settings and network connectivity
Port already in use
Port already in use
Problem:
Error: listen EADDRINUSE: address already in use :::3000Solutions:- Change the
PORTin your.envfile - Stop the process using port 3000:
lsof -ti:3000 | xargs kill
Migration errors
Migration errors
Problem: Database migrations fail to run.Solutions:
- Ensure database is empty or at the correct version
- Check migration files for syntax errors
- Reset database:
npm run migration:revertthennpm run migration:run
Next Steps
Making Requests
Learn how to make API requests with pagination and filtering
Authentication
Set up authentication for secure API access
API Reference
Explore all available endpoints
Rate Limits
Understand rate limiting and best practices