|
|
|
|
@ -30,6 +30,9 @@
@@ -30,6 +30,9 @@
|
|
|
|
|
| 9 | **Monitoring alert detail** dialog (standar UI) | 1 hari | - | |
|
|
|
|
| 10 | **Mail UI** (Inbox, Sent, Draft, Contacts, dll) | 5-7 hari | Mailcow API | |
|
|
|
|
|
|
|
|
|
| 11 | **Content/Posting Service** — thumbnail, posting, engagement (view/like/comment) | 4-6 hari | - | |
|
|
|
|
| 12 | **FE Home Feed** — halaman home superapp tampilkan posting/thumbnail | 2-3 hari | Content Service | |
|
|
|
|
|
|
|
|
|
--- |
|
|
|
|
> **Mulai dari**: ① Mailcow → ② Zammad → ③ FE Ticketing → ④ Push Notification |
|
|
|
|
|
|
|
|
|
@ -181,6 +184,109 @@ Push Service API (FastAPI, port 17000)
@@ -181,6 +184,109 @@ Push Service API (FastAPI, port 17000)
|
|
|
|
|
- 📢 **Broadcast IT**: pengumuman, maintenance, downtime |
|
|
|
|
- *(Future)* 📊 Monitoring: alert Zabbix |
|
|
|
|
|
|
|
|
|
--- |
|
|
|
|
# Content / Posting Microservice (`geonet-content`) |
|
|
|
|
|
|
|
|
|
## Saran Profesional |
|
|
|
|
Gunakan pola **Headless CMS + custom API** — bukan CMS full seperti WordPress. |
|
|
|
|
Ini memberi kontrol penuh atas schema, permission berbasis LDAP group, dan integrasi ke push notification. |
|
|
|
|
|
|
|
|
|
### Stack yang Disarankan |
|
|
|
|
- **Backend**: FastAPI + PostgreSQL (konsisten dengan Collector) |
|
|
|
|
- **Storage thumbnail/gambar**: QNAP OSS (S3 bucket `super-apps`, path `content/`) |
|
|
|
|
- **Rich text body**: simpan sebagai HTML atau Markdown (pakai Tiptap editor di FE) |
|
|
|
|
- **CDN/resize**: thumbnail di-generate otomatis via `Pillow` saat upload (multi-resolusi: 400px, 800px) |
|
|
|
|
|
|
|
|
|
## Model Data |
|
|
|
|
|
|
|
|
|
### Post |
|
|
|
|
``` |
|
|
|
|
Post |
|
|
|
|
├── id (UUID) |
|
|
|
|
├── title (string) |
|
|
|
|
├── slug (string, unique) |
|
|
|
|
├── body (text — HTML/Markdown) |
|
|
|
|
├── thumbnail_url (string — OSS path) |
|
|
|
|
├── status (draft | published | archived) |
|
|
|
|
├── priority (int — urutan manual oleh admin) |
|
|
|
|
├── published_at (datetime | null) |
|
|
|
|
├── created_by (ldap_username) |
|
|
|
|
├── created_at / updated_at |
|
|
|
|
├── tags[] (many-to-many) |
|
|
|
|
└── category (string: announcement | info | event | update | dll) |
|
|
|
|
|
|
|
|
|
PostEngagement (per post) |
|
|
|
|
├── view_count (int, increment atomic) |
|
|
|
|
├── like_count (int) |
|
|
|
|
└── comment_count (int — cached, sync dari PostComment) |
|
|
|
|
|
|
|
|
|
PostLike |
|
|
|
|
├── post_id |
|
|
|
|
└── ldap_username (unique per post+user) |
|
|
|
|
|
|
|
|
|
PostComment |
|
|
|
|
├── id |
|
|
|
|
├── post_id |
|
|
|
|
├── ldap_username |
|
|
|
|
├── body (text) |
|
|
|
|
├── created_at |
|
|
|
|
└── parent_id (null = top-level, isi = reply) |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
## API Endpoints |
|
|
|
|
- `GET /posts` — list posting (filter: status, kategori, tag; sort: date/views/likes/comments/priority) |
|
|
|
|
- `GET /posts/:slug` — detail + increment view_count |
|
|
|
|
- `POST /posts` — buat posting (butuh permission `content.create`) |
|
|
|
|
- `PUT /posts/:id` — edit posting (butuh permission `content.edit` atau own post) |
|
|
|
|
- `DELETE /posts/:id` — hapus (butuh permission `content.manage`) |
|
|
|
|
- `POST /posts/:id/like` — toggle like (user LDAP) |
|
|
|
|
- `GET /posts/:id/comments` — list komentar + reply |
|
|
|
|
- `POST /posts/:id/comments` — tambah komentar |
|
|
|
|
- `PUT /admin/posts/reorder` — ubah urutan priority (butuh permission `content.manage`) |
|
|
|
|
- `POST /admin/posts/:id/thumbnail` — upload + resize thumbnail ke OSS |
|
|
|
|
|
|
|
|
|
## Permission LDAP Group (tambah ke group_permissions) |
|
|
|
|
| Permission | Fungsi | |
|
|
|
|
|---|---| |
|
|
|
|
| `content.view` | Lihat posting (semua user default) | |
|
|
|
|
| `content.create` | Buat posting baru | |
|
|
|
|
| `content.edit` | Edit semua posting (moderator) | |
|
|
|
|
| `content.manage` | Kelola urutan, status, hapus, konfigurasi tampilan | |
|
|
|
|
|
|
|
|
|
## Konfigurasi Tampilan (Admin Panel) |
|
|
|
|
- [ ] Jumlah thumbnail yang tampil di home (misal: 6, 9, 12) |
|
|
|
|
- [ ] Mode urutan default: `date_created` | `views` | `likes` | `comments` | `priority` |
|
|
|
|
- [ ] Tampilan grid: 2-kolom / 3-kolom / list |
|
|
|
|
- [ ] Auto-publish terjadwal (`published_at` di masa depan) |
|
|
|
|
- [ ] Pin post (selalu tampil di atas terlepas dari urutan) |
|
|
|
|
|
|
|
|
|
## Setup Backend |
|
|
|
|
- [ ] Buat `geonet-content` service (FastAPI + SQLAlchemy + PostgreSQL) |
|
|
|
|
- [ ] Model: Post, PostLike, PostComment, PostTag, ContentConfig |
|
|
|
|
- [ ] Upload thumbnail → resize via Pillow → simpan ke OSS (`content/thumbnails/`) |
|
|
|
|
- [ ] Atomic view_count increment (pakai `UPDATE ... SET view_count = view_count + 1`) |
|
|
|
|
- [ ] Docker Compose di 10.100.1.24, akses via `content.gisportal.id` (internal) atau lewat `my.gisportal.id/api/content` |
|
|
|
|
- [ ] Permission check via header `X-LDAP-Username` + `X-LDAP-Groups` (diteruskan dari geonet-console) |
|
|
|
|
|
|
|
|
|
## FE Integration (`/` home & `/posts`) |
|
|
|
|
- [ ] **Home Dashboard** — feed thumbnail posting (grid responsif, lazy load) |
|
|
|
|
- [ ] **Post Card**: thumbnail, judul, kategori, tanggal, ikon view/like/comment count |
|
|
|
|
- [ ] **Post Detail** — halaman `/posts/:slug` dengan body rich text, komentar bersarang |
|
|
|
|
- [ ] **Like button** — toggle, animasi, optimistic update |
|
|
|
|
- [ ] **Comment section** — list + form reply, pagination |
|
|
|
|
- [ ] **Admin: Create/Edit Post** — form dengan Tiptap rich text editor, upload thumbnail, jadwal publish |
|
|
|
|
- [ ] **Admin: Manage Posts** — tabel dengan drag-and-drop reorder (priority), bulk status change |
|
|
|
|
- [ ] **Admin: Config** — panel jumlah tampilan, mode urutan, layout grid |
|
|
|
|
|
|
|
|
|
## Content API Client (`src/lib/content-client.ts`) |
|
|
|
|
- [ ] `getPosts(params)` — list dengan filter & sort |
|
|
|
|
- [ ] `getPost(slug)` — detail |
|
|
|
|
- [ ] `createPost(body)` / `updatePost(id, body)` |
|
|
|
|
- [ ] `toggleLike(postId)` |
|
|
|
|
- [ ] `getComments(postId)` / `addComment(postId, body)` |
|
|
|
|
- [ ] `reorderPosts(orderedIds)` |
|
|
|
|
- [ ] `uploadThumbnail(postId, file)` |
|
|
|
|
|
|
|
|
|
--- |
|
|
|
|
# FE |
|
|
|
|
|
|
|
|
|
|