Skip to content

Conversation

@collisdigital
Copy link
Member

Experiement: Conver from Java to Python powered by Claude.

DO NOT MERGE

This commit represents a complete conversion of the GP Practice Document
Submission API from Java (Spring Boot) to Python (FastAPI), utilizing
modern Python tooling including uv and just.

Major Changes:
- Replaced Spring Boot framework with FastAPI
- Replaced HAPI FHIR with fhir.resources Python library
- Replaced Spring Data JPA with SQLAlchemy ORM
- Replaced Maven with uv for dependency management
- Added justfile for common development tasks
- Updated Dockerfile for Python 3.11 runtime

Architecture:
- Maintained layered architecture (Router -> Service -> Repository)
- Preserved all business logic and validation rules
- Kept support for three processing modes: SYNC, ASYNC, HYBRID
- Maintained integrations with ClamAV, MinIO, RabbitMQ, and MS SQL Server

New Files:
- pyproject.toml: Python project configuration and dependencies
- justfile: Task runner for common commands
- src/gp_practice_documents/: Complete Python application source
- .env.example: Environment configuration template
- .gitignore: Updated for Python artifacts

Dependencies:
- FastAPI 0.115+ for REST API framework
- SQLAlchemy 2.0+ for database ORM
- fhir.resources 7.0+ for FHIR R4 support
- Pydantic 2.0+ for data validation
- MinIO 7.2+ for object storage
- Pika 1.3+ for RabbitMQ messaging

Documentation:
- Updated README with Python setup instructions
- Added quick start guide using just commands
- Updated architecture decisions to reflect Python stack

Version: 4.1.0
Added complete VS Code DevContainer setup with:

DevContainer Features:
- Python 3.11 base image (Debian Bullseye)
- Docker-in-Docker support
- Git and GitHub CLI integration
- Automatic setup script for dependencies

VS Code Extensions (20+ extensions):
Python Development:
- Python, Pylance, Black Formatter, Ruff, Debugpy

API Development & Testing:
- Thunder Client (REST API testing)
- REST Client (file-based HTTP requests)

Database:
- SQLTools with MS SQL Server driver

Code Quality & Productivity:
- Error Lens (inline errors)
- Code Spell Checker
- autoDocstring (automatic docstrings)
- IntelliCode (AI-assisted development)
- Path IntelliSense

Git Tools:
- GitLens (enhanced Git)
- Git Graph (visual history)

Configuration Support:
- Even Better TOML
- YAML support
- DotEnv support
- Just syntax highlighting

Container Automation:
- Auto-installs uv (Python package manager)
- Auto-installs just (task runner)
- Auto-installs MS SQL Server ODBC drivers
- Auto-syncs Python dependencies
- Auto-creates .env file from template

VS Code Configuration:
- Optimized Python settings
- Ruff as default formatter
- Format on save enabled
- PyTest configuration
- Type checking enabled
- 120 character line length

Debugging Support:
- FastAPI debug configuration
- PyTest debug configurations
- Current file debug configuration

API Testing:
- Sample HTTP requests file (api-tests.http)
- Pre-configured REST Client examples
- Health check, valid/invalid request examples

Port Forwarding:
- Port 8080 automatically forwarded
- Labeled as "FastAPI Application"

Documentation:
- Comprehensive DevContainer README
- Setup instructions
- Extension descriptions
- Troubleshooting guide

Files Added:
- .devcontainer/devcontainer.json
- .devcontainer/post-create.sh
- .devcontainer/README.md
- .vscode/launch.json
- .vscode/settings.json
- api-tests.http
Added shared VS Code configuration for team consistency:

VS Code Settings (.vscode/settings.json):
- Python interpreter path to .venv
- Ruff as default formatter
- Format on save enabled
- Auto-organize imports on save
- PyTest configuration
- File associations (TOML, just, dotenv)
- Search and file exclusions
- 120 character line length

Launch Configurations (.vscode/launch.json):
- FastAPI debug config with auto-reload
- Current file debug config
- PyTest single file debug config
- PyTest all tests debug config
- Proper PYTHONPATH configuration

GitIgnore Update:
- Removed .vscode/ from gitignore to share team settings
- Added comment explaining DevContainer configuration sharing
- Kept .idea/ ignored for JetBrains IDEs

Benefits:
- Consistent development environment across team
- One-click debugging for FastAPI and tests
- Automatic code formatting and linting
- Shared workspace settings for uniformity
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.

3 participants