How anmolanubhav07/krishiconnects works
Purpose and runtime
This is a Next.js App Router marketplace application connecting task posters with service providers. It runs as a TypeScript/React web application, with server-side API route handlers and client-side state/auth integrations. Primary entry points are src/app/layout.tsx (global document/layout), src/app/page.tsx (landing route), and API handlers under src/app/api/.
Route-driven product surfaces
The App Router defines the major user journeys: task discovery and details in src/app/browse-tasks/page.tsx and src/app/tasks/[id]/page.tsx; task creation in src/app/post-task/page.tsx; provider discovery and profiles in src/app/find-providers/page.tsx and src/app/providers/[id]/page.tsx; and role-specific workspaces in src/app/dashboard/page.tsx and src/app/provider-dashboard/page.tsx.
Authentication and access boundary
Authentication is centered on Supabase-facing client code and an application auth context: src/lib/supabaseClient.ts, src/lib/auth.tsx, and src/components/layout/AuthGuard.tsx. Login, signup, OAuth/callback completion, and profile completion are separate route stages at src/app/login/page.tsx, src/app/signup/page.tsx, src/app/auth/callback/page.tsx, and src/app/complete-profile/page.tsx. Guards and shared shell components establish the boundary between public marketing/auth routes and authenticated product routes.
Provider onboarding and publishing pipeline
Provider profile creation is a multi-step workflow coordinated by src/app/onboarding/page.tsx, persisted/rehydrated through src/lib/onboarding.ts and src/lib/useOnboardingData.ts. Steps collect basic identity, skills, experience, verification, location, rates, languages, portfolio, preview, and publish state; representative endpoints are src/app/onboarding/steps/Step1BasicInfo.tsx, src/app/onboarding/steps/Step5Verify.tsx, and src/app/onboarding/steps/Step12Publish.tsx.
Marketplace matching and domain transformation
Core domain models and database mappings are isolated from page presentation in src/lib/types.ts, src/lib/database.types.ts, and src/lib/mappers.ts. Matching/classification logic is separated into src/lib/match.ts and src/lib/classifier.ts, supporting provider search, task browsing, and likely recommendation/routing decisions rather than embedding those rules in route pages.
AI service boundary
Two server API routes expose specialized AI capabilities: src/app/api/kisaan-ai/route.ts and src/app/api/provider-ai/route.ts. The user-facing Kisaan assistant is embedded through src/components/KisaanAIWidget.tsx; landing-page AI presentation is distinct in src/components/landing/AIPreview.tsx. This creates a clear browser-to-Next API boundary for AI-provider credentials and request handling.
Shared application state, wallet, and activity
Cross-page client state is provided through src/lib/store.tsx; wallet-specific state and UI use src/lib/useWallet.ts and src/components/WalletCard.tsx. User activity/notification concerns are centralized in src/lib/activity.ts and surfaced at src/app/notifications/page.tsx. Wallet, settings, and support are independent account-domain routes: src/app/wallet/page.tsx, src/app/settings/page.tsx, and src/app/support/page.tsx.
UI composition and deployment
src/components/layout/AppShell.tsx, src/components/layout/Navbar.tsx, and src/components/layout/MobileBottomNav.tsx provide responsive product chrome around route content. Reusable marketplace display units such as src/components/ProviderCard.tsx keep list/detail presentation consistent. Infrastructure is standard Next.js configuration in next.config.ts; deployment intent includes Vercel per the README, while Supabase is the material external backend service indicated by src/lib/supabaseClient.ts.
Main entry points: AuthGuard.tsx Auth guard · layout.tsx Root layout · page.tsx Workspaces and account · auth.tsx Auth context
Components 19
App Router UI
Browser-rendered routes and shared product chrome.
- Root layout
src/app/layout.tsx - App shell · Responsive authenticated product chrome.
src/components/layout/AppShell.tsx - Public marketplace routes · Landing, task browsing, provider discovery, and detail journeys.
src/app/page.tsx - Workspaces and account · Dashboards, wallet, notifications, settings, and support.
src/app/dashboard/page.tsx - Auth route stages · Login, signup, callback, and profile completion.
src/app/login/page.tsx - Auth guard
src/components/layout/AuthGuard.tsx - Provider onboarding · Collects and publishes provider profile data.
src/app/onboarding/page.tsx - Kisaan AI widget
src/components/KisaanAIWidget.tsx
Client Domain
Client-side auth, state, and marketplace logic.
- Auth context
src/lib/auth.tsx - Application store
src/lib/store.tsx - Onboarding persistence · Persists and rehydrates onboarding progress.
src/lib/onboarding.ts - Marketplace domain · Database models are transformed for page presentation.
src/lib/mappers.ts - Matching and classification · Supports provider search and task browsing decisions.
src/lib/match.ts - Supabase client
src/lib/supabaseClient.ts
Server APIs
Next.js route handlers that isolate AI requests.
- Kisaan AI API · Server-side AI request boundary for the assistant.
src/app/api/kisaan-ai/route.ts - Provider AI API · Specialized provider AI capability.
src/app/api/provider-ai/route.ts
External Services
- Supabase · Material authentication and data backend.
- AI provider
- Vercel
Connections 18
- Root layout → App shell: composes
- Root layout → Public marketplace routes: hosts
- App shell → Workspaces and account: wraps
- Auth guard → Workspaces and account: protects
- Auth guard → Provider onboarding: protects
- Auth route stages → Auth context: establishes session
- Auth guard → Auth context: checks
- Auth context → Supabase client: uses
- Supabase client → Supabase: connects to
- Public marketplace routes → Marketplace domain: renders domain data
- Workspaces and account → Application store: uses
- Marketplace domain → Matching and classification: feeds
- Provider onboarding → Onboarding persistence: persists progress
- Onboarding persistence → Supabase client: stores profile data
- Kisaan AI widget → Kisaan AI API: calls
- Kisaan AI API → AI provider: forwards AI requests
- Provider AI API → AI provider: forwards AI requests
- Vercel → Root layout: deploys application