3.7 KiB
3.7 KiB
🚀 API Service - Sistem Manajemen Pasien
📑 Daftar Isi
- ✨ Fitur Utama
- 🏗️ Arsitektur
- ⚡ Quick Start
- 🔐 Autentikasi
- 📊 API Endpoints
- 🛠️ Development
- 🚀 Deployment
- 📚 Dokumentasi
- 🚨 Troubleshooting
✨ Fitur Utama
Core Features
- 🔒 JWT Authentication - Sistem autentikasi dengan Keycloak integration
- 👥 Patient Management - CRUD lengkap untuk data pasien
- 🔍 Dynamic Filtering - Filter dan pencarian data pasien secara dinamis
- 📊 Advanced Search - Pencarian dengan multiple fields dan operators
- 🏥 BPJS Integration - Integrasi dengan layanan kesehatan BPJS
- 🩺 SATUSEHAT Integration - Integrasi dengan platform kesehatan SATUSEHAT
- 📖 API Documentation - Swagger/OpenAPI yang interaktif
Developer Experience
- 🔥 Hot Reload - Development dengan auto-restart
- 🐳 Docker Ready - Deployment yang mudah
- ⚡ Code Generator - Tools untuk generate handler dan model
- 🧪 Testing Suite - Unit dan integration tests
- 📊 Health Monitoring - Monitoring kesehatan aplikasi
- 🗄️ Multi Database - Support PostgreSQL, MySQL, dan MongoDB
🏗️ Arsitektur
Clean Architecture Layers
┌─────────────────────────────────────┐
│ Presentation Layer │ ← handlers/, routes/
├─────────────────────────────────────┤
│ Application Layer │ ← middleware/, services/
├─────────────────────────────────────┤
│ Domain Layer │ ← models/, validation/
├─────────────────────────────────────┤
│ Infrastructure Layer │ ← database/, external APIs
└─────────────────────────────────────┘
Struktur Project
api-service/
├── 📁 cmd/ # Entry points aplikasi
│ └── api/main.go # API server
├── 📁 internal/ # Core business logic
│ ├── config/ # Configuration management
│ ├── database/ # Database connections
│ ├── handlers/ # HTTP controllers
│ ├── middleware/ # Auth & validation middleware
│ ├── models/ # Data structures
│ ├── routes/ # API routing
│ ├── services/ # Business logic services
│ │ └── auth/ # Auth services
│ ├── utils/ # Utility functions
│ │ ├── filters/ # Dynamic filtering
│ │ └── validation/ # Data validation
│ └── server/ # HTTP server setup
├── 📁 docs/ # Documentation
└── 📁 examples/ # Example files
Best Practices
- Jangan pernah commit file .env ke repository
- Gunakan environment variables untuk semua data sensitif
- Gunakan secret management tools untuk production
- Rotasi kunci API secara berkala
- Implementasi rate limiting untuk API endpoints