How rin442666/convenience-finder works
Convenience Finder helps users locate nearby convenience stores, inspect map results, and find stores through a rule-based chat assistant. Supporting workflows include account access, favorites and ratings, user-submitted store requests, and administrator management and statistics. The store and account layers use a shared database abstraction with SQLite/PostgreSQL modes; store search can also use Google Places and road-distance calculations. The README is empty, and several UI pages and API routes were not sampled, so the graph limits relationships to those shown in excerpts or the source index.
Main entry points: server-auth.ts Server authentication · store-db.ts Store catalog and reviews · db.ts Application database · ChatBot.tsx Chat widget
Components 26
Store discovery
- Store finder page
src/app/page.tsx - Store search API
src/app/api/stores/route.ts - Map view
src/components/MapView.tsx - Catalog API
src/app/api/catalog/route.ts
Chat assistant
- Chat widget
src/components/ChatBot.tsx - Chat endpoint
src/app/api/chat/route.ts - Intent and response logic
src/lib/chatbot.ts - Voice input
src/lib/use-voice-input.ts
Accounts and community
- Sign-in dialog
src/components/AuthModal.tsx - App session provider
src/components/app-provider.tsx - Browser session storage
src/lib/client-session.ts - Roles and permissions
src/lib/auth-system.ts - Server authentication
src/lib/server-auth.ts - Favorites API
src/app/api/favorites/route.ts - Store requests API
src/app/api/store-requests/route.ts - Store request operations
src/lib/store-requests.ts - Authentication API
src/app/api/auth/route.ts - Toast notifications
src/components/Toast.tsx - Escape-key handling
src/lib/use-escape.ts
Administration
- Admin dashboard
src/app/admin/page.tsx - Admin statistics API
src/app/api/admin/stats/route.ts
Data and integrations
- Store catalog and reviews
src/lib/store-db.ts - Application database
src/lib/db.ts - Road distance service
src/lib/osrm.ts - Google Places
Other components
- Visitor
Connections 28
- Store search API → Store catalog and reviews: queries catalog
src/app/api/stores/route.ts - Store search API → Road distance service: sorts by roads
src/app/api/stores/route.ts - Store search API → Google Places: queries places
src/app/api/stores/route.ts - Catalog API → Store catalog and reviews: loads catalog
src/app/api/catalog/route.ts - Chat widget → Chat endpoint: sends messages
src/components/ChatBot.tsx - Chat widget → Voice input: uses voice input
src/components/ChatBot.tsx - Chat endpoint → Intent and response logic: detects intent
src/app/api/chat/route.ts - Chat endpoint → Store catalog and reviews: searches stores
src/app/api/chat/route.ts - Chat endpoint → Road distance service: ranks by roads
src/app/api/chat/route.ts - Sign-in dialog → App session provider: calls login
src/components/AuthModal.tsx - App session provider → Browser session storage: persists session
src/components/app-provider.tsx - App session provider → Roles and permissions: uses user types
src/components/app-provider.tsx - Sign-in dialog → Toast notifications: shows messages
src/components/AuthModal.tsx - Sign-in dialog → Escape-key handling: handles escape
src/components/AuthModal.tsx - Chat widget → Toast notifications: shows messages
src/components/ChatBot.tsx - Chat widget → Escape-key handling: handles escape
src/components/ChatBot.tsx - Authentication API → Server authentication: authenticates users
src/app/api/auth/route.ts - Server authentication → Application database: reads and writes
src/lib/server-auth.ts - Server authentication → Roles and permissions: checks permissions
src/lib/server-auth.ts - Favorites API → Server authentication: checks session
src/app/api/favorites/route.ts - Favorites API → Application database: reads and writes
src/app/api/favorites/route.ts - Store requests API → Server authentication: checks permissions
src/app/api/store-requests/route.ts - Store requests API → Store request operations: manages requests
src/app/api/store-requests/route.ts - Store requests API → Store catalog and reviews: adds approved store
src/app/api/store-requests/route.ts - Store request operations → Application database: reads and writes
src/lib/store-requests.ts - Admin statistics API → Server authentication: checks admin
src/app/api/admin/stats/route.ts - Admin statistics API → Application database: queries statistics
src/app/api/admin/stats/route.ts - Store catalog and reviews → Application database: reads and writes
src/lib/store-db.ts