How iqbalsiagian17/sistem-pelaporan-lingkungan works
Project Type and Purpose
• This is a full-stack, multi-platform reporting system (“sistem-pelaporan-lingkungan”) comprising three main deliverables:
• A cross-platform mobile app (bb_mobile) built with Flutter/Dart
• A web-based dashboard/admin SPA (spl_web) built with React/Vite
• A RESTful backend service (web-service) built with Node.js/Express and Sequelize
• Its purpose is to allow users to submit environmental reports (with photos, videos, location), interact via forums, and for admins to manage content, view analytics, and send notifications.
High-Level Components
• Mobile App (bb_mobile)
• Presentation layer: Flutter widgets (features/*/presentation)
• Domain layer: entities, repositories, use-cases (clean architecture)
• Data layer: remote data sources, models, services (API calls via Dio, Firebase messaging)
• Web SPA (spl_web)
• UI components: atoms, molecules, pages under src/components and src/pages
• State management: React Contexts under src/context
• Services: API wrappers under src/services
• Routing: Vite router under src/router
• Backend API (web-service)
• Routes layer: Express routers under routes/*
• Controllers: request handlers under controllers/*
• Services: business logic under services/*
• Data layer: Sequelize models under models/* and migrations/seeders
• Middleware: auth, rate limiting, file uploads under middleware/*
• Scheduler: cron jobs under scheduler/*
Data Flow and Interactions
• Mobile App & Web SPA → HTTP(S) REST calls → Backend API
• Backend API → ORM (Sequelize) → Database (e.g., PostgreSQL)
• Backend API ↔ Firebase Admin SDK for messaging and OTP verification
• Scheduler jobs ←→ Backend API services to auto-close campaigns, send notifications, clean up inactive users
• File uploads: Mobile App uploads evidence/media via API endpoints → stored in web-service/uploads
Architectural Patterns & Design Principles
• Mobile App: Clean Architecture with clear separation of presentation, domain, data
• Web SPA: Component-based architecture with Context API for state, service layer abstracts HTTP
• Backend: MVC-inspired structure (Routes → Controllers → Services → Models)
• Reusable layers: common error handling, interceptors (Dio interceptors on mobile, middleware in backend)
• Use-case driven design: each feature encapsulated by domain/usecase on mobile and service functions on backend
Technologies & Frameworks
• Flutter/Dart, Dio, Provider, Firebase Messaging (Mobile)
• React, Vite, Context API, Axios (or fetchWithAuth), SCSS, Bootstrap (Web SPA)
• Node.js, Express, Sequelize (ORM), PostgreSQL (Database), Firebase Admin SDK, cron (Scheduler)