feat: Integrate MySQL backend and rebrand to LPD Gerana

- Add Node.js Express backend with REST API
- Create database schema and server.js
- Migrate frontend from IndexedDB to MySQL API
- Add environment configuration (.env)
- Rebrand from Koperasi to LPD Gerana
- Update all documentation and UI text
- Add configurable server port setting

Features:
- POST /api/dokumentasi - Create documentation
- GET /api/dokumentasi - Retrieve all (with search)
- GET /api/dokumentasi/:id - Get single record
- DELETE /api/dokumentasi/:id - Delete record
- Full CRUD operations with MySQL persistence
This commit is contained in:
2026-01-19 13:41:01 +08:00
parent 162f8a38a4
commit b9b255ec79
8 changed files with 2472 additions and 171 deletions

34
database.sql Normal file
View File

@@ -0,0 +1,34 @@
-- Database Schema untuk Aplikasi Dokumentasi Nasabah LPD Gerana
-- Buat database jika belum ada
CREATE DATABASE IF NOT EXISTS dokumentasi CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
USE dokumentasi;
-- Tabel dokumentasi
CREATE TABLE IF NOT EXISTS dokumentasi (
id INT AUTO_INCREMENT PRIMARY KEY,
nama VARCHAR(255) NOT NULL,
no_anggota VARCHAR(100) NOT NULL,
jenis_perjanjian VARCHAR(255) NOT NULL,
tanggal DATE NOT NULL,
catatan TEXT,
foto LONGTEXT NOT NULL COMMENT 'Base64 encoded image',
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
INDEX idx_nama (nama),
INDEX idx_no_anggota (no_anggota),
INDEX idx_tanggal (tanggal),
INDEX idx_timestamp (timestamp)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- Tabel untuk tracking aktivitas (optional)
CREATE TABLE IF NOT EXISTS activity_log (
id INT AUTO_INCREMENT PRIMARY KEY,
action VARCHAR(50) NOT NULL,
dokumentasi_id INT,
details TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
INDEX idx_dokumentasi_id (dokumentasi_id),
INDEX idx_created_at (created_at),
FOREIGN KEY (dokumentasi_id) REFERENCES dokumentasi(id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;