Automated Indonesian legal document analysis system powered by Google Apps Script and Gemini AI
Document Regulatory API adalah sistem otomatis untuk menganalisis dan mengekstrak metadata dari dokumen peraturan/regulasi Indonesia. Sistem ini menggunakan AI (Google Gemini) untuk memproses dokumen PDF dan gambar, lalu menyimpan data terstruktur ke Google Sheets dengan akses melalui RESTful API.
- π€ AI-Powered Analysis - Gemini 2.0 Flash untuk ekstraksi metadata
- π Multi-Format Support - PDF, JPG, PNG, GIF
- π Smart Document Recognition - Deteksi otomatis dokumen peraturan
- π Structured Data Extraction - 15 field metadata terstruktur
- π RESTful API - Complete CRUD operations
- π Analytics & Statistics - Dashboard dan reporting
- π Advanced Search - Full-text search capabilities
- π Activity Logging - Comprehensive audit trail
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Client Apps β => β Apps Script API β => β Gemini AI β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β
ββββββββββ΄βββββββββ
β β
ββββββββΌβββββββ ββββββββΌβββββββ
β Google β β Google β
β Sheets β β Drive β
β (Database) β β (Storage) β
βββββββββββββββ βββββββββββββββ
- Google Account
- Google Drive access
- Gemini API key
- Clone or copy the script
- Configure constants in CONFIG object
- Set up Google Sheets and Drive folder
- Deploy as web app
Detailed setup instructions in DEPLOYMENT.md
| Method | Endpoint | Description |
|---|---|---|
| GET | /health |
System health check |
| POST | /upload |
Upload and analyze document |
| GET | /documents |
List documents with pagination |
| GET | /document |
Get single document details |
| GET | /search |
Search documents |
| GET | /stats |
Get system statistics |
| GET | /logs |
Get system logs |
- Jenis Dokumen
- Nomor Peraturan
- Tahun Terbit
- Judul/Tentang
- Instansi Penerbit
- Tanggal Ditetapkan
- Tanggal Diundangkan
- Nomor Lembaran Negara
- Nomor Tambahan Lembaran Negara
- Sumber Hukum
- Kata Kunci
- Bidang/Sektor
- Status Dokumen
- Ringkasan Singkat
- Pasal Penting
const CONFIG = {
GEMINI_API_KEY: 'your_gemini_api_key',
GEMINI_MODEL: 'gemini-2.0-flash',
SPREADSHEET_ID: 'your_spreadsheet_id',
FOLDER_ID: 'your_drive_folder_id'
};const formData = new FormData();
formData.append('fileData', base64Data);
formData.append('fileName', 'regulation.pdf');
formData.append('mimeType', 'application/pdf');
fetch('https://script.google.com/macros/s/YOUR_SCRIPT_ID/exec?action=upload', {
method: 'POST',
body: formData
});fetch('https://script.google.com/macros/s/YOUR_SCRIPT_ID/exec?action=search&q=OJK&limit=10')
.then(response => response.json())
.then(data => console.log(data));- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Gemini AI for document analysis
- Google Apps Script platform
- Indonesian government for open regulation access
- π§ Email: [kontak@classy.id]
---