How hari-x-haran/affiliate-marketing works
AffiliateX is a browser-based affiliate-link manager. Users register or sign in, create Amazon or Flipkart short links, then manage links and inspect click, analytics, and estimated-earnings views. React context holds authentication and link state; browser storage persists it, with synchronization to a backend endpoint. The route shell also exposes profile and database-management screens. Evidence is based on the provided excerpts and source index; several page implementations and route details were not sampled.
Main entry points: App.jsx Route shell · LinkContext.jsx Link context · AuthContext.jsx Auth context · Dashboard.jsx Dashboard
Components 23
Application shell
- Route shell
src/App.jsx - Navigation bar
src/components/Navbar.jsx - Sidebar
src/components/Sidebar.jsx
Account access
- Sign in
src/pages/Login.jsx - Registration
src/pages/Register.jsx - Auth context
src/context/AuthContext.jsx - Profile
src/pages/Profile.jsx - Route guard
src/components/ProtectedRoute.jsx
Link management
- Create link
src/pages/CreateLink.jsx - Link context
src/context/LinkContext.jsx - Short ID generator
src/utils/generateShortId.js - URL validation
src/utils/validators.js - My links
src/pages/MyLinks.jsx - Link card
src/components/LinkCard.jsx - Copy button
src/components/CopyButton.jsx
Performance insights
- Dashboard
src/pages/Dashboard.jsx - Analytics
src/pages/Analytics.jsx - Earnings
src/pages/Earnings.jsx - Metric card
src/components/StatCard.jsx
Persistence
- Database editor
src/pages/Database.jsx - Browser storage
src/utils/storage.js
Other components
- Browser user
- Sync endpoint
Connections 42
- Browser user → Route shell: uses
- Route shell → Auth context: provides context
src/App.jsx - Route shell → Link context: provides context
src/App.jsx - Route shell → Route guard: guards routes
src/App.jsx - Route shell → Navigation bar: renders
src/App.jsx - Route shell → Sidebar: renders
src/App.jsx - Route shell → Sign in: routes to
src/App.jsx - Route shell → Registration: routes to
src/App.jsx - Route shell → Dashboard: routes to
src/App.jsx - Route shell → Create link: routes to
src/App.jsx - Route shell → My links: routes to
src/App.jsx - Route shell → Analytics: routes to
src/App.jsx - Route shell → Earnings: routes to
src/App.jsx - Route shell → Profile: routes to
src/App.jsx - Route shell → Database editor: routes to
src/App.jsx - Sign in → Auth context: authenticates
src/pages/Login.jsx - Registration → Auth context: registers through
src/pages/Register.jsx - Navigation bar → Auth context: logs out through
src/components/Navbar.jsx - Profile → Auth context: reads account
src/pages/Profile.jsx - Profile → Link context: reads links
src/pages/Profile.jsx - Auth context → Browser storage: reads and writes
src/context/AuthContext.jsx - Create link → URL validation: validates URL
src/pages/CreateLink.jsx - Create link → Link context: creates link
src/pages/CreateLink.jsx - Create link → Copy button: renders
src/pages/CreateLink.jsx - Link context → Auth context: reads user
src/context/LinkContext.jsx - Link context → Short ID generator: generates ID
src/context/LinkContext.jsx - Link context → Browser storage: reads and writes
src/context/LinkContext.jsx - My links → Link context: reads links
src/pages/MyLinks.jsx - My links → Link card: renders
src/pages/MyLinks.jsx - Link card → Link context: records clicks
src/components/LinkCard.jsx - Link card → Copy button: renders
src/components/LinkCard.jsx - Dashboard → Auth context: reads user
src/pages/Dashboard.jsx - Dashboard → Link context: reads and deletes
src/pages/Dashboard.jsx - Dashboard → Metric card: renders
src/pages/Dashboard.jsx - Dashboard → Link card: renders
src/pages/Dashboard.jsx - Analytics → Link context: reads links
src/pages/Analytics.jsx - Analytics → Metric card: renders
src/pages/Analytics.jsx - Earnings → Link context: reads clicks
src/pages/Earnings.jsx - Earnings → Metric card: renders
src/pages/Earnings.jsx - Database editor → Browser storage: reads and writes
src/pages/Database.jsx - Browser storage → Sync endpoint: syncs data
src/utils/storage.js - Route shell → Sync endpoint: loads database
src/App.jsx