Petalytics (from Peta - Indonesian for Map) is a pragmatic backend solution designed to solve a common problem in Indonesian e-commerce: Wasted ad spend due to lack of geographic customer insights.
Multi-channel marketplaces (Shopee, TikTok, etc.) provide raw order data but lack tools to visualize customer density. Sellers often "burn money" on broad ad targeting. Petalytics ingests raw marketplace exports and transforms them into actionable geographic intelligence.
- Data Normalization: Maps inconsistent Indonesian address strings into standardized regional data.
- Multi-Platform Ingestion: Unified processing for different marketplace schemas.
- ROI Optimization: Identifies high-density customer zones for precise ad targeting.
This project was engineered with a strict focus on Clean Architecture, Scalability, and Data Integrity, tailored for modern tech standards.
- Hexagonal Architecture (Ports & Adapters): Strict separation of Domain logic from Infrastructure concerns.
- High-Performance Ingestion: Utilizes
FastExcelandApache Commons CSVwith a streaming approach to parse 10MB+ export files with a microscopic JVM memory footprint. - Data Normalization Cache: Prevents N+1 database queries during mass ingestion by loading PostgreSQL mapping rules (e.g., standardizing "DKI JAKARTA" and "Jakarta Province" into "DKI Jakarta") into a
ConcurrentHashMapcache. - Idempotency: Custom batch-query filtering prevents duplicate
OrderNoingestion, allowing safe, repeatable file uploads. - Robust Testing: Adheres to Test-Driven Development (TDD) using JUnit 5, Mockito, and Testcontainers for true isolated PostgreSQL integration testing.
- Modern SPA: Built with React, TypeScript, and Vite for blazing-fast Hot Module Replacement (HMR).
- State Management: Advanced React hook patterns (
useMemo,useEffect) for client-side data aggregation, multi-column sorting, and debounced API filtering. - Data Visualization: Interactive, highly responsive SVGs rendered via
Recharts. - Tailwind CSS: Custom design system mimicking modern SaaS aesthetics.
| Layer | Technologies |
|---|---|
| Backend | Java 21, Spring Boot 3, Spring Data JPA, FastExcel, Apache Commons CSV, Flyway |
| Frontend | React 19, TypeScript, Vite, Tailwind CSS, Recharts, Lucide Icons |
| Database | PostgreSQL 18 (Dockerized) |
| DevOps | GitHub Actions, Docker Compose, Testcontainers |
- Docker Desktop
- Java 21 (JDK)
- Node.js (v24+)
The infrastructure is defined as code. Spin up the isolated PostgreSQL container:
cd petalytics-backend
docker compose up -d(Note: Flyway will automatically run migrations and construct the schema upon application boot).
cd petalytics-backend
./mvnw spring-boot:runThe API will be available at http://localhost:8080/api
cd petalytics-frontend
npm install
npm run devThe UI will be available at http://localhost:5173