Skip to content

Add FastAPI server for PageIndex document indexing service#221

Closed
MASLER1987 wants to merge 1 commit intoVectifyAI:mainfrom
MASLER1987:claude/setup-railway-service-AyM7G
Closed

Add FastAPI server for PageIndex document indexing service#221
MASLER1987 wants to merge 1 commit intoVectifyAI:mainfrom
MASLER1987:claude/setup-railway-service-AyM7G

Conversation

@MASLER1987
Copy link
Copy Markdown

Summary

This PR introduces a FastAPI-based REST API server for the PageIndex document indexing and retrieval system, along with Docker containerization support.

Key Changes

  • New FastAPI server (server.py): Implements a REST API with the following endpoints:

    • GET /health - Health check endpoint
    • GET /documents - List all indexed documents with metadata
    • POST /index - Upload and index PDF or Markdown files
    • GET /documents/{doc_id} - Retrieve document metadata
    • GET /documents/{doc_id}/structure - Get document tree structure
    • GET /documents/{doc_id}/pages - Get page content with flexible page range selection (e.g., '5-7', '3,8', '12')
  • Docker support: Added Dockerfile for containerized deployment with Python 3.11-slim base image

  • Railway deployment config (railway.toml): Configured for Railway.app deployment with health checks and restart policies

  • Dependencies: Updated requirements.txt to include FastAPI, Uvicorn, and python-multipart for the new server functionality

Implementation Details

  • File upload handling with temporary directory management and proper cleanup
  • Support for PDF and Markdown file formats with validation
  • JSON response parsing from PageIndexClient with error handling
  • Environment variable configuration for workspace and model selection
  • Proper HTTP error responses with descriptive messages

https://claude.ai/code/session_01DC8ofq5uXQoG63AMnHNMEw

Wraps PageIndexClient in a REST API (index, retrieve, structure, pages)
with Dockerfile and railway.toml for one-click Railway deployment.

https://claude.ai/code/session_01DC8ofq5uXQoG63AMnHNMEw
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@MASLER1987 MASLER1987 closed this Apr 7, 2026
@MASLER1987
Copy link
Copy Markdown
Author

sorry

@MASLER1987 MASLER1987 deleted the claude/setup-railway-service-AyM7G branch April 7, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants