How mohamedyaakoubi/potential works
Potential is a Next.js Abu Dhabi open-data discovery interface with an AI chat assistant, dataset listing, and CSV/XLSX visualization. The main flow runs from the home page through search/chat state into dataset results; chat can also call a GPT endpoint and accept document images. API route files are present, but their implementations were not sampled, so their behavior and connections are left unspecified. Edges reflect shown calls or page wiring; optional/unverified links are omitted.
Main entry points: potential-section-with-chat.tsx Chat assistant · page.tsx Home state · hero-section.tsx Search hero · button.tsx Button control
Components 21
User experience
- Home state
app/page.tsx - Search hero
components/hero-section.tsx - Site footer
components/footer.tsx
Dataset discovery
- Dataset results
components/search-results.tsx - Dataset API route
app/api/dataset/route.ts - Search API route
app/api/search/route.ts - Download proxy route
app/api/proxyDownload/route.ts
AI assistant
- Chat assistant
components/potential-section-with-chat.tsx - GPT endpoint
app/api/gpt/route.ts - Chat history
utils/chatHistory.ts - Document API route
app/api/doc/route.ts
Shared runtime
- Button control
components/ui/button.tsx - Card layout
components/ui/card.tsx - Input control
components/ui/input.tsx - Scroll area
components/ui/scroll-area.tsx - Class utilities
lib/utils.ts
Other components
- Visitor
- GPT service
- Firebase Storage
- Form Recognizer
- Abu Dhabi catalog
Connections 24
- Visitor → Home state: opens
README.md - Home state → Search hero: renders
app/page.tsx - Home state → Chat assistant: renders
app/page.tsx - Home state → Dataset results: renders
app/page.tsx - Home state → Site footer: renders
app/page.tsx - Search hero → Home state: submits query
app/page.tsx - Chat assistant → Home state: sends datasets
app/page.tsx - Dataset results → Abu Dhabi catalog: fetches metadata
components/search-results.tsx - Chat assistant → GPT endpoint: posts messages
components/potential-section-with-chat.tsx - GPT endpoint → Chat history: reads and saves
app/api/gpt/route.ts - GPT endpoint → GPT service: sends prompt
app/api/gpt/route.ts - Chat assistant → Firebase Storage: uploads images
components/potential-section-with-chat.tsx - Chat assistant → Form Recognizer: processes document
components/potential-section-with-chat.tsx - Chat assistant → Button control: uses controls
components/potential-section-with-chat.tsx - Chat assistant → Card layout: uses layout
components/potential-section-with-chat.tsx - Chat assistant → Input control: uses input
components/potential-section-with-chat.tsx - Chat assistant → Scroll area: uses scrolling
components/potential-section-with-chat.tsx - Search hero → Button control: uses control
components/hero-section.tsx - Search hero → Input control: uses input
components/hero-section.tsx - Site footer → Button control: uses control
components/footer.tsx - Button control → Class utilities: merges classes
components/ui/button.tsx - Card layout → Class utilities: merges classes
components/ui/card.tsx - Input control → Class utilities: merges classes
components/ui/input.tsx - Scroll area → Class utilities: merges classes
components/ui/scroll-area.tsx