A full-stack analytics dashboard for transaction monitoring and payment analytics, built with a Spring Boot backend and a React (Vite) frontend. It provides GTV/volume trends, transaction success metrics, payment method distribution, hourly peak traffic, and a toucan-themed UI.
- Dashboard overview
- Total GTV, total transactions, active users, success rate
- Average ticket size and operational health indicators
- Advanced Date Filtering
- Modern, ocean-themed calendar picker
- Persistent date filtering across pages (via Context API)
- Data Export
- Export filtered dashboard data and transactions
- Support for JSON and CSV formats
- Client-side export logic (no extra API calls)
- Volume vs Value trend
- Daily transaction counts and total amounts over a selected date range
- Status breakdown (SUCCESS / FAILED / PENDING) per day
- Payment methods analytics
- Distribution of transactions by payment method
- Percentage share and counts per method
- Hourly peak traffic
- Hour-of-day traffic visualization across the dataset
- Success / failed / pending counts per hour
- Transactions table
- Paginated list of transactions with filters
- Detailed exports (JSON/CSV) for current view
- Status, amount, user, method, and timestamp columns
- Toucan dark theme
- Dark UI with black background and emerald/orange accents
- Responsive layout with bordered navigation
- Java 21
- Spring Boot 3 (Web, Data JPA, Validation)
- PostgreSQL (relational database)
- Maven (build tool)
Backend root: backend/
- React + Vite
- Recharts (data visualization)
- Tailwind CSS (utility-first styling)
- Axios (HTTP client)
Frontend root: frontend/
backend/– Spring Boot application (REST API, domain, persistence)frontend/– React SPA (dashboard UI, charts, tables)LICENSE– Project license
backend/src/main/java/com/toucanus/analytics_dashboard/AnalyticsDashboardApplication.java
controller– REST controllers (e.g./api/dashboard,/api/transactions)service– Business logic for dashboard stats and graph analyticsservice/graph– Chart-specific aggregations (daily status, hourly traffic, payment methods)repository– Spring Data JPA repositories forTransactionandUserdto– Data transfer objects for dashboard and graph responsesentity– JPA entities (Transaction,User)enums– Domain enums (payment method, status, etc.)
All endpoints are served under /api by the backend.
GET /api/dashboard/stats– Overall dashboard KPIsGET /api/dashboard/stats/filtered– KPIs filtered bystartDateandendDateGET /api/dashboard/analytics/daily– Daily status and amount stats (date range)GET /api/dashboard/analytics/payment-methods– Payment method distribution (optional date range)GET /api/dashboard/analytics/hourly-traffic– Hourly traffic stats (optional date range)GET /api/transactions– Paginated, filterable transaction list
Note: Exact request/response shapes are defined in the DTO classes under
backend/src/main/java/com/toucanus/analytics_dashboard/dto.
Configuration file:
backend/src/main/resources/application.properties
Typical properties you will need to set (values are examples):
spring.datasource.url=jdbc:postgresql://localhost:5432/analytics_db
spring.datasource.username=analytics
spring.datasource.password=analytics
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=falseThe frontend is a single-page application that consumes the backend REST API and renders dashboards and tables.
frontend/index.html– HTML shellfrontend/src/main.jsx– React entry pointfrontend/src/App.jsx– Top-level routing/layout wrapper
frontend/src/pages/Overview.jsx- Dashboard overview, daily trend, payment methods, hourly peak traffic
frontend/src/pages/Analytics.jsx- Advanced analytics with date-range filters
frontend/src/pages/Transactions.jsx- Transactions table with filters, pagination, and status badges
frontend/src/lib/api.js- Wraps Axios calls to the backend:
getDashboardStats,getFilteredDashboardStatsgetDailyAnalytics,getPaymentStats,getHourlyTrafficgetTransactions
- Wraps Axios calls to the backend:
sequenceDiagram
participant Browser
participant React App
participant Spring Boot
participant Caffeine Cache
participant PostgreSQL
Browser->>React App: Navigate to Analytics
React App->>Spring Boot: GET /api/dashboard/stats/filtered
Spring Boot->>Caffeine Cache: Check cache
alt Cache Hit
Caffeine Cache-->>Spring Boot: Return cached data
else Cache Miss
Spring Boot->>PostgreSQL: Execute optimized query
PostgreSQL-->>Spring Boot: Return results
Spring Boot->>Caffeine Cache: Store in cache
end
Spring Boot-->>React App: JSON Response
React App-->>Browser: Render Charts
- Node.js (LTS recommended)
- Java 21
- Maven 3.9+
- PostgreSQL (or compatible database) running locally
git clone https://github.com/your-org/analytics-dashboard.git
cd analytics-dashboard- Create a PostgreSQL database (for example
analytics_db). - Create a user with privileges on that database.
- Update
backend/src/main/resources/application.propertieswith your DB credentials.
From the backend/ directory:
cd backend
./mvnw spring-boot:run # Unix/macOS
# or
mvnw.cmd spring-boot:run # WindowsThe backend will start on http://localhost:8080 by default.
In a separate terminal, from the frontend/ directory:
cd frontend
npm install
npm run devThe frontend dev server will start (by default) on http://localhost:5173 and will proxy API calls to the backend base URL defined in frontend/src/lib/api.js.
- The frontend uses Vite with hot module replacement (HMR) for a fast feedback loop.
- The backend is a typical Spring Boot app; you can run it via your IDE or Maven.
- Charts (Recharts) and Tailwind-based components are structured by page under
frontend/src/pages.
Backend
cd backend
./mvnw testFrontend
If you add tests (e.g. with Vitest), document the commands here.
Contributions are welcome! To propose changes:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/your-feature). - Commit your changes with clear messages.
- Open a pull request describing the motivation and changes.
Please run the backend and frontend locally, and ensure there are no lint or test failures before submitting a PR.
This project is licensed under the terms described in the LICENSE file.