Installation Guide
This guide covers installing and configuring the Tiptree Platform API for both local development and production deployment.
Prerequisites
Section titled “Prerequisites”- Python 3.11 or higher
- Docker and Docker Compose (for local development)
- PostgreSQL 15+ (for production)
Local Development Setup
Section titled “Local Development Setup”1. Clone the Repository
Section titled “1. Clone the Repository”git clone https://github.com/tiptreesystems/platform-api.gitcd platform-api2. Install Dependencies
Section titled “2. Install Dependencies”We use Poetry for dependency management:
# Install Poetry if you haven't alreadycurl -sSL https://install.python-poetry.org | python3 -
# Install dependenciespoetry install3. Configure Environment
Section titled “3. Configure Environment”Copy the example environment file:
cp .env.example .envEdit .env with your configuration:
DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5432/platformAPI_KEY_SALT=your-secret-saltDEBUG=true4. Start Development Services
Section titled “4. Start Development Services”Using Docker Compose:
docker-compose up -dThis will start:
- PostgreSQL database
- Development API server
- Development tools
5. Run Migrations
Section titled “5. Run Migrations”poetry run alembic upgrade head6. Start the Development Server
Section titled “6. Start the Development Server”poetry run uvicorn platform_api.main:app --reloadThe API will be available at http://localhost:8000
Production Deployment
Section titled “Production Deployment”1. System Requirements
Section titled “1. System Requirements”- Linux server with Python 3.11+
- PostgreSQL 15+
- Nginx (recommended)
2. Installation
Section titled “2. Installation”# Install system dependenciesapt-get update && apt-get install -y python3-pip postgresql-client
# Install the packagepip install platform-api3. Configure Environment
Section titled “3. Configure Environment”Set up the following environment variables:
export DATABASE_URL=postgresql+asyncpg://user:password@host:5432/platformexport API_KEY_SALT=your-production-saltexport DEBUG=false4. Database Setup
Section titled “4. Database Setup”# Run migrationsplatform-api db upgrade5. Running in Production
Section titled “5. Running in Production”We recommend using Gunicorn with Uvicorn workers:
gunicorn platform_api.main:app -w 4 -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8000Docker Deployment
Section titled “Docker Deployment”We provide an official Docker image:
docker pull tiptreesystems/platform-api:latest
docker run -d \ --name platform-api \ -p 8000:8000 \ -e DATABASE_URL=postgresql+asyncpg://user:password@host:5432/platform \ -e API_KEY_SALT=your-production-salt \ tiptreesystems/platform-api:latestNext Steps
Section titled “Next Steps”- Quick Start Guide - Learn how to use the API
- API Reference - Explore available endpoints
- Python Client - Use the official client