How anas20023/farmora_frontend works
Farmora is a Next.js smart-agriculture marketplace frontend. Its visible user workflow covers account registration or login, authentication through Better Auth, and viewing a profile; the home page currently renders navigation rather than marketplace functionality. The profile route fetches a server-side session, serializes profile data, and renders a client profile view, with a preview fallback when no session is available. The excerpts show the auth service configured for PostgreSQL and Google sign-in. Marketplace capabilities beyond the displayed pages are not evidenced in the supplied files.
Main entry points: auth-client.ts Auth client · page.tsx Profile route · auth.ts Auth service · ProfileClient.tsx Profile view
Components 13
Web experience
- Home page
src/app/(home)/page.tsx - Navigation
src/components/Navbar.tsx - Login
src/app/login/page.tsx - Registration
src/app/register/page.tsx
Identity and sessions
- Auth client
src/lib/auth-client.ts - Auth service
src/lib/auth.ts - Auth API route
src/app/api/auth/[...all]/route.ts
Profile
- Profile route
src/app/profile/page.tsx - Profile view
src/app/profile/ProfileClient.tsx - Profile data types
src/types/profile.ts
Other components
- Visitor
- PostgreSQL
- Google sign-in
Connections 17
- Visitor → Login: opens
- Visitor → Registration: opens
- Visitor → Home page: opens
- Home page → Navigation: renders
src/app/(home)/page.tsx - Login → Auth client: authenticates
src/app/login/page.tsx - Registration → Auth client: creates account
src/app/register/page.tsx - Navigation → Auth client: reads session
src/components/Navbar.tsx - Profile route → Auth service: fetches session
src/app/profile/page.tsx - Profile route → Navigation: renders
src/app/profile/page.tsx - Profile route → Profile view: passes profile
src/app/profile/page.tsx - Profile route → Profile data types: types profile
src/app/profile/page.tsx - Profile view → Profile data types: uses types
src/app/profile/ProfileClient.tsx - Profile view → Auth client: uses client
src/app/profile/ProfileClient.tsx - Auth API route → Auth service: dispatches to
src/app/api/auth/[...all]/route.ts - Auth service → PostgreSQL: reads and writes
src/lib/auth.ts - Auth service → Google sign-in: configures provider
src/lib/auth.ts - Auth client → Auth API route: sends auth requests