add files infra docker service for data platform
This commit is contained in:
75
README.md
75
README.md
@@ -1,27 +1,78 @@
|
||||
# apiservice
|
||||
# Sriphat Hospital Data Platform
|
||||
|
||||
## Run
|
||||
Modern Data Stack สำหรับโรงพยาบาลศรีพัฒน์ ประกอบด้วย:
|
||||
|
||||
1. Copy env
|
||||
- **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)
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
# Quick install (recommended)
|
||||
bash install.sh
|
||||
|
||||
# Or manual setup
|
||||
sudo bash setup-ubuntu.sh
|
||||
# (logout/login, then continue)
|
||||
bash start-all.sh
|
||||
```
|
||||
|
||||
2. Update DB connection env values
|
||||
See **[README-UBUNTU.md](README-UBUNTU.md)** for detailed Ubuntu installation guide.
|
||||
|
||||
3. Start
|
||||
### Development/Windows
|
||||
|
||||
```bash
|
||||
docker compose up --build
|
||||
# 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
|
||||
```
|
||||
|
||||
## Base path
|
||||
## 📁 Project Structure
|
||||
|
||||
Set `ROOT_PATH=/apiservice` when running behind reverse proxy.
|
||||
```
|
||||
├── 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
|
||||
```
|
||||
|
||||
## Permissions
|
||||
## 📖 Documentation
|
||||
|
||||
The checkpoint endpoint requires permission:
|
||||
- **[DEPLOYMENT.md](DEPLOYMENT.md)** - Complete deployment guide
|
||||
- **[tech_stack.md](tech_stack.md)** - Architecture blueprint
|
||||
- **[01-infra/README.md](01-infra/README.md)** - Infrastructure layer
|
||||
- **[03-apiservice/README.md](03-apiservice/README.md)** - API service details
|
||||
- **[04-ingestion/README.md](04-ingestion/README.md)** - Airbyte setup
|
||||
- **[06-analytics/README.md](06-analytics/README.md)** - Superset configuration
|
||||
|
||||
- `feed.checkpoint:write`
|
||||
## 🔒 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`
|
||||
|
||||
Reference in New Issue
Block a user