Commit graph

5469 commits

Author SHA1 Message Date
iskandarsulaili
97a3428b78 feat: Complete Phase 5 - Add Recommendation Engine UI components and documentation
- Add 3 Recommendation Engine analytics components (UserProfileDashboard, RecommendationPerformanceMetrics, MLModelRegistryViewer)
- Add 4 WooCommerce analytics components (WooCommerceRevenueDashboard, ProductPerformanceTable, CategoryConversionFunnel, CheckoutAbandonmentTracker)
- Add 1 Engagement metrics component (EngagementMetricsDashboard)
- Implement 8 API endpoints for custom analytics features
- Create 8 SQL queries for data retrieval
- Update README.md with custom features documentation
- Add comprehensive component documentation

Total: 8 UI components, 8 API endpoints, 8 SQL queries
Build verified: Production-ready with no errors
2025-11-07 11:59:54 +08:00
iskandarsulaili
9d4c646364 docs: add cross-links to First8Marketing ecosystem
- Add Related Projects section with links to ecosystem repositories
- Add system integration diagram showing data flow
- Link to First8Marketing Track plugin
- Link to First8Marketing Recommendation Engine plugin
- Clarify role in the First8Marketing analytics stack
2025-11-07 10:27:32 +08:00
iskandarsulaili
7c1db78050 feat: Add UserMapping constraints and schema improvements
## Database Schema Enhancements

### Migration 19 - Fixed
- Removed invalid composite index on session(visitor_id, user_id)
- visitor_id column doesn't exist in session table
- Fixed migration to only create valid indexes

### Migration 20 - New Constraints (with rollback support)
- Added websiteId foreign key to UserMapping table
- Added foreign key constraint to Website table for referential integrity
- Added composite index on UserMapping(websiteId, userId) for query performance
- Added composite index on Session(websiteId, userId) for join optimization

### Schema Updates
- Updated UserMapping model with websiteId field
- Added foreign key relationship: UserMapping -> Website
- Added userMappings relation to Website model
- Added composite indexes for better query performance

## Files Changed

### Modified
- prisma/schema.prisma - Added foreign keys and composite indexes
- prisma/migrations/19_add_user_id_mapping/migration.sql - Fixed invalid index

### New
- prisma/migrations/20_add_user_mapping_constraints/migration.sql - Forward migration
- prisma/migrations/20_add_user_mapping_constraints/rollback.sql - Rollback script

## Benefits
-  Referential integrity enforced at database level
-  Optimized queries for Umami sync operations
-  Better join performance on Session table
-  Rollback capability for safe schema changes

## Breaking Changes
- UserMapping table now requires websiteId field
- Existing data will be migrated to use first available website_id

## Migration Notes
Run the migration with:
```bash
npx prisma migrate deploy
```

To rollback if needed:
```bash
psql -d umami -f prisma/migrations/20_add_user_mapping_constraints/rollback.sql
```
2025-11-06 22:04:57 +08:00
iskandarsulaili
5cf1e0c16a feat: Add user ID mapping migration for WordPress integration
Added Prisma migration to support user identification:

1. Session Table Enhancement
   - Added user_id column (VARCHAR(36)) to session table
   - Stores WordPress user ID for logged-in users
   - Indexed for efficient lookups

2. User Mapping Table
   - New table to track visitor_id to user_id relationships
   - Maps anonymous visitors to authenticated users
   - Tracks first_seen_at, last_seen_at, and session_count
   - Unique constraint on (visitor_id, user_id) pair

3. Indexes
   - idx_session_user_id - Fast user_id lookups
   - idx_session_visitor_user - Composite index for visitor+user queries
   - idx_user_mapping_visitor - Visitor ID lookups
   - idx_user_mapping_user - User ID lookups
   - idx_user_mapping_last_seen - Time-based queries

This migration enables unified user tracking across anonymous and authenticated sessions, supporting the WordPress plugin's user identification feature.
2025-11-06 19:53:33 +08:00
iskandarsulaili
5f496fdb79 feat: integrate First8 Marketing hyper-personalization system
Enhanced Umami Analytics with First8 Marketing integration for
hyper-personalized recommendation engine.

Database Enhancements:
- PostgreSQL 17 with Apache AGE 1.6.0 (graph database)
- TimescaleDB 2.23.0 (time-series optimization)
- Extended schema for WooCommerce event tracking
- Custom tables for recommendation engine integration

