Shopify App Development

Job ID: 39671214

Budget: $250 – $750 USD

Moon Profit is a profit analytics dashboard for Shopify merchants. It connects to Shopify stores using OAuth, pulls order data, syncs advertising spend (Meta, Google Ads), and calculates true net profit. The app uses cookie-based authentication to persist sessions across multiple stores and serves a React frontend built with Vite.



Completed

Shopify OAuth Integration
• OAuth install flow works for multiple Shopify stores
• Shopify app install initiates correctly
• shop_origin cookie is set in the OAuth callback

Server Setup
• Express server runs and handles routes
• Cookie-parser middleware is present
• Real profit data function (getRealProfitData) is implemented
• Dashboard route (/dashboard) returns HTML instead of JSON APIs

Data Layer
• Order and advertising data successfully retrieved from the database
• Revenue, ad spend, and net profit calculated accurately



Current Issues

Frontend Not Displaying Data
• The React dashboard loads visually, but data is missing
• window.__DASHBOARD_DATA__ and window.__USER__ are undefined in the browser
• Cookies are present, but the frontend can’t access session state
• The dashboard appears connected but does not show profit numbers

Middleware and Routing Conflicts
• The /dashboard route may be registered after Vite middleware or after global authentication middleware
• Cookie-parser may be running too late, causing session values to be unavailable during route handling
• Vite’s wildcard app.use("*", ...) is still likely intercepting dashboard or static data responses
• Route order and middleware layering is still causing inconsistent behavior between frontend and backend