a587be08bda06dea8defee83bd5f4e56f1080bff
- 01-infra/nginx-configs: add MinIO /minio/ and /minio-console/ location blocks (port 9000 S3 API, port 9001 Console UI, path stripping via rewrite) - 03-apiservice: integrate MinIO minio-python SDK for file upload - requirements.txt: add minio==7.2.11 - app/core/config.py: add MINIO_ENDPOINT, ACCESS_KEY, SECRET_KEY, BUCKET_FINANCE, USE_SSL - app/services/minio_client.py: new — upload_file(), get_presigned_url(), delete_file() - app/routes/pages.py: replace local /data/uploads/ write with MinIO upload to finance bucket - docker-compose.yml: pass MinIO env vars to container - .env.example: document MinIO vars - 07-minio/.env.example: add MINIO_SVC_ACCESS_KEY/SECRET_KEY section - 07-minio/README.md: add Python minio SDK and Airflow DAG usage guide - CLAUDE.md: project context (servers, SSH, paths, service distribution) - document-obsidiant/: initial Obsidian docs for all services
Sriphat Hospital Data Platform
Modern Data Stack สำหรับโรงพยาบาลศรีพัฒน์ ประกอบด้วย:
- Nginx Proxy Manager - Gateway + SSL
- Keycloak - Single Sign-On (SSO)
- PostgreSQL - Data Warehouse
- API Service - Custom FastAPI endpoints
- Airbyte - Data Ingestion
- Apache Superset - Business Intelligence
🚀 Quick Start
Ubuntu Server (Production)
# Quick install (recommended)
bash install.sh
# Or manual setup
sudo bash setup-ubuntu.sh
# (logout/login, then continue)
bash start-all.sh
See README-UBUNTU.md for detailed Ubuntu installation guide.
Development/Windows
# 1. Configure environment
notepad .env.global
# 2. Start all services
bash start-all.sh
# 3. Access services
# - Nginx Proxy Manager: http://localhost:81
# - Keycloak: http://localhost:8080
# - API Service: http://localhost/apiservice
📁 Project Structure
├── 00-network/ # Shared Docker network
├── 01-infra/ # Nginx + Keycloak + PostgreSQL
├── 03-apiservice/ # Custom FastAPI service
├── 04-ingestion/ # Airbyte ETL
├── 06-analytics/ # Apache Superset
├── .env.global # Global configuration
├── start-all.sh # Start all services
├── stop-all.sh # Stop all services
└── DEPLOYMENT.md # Full deployment guide
📖 Documentation
- DEPLOYMENT.md - Complete deployment guide
- tech_stack.md - Architecture blueprint
- 01-infra/README.md - Infrastructure layer
- 03-apiservice/README.md - API service details
- 04-ingestion/README.md - Airbyte setup
- 06-analytics/README.md - Superset configuration
🔒 Security
All services communicate via shared_data_network and are exposed through Nginx Proxy Manager only. Keycloak provides centralized authentication (SSO) for all components.
📊 API Service
Custom FastAPI service with:
- Admin UI for managing API keys
- Permission-based access control
- Integration with PostgreSQL schemas (fastapi, operationbi)
- Endpoint:
POST /api/v1/feed/checkpoint
Required permission: feed.checkpoint:write
Description
Languages
Python
47.2%
HTML
29.6%
Shell
21%
PowerShell
1.6%
Dockerfile
0.6%