Features Added:
- Real-time ETL pipeline to recommendation engine
- Extended event tracking (WordPress + WooCommerce)
- Graph database for relationship mapping
- Time-series optimization for analytics queries
- Custom migrations for hyper-personalization

Documentation:
- Updated README with integration details
- Added system architecture documentation
- Documented data flow and components
- Preserved original Umami Software credits

Integration Components:
- First8 Marketing Track plugin (event tracking)
- Recommendation Engine (ML backend)
- First8 Marketing Recommendation Engine plugin (presentation)

Status: Production-ready
Version: Based on Umami latest + First8 Marketing enhancements
2025-11-05 19:17:57 +08:00
Francis Cao
a6d4519a98 set maxHeight for DialogButton. remove from individual buttons
Some checks failed
Create docker images (cloud) / Build, push, and deploy (push) Has been cancelled
Node.js CI / build (postgresql, 18.18, 10) (push) Has been cancelled
2025-11-04 09:34:37 -08:00
Mike Cao
5398cd89fe Reordered IP headers.
Some checks are pending
Create docker images (cloud) / Build, push, and deploy (push) Waiting to run
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
2025-11-03 21:01:12 -08:00
Mike Cao
79e324aace Updated Dockerfile to match current Prisma version.
Some checks are pending
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
2025-11-03 16:54:58 -08:00
Mike Cao
684863d6c7 Added laptop detection. Reorganized IP headers. 2025-11-03 16:44:01 -08:00
Francis Cao
c9f522b24d remove MySQL references from README
Some checks failed
Node.js CI / build (postgresql, 18.18, 10) (push) Has been cancelled
2025-10-31 09:12:32 -07:00
Mike Cao
eb3cfbfa88 Updated lock file.
Some checks failed
Create docker images (cloud) / Build, push, and deploy (push) Has been cancelled
Node.js CI / build (postgresql, 18.18, 10) (push) Has been cancelled
2025-10-31 00:21:02 -07:00
Mike Cao
067567cbf6 Force geo build with BUILD_GEO env var.
Some checks are pending
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
2025-10-31 00:13:02 -07:00
Mike Cao
751568d871 Merge remote-tracking branch 'origin/dev' into dev
Some checks are pending
Create docker images (cloud) / Build, push, and deploy (push) Waiting to run
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
2025-10-30 17:05:49 -07:00
Mike Cao
b08a6e1113 Don't prefetch pixel links. 2025-10-30 17:05:11 -07:00
Francis Cao
504c459090 update schema validation for link/pixel updates
Some checks failed
Node.js CI / build (postgresql, 18.18, 10) (push) Has been cancelled
2025-10-30 16:13:36 -07:00
Mike Cao
dfe969cabe Fixed pixels/links collect.
Some checks are pending
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
2025-10-30 12:53:12 -07:00
Francis Cao
f073fb1996 Add DialogTrigger to overflow menus
Some checks are pending
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
2025-10-29 12:38:52 -07:00
Francis Cao
72fba187db separate Admin/Settings Nav and add to MobileNav 2025-10-29 11:32:52 -07:00
Francis Cao
ef55b63a3b Fix admin layout and data refresh after update/delete 2025-10-29 11:04:54 -07:00
Francis Cao
c81b1c16c8 fix geteventdatavalues query 2025-10-29 10:10:46 -07:00
Francis Cao
6eefb4173c add improved truncation between tablets and phones
Some checks failed
Node.js CI / build (postgresql, 18.18, 10) (push) Has been cancelled
2025-10-27 13:54:15 -07:00
Francis Cao
74972bccb1 add isMobile truncation logic to ListTable
Some checks failed
Create docker images (cloud) / Build, push, and deploy (push) Has been cancelled
Node.js CI / build (postgresql, 18.18, 10) (push) Has been cancelled
2025-10-27 13:18:26 -07:00
Francis Cao
2ffde37f5b v3 prisma queries update 2025-10-27 11:48:35 -07:00
Francis Cao
61b667c587 update psql expanded metrics queries
Some checks failed
Node.js CI / build (postgresql, 18.18, 10) (push) Has been cancelled
2025-10-24 10:38:35 -07:00
Francis Cao
e71a34d1fa fix getChannelMetrics prisma query
Some checks are pending
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
2025-10-23 16:24:58 -07:00
Francis Cao
1d3e980eed revert saveLocale change
Some checks failed
Create docker images (cloud) / Build, push, and deploy (push) Has been cancelled
Node.js CI / build (postgresql, 18.18, 10) (push) Has been cancelled
2025-10-22 16:40:14 -07:00
Francis Cao
d87ae84a29 fix reports permissions, long team overflow, language settings 2025-10-22 16:09:31 -07:00
Francis Cao
f5bf148b2b add close button on session modal
Some checks are pending
Create docker images (cloud) / Build, push, and deploy (push) Waiting to run
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
2025-10-21 21:59:20 -07:00
Francis Cao
2e1a5b444a revenue, events, and session activity optimization 2025-10-21 21:12:22 -07:00
Francis Cao
533a42eb2e clean-up session api endpoints and queries 2025-10-21 19:54:50 -07:00
Francis Cao
f98e683979 add zod schema to realtime endpoint
Some checks are pending
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
2025-10-21 17:20:35 -07:00
Francis Cao
b7747b33e4 clean-up hooks for passing uneccessary date params
Some checks are pending
Create docker images (cloud) / Build, push, and deploy (push) Waiting to run
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
2025-10-21 16:52:04 -07:00
Francis Cao
06230ad2e9 clean up teams api messaging and permissions 2025-10-21 15:35:17 -07:00
Mike Cao
d8fdba77db Updated packages. 2025-10-21 13:39:43 -07:00
Mike Cao
ddc7affa6a More mobile fixes.
Some checks failed
Create docker images (cloud) / Build, push, and deploy (push) Has been cancelled
Node.js CI / build (postgresql, 18.18, 10) (push) Has been cancelled
2025-10-18 02:20:11 -07:00
Mike Cao
9a5604f236 Fixes for mobile.
Some checks are pending
Create docker images (cloud) / Build, push, and deploy (push) Waiting to run
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
2025-10-18 01:12:45 -07:00
Mike Cao
bcafa12349 Small fixes.
Some checks are pending
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
2025-10-17 16:54:33 -07:00
Mike Cao
40492ec7c4 Added DialogButton to handle mobile.
Some checks are pending
Create docker images (cloud) / Build, push, and deploy (push) Waiting to run
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
2025-10-16 23:59:18 -07:00
Mike Cao
036748cdeb Merge remote-tracking branch 'origin/dev' into dev
Some checks are pending
Create docker images (cloud) / Build, push, and deploy (push) Waiting to run
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
# Conflicts:
#	src/app/(main)/websites/[websiteId]/ExpandedViewModal.tsx
#	src/app/(main)/websites/[websiteId]/WebsiteExpandedView.tsx
2025-10-16 02:43:43 -07:00
Mike Cao
4d2a7ea947 Responsive everything. 2025-10-16 02:42:13 -07:00
Francis Cao
f23d5694ec clean up events/event-data endpoints
Some checks are pending
Create docker images (cloud) / Build, push, and deploy (push) Waiting to run
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
2025-10-15 16:44:14 -07:00
Francis Cao
a7a7293d73 dvh height for mobile expanded view 2025-10-15 12:03:40 -07:00
Francis Cao
a2b1089e62 clean-up event/event-data endpoints. fix for expanded view for mobile 2025-10-15 11:32:19 -07:00
Mike Cao
9df012084d Mobile fixes.
Some checks are pending
Create docker images (cloud) / Build, push, and deploy (push) Waiting to run
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
2025-10-14 23:10:27 -07:00
Mike Cao
5c3a6ce8ce Merge remote-tracking branch 'origin/dev' into dev 2025-10-14 21:59:45 -07:00
Mike Cao
10bc2895eb New mobile menu. 2025-10-14 21:57:31 -07:00
Mike Cao
be5f0494cc Added MobileMenuButton component. 2025-10-14 15:43:57 -07:00
Mike Cao
d9b08d9491 Card mode for tables. 2025-10-14 13:04:14 -07:00
Francis Cao
ba45972bd3 fix filter passthrough into event-data endpoints 2025-10-14 11:22:21 -07:00
Francis Cao
9fb38f6970 fix zod validations and prisma query for admin teams 2025-10-14 09:41:02 -07:00