How satyaa133/electa works
Electa is a mood- and location-aware discovery app: users choose a mood and category, receive tailored recommendations, inspect details, and ask follow-up questions; account holders can save items and synchronize preferences. The React app calls an Express API, which generates recommendations with Gemini and supports accounts, location, and user data. README capabilities such as browser caching, Neon caching, and probabilistic freshness are included as documented but unsampled; their internal links are therefore not asserted. API middleware and cache wiring beyond shown imports and excerpts are not expanded.
Main entry points: App.tsx App coordinator · index.ts Express API · gemini.ts Recommendation client · ChatModal.tsx Follow-up chat
Components 26
Discovery experience
- App coordinator
src/App.tsx - Mood selection
src/components/MoodSection.tsx - Category selection
src/components/CategorySection.tsx - Recommendation grid
src/components/RecommendationsGrid.tsx - Recommendation client
src/services/gemini.ts - Recommendation details
src/components/DetailModal.tsx - Follow-up chat
src/components/ChatModal.tsx - Location controls
src/components/LocationModal.tsx - Landing experience
src/components/LandingPage.tsx
Accounts and profile
- Sign-in and signup
src/components/AuthPage.tsx - Profile and bookmarks
src/components/ProfileModal.tsx
API and recommendation engine
- Dual-layer cache
- Express API
api/index.ts - Gemini generation
api/index.ts - API key rotation
api/config/apiKeyManager.ts - Neon PostgreSQL
- IP location lookup
api/index.ts - Weather context
api/index.ts
API security
- Auth middleware
api/middleware/authMiddleware.ts - Session tokens
api/auth/sessionManager.ts - Request protections
api/middleware/cors.ts
Other components
- Discoverer
- Google Gemini
- IP location providers
- wttr.in
- Browser storage
Connections 31
- Discoverer → App coordinator: uses
README.md - App coordinator → Mood selection: renders
src/App.tsx - App coordinator → Category selection: renders
src/App.tsx - App coordinator → Recommendation grid: renders
src/App.tsx - App coordinator → Recommendation client: requests recommendations
src/services/gemini.ts - Recommendation client → Express API: POSTs requests
src/services/gemini.ts - Express API → Gemini generation: generates recommendations
api/index.ts - Gemini generation → API key rotation: uses keys
api/index.ts - Gemini generation → Google Gemini: calls
api/index.ts - Express API → IP location lookup: handles location
api/index.ts - IP location lookup → IP location providers: queries
api/index.ts - Express API → Weather context: fetches context
api/index.ts - Weather context → wttr.in: queries
api/index.ts - App coordinator → Recommendation details: renders
src/App.tsx - App coordinator → Follow-up chat: renders
src/App.tsx - App coordinator → Follow-up chat: submits questions
src/App.tsx - Follow-up chat → Recommendation client: requests answers
src/services/gemini.ts - Recommendation client → Express API: POSTs questions
src/services/gemini.ts - App coordinator → Location controls: renders
src/App.tsx - App coordinator → Landing experience: renders
src/App.tsx - App coordinator → Sign-in and signup: renders
src/App.tsx - App coordinator → Profile and bookmarks: renders
src/App.tsx - Sign-in and signup → Express API: calls auth endpoints
- Profile and bookmarks → Express API: syncs profile
- Express API → Auth middleware: protects routes
api/index.ts - Auth middleware → Session tokens: validates tokens
api/middleware/authMiddleware.ts - Express API → Neon PostgreSQL: reads and writes
README.md - App coordinator → Dual-layer cache: uses cache
README.md - Dual-layer cache → Neon PostgreSQL: persists cache
README.md - Dual-layer cache → Browser storage: stores locally
README.md - Express API → Request protections: configures protections
api/index.ts