How prsaveliy/chart-alchemy works
ChartAlchemy is a web application for creating and managing AI-generated, dataset-derived, and manually configured charts. Users can also register or sign in with email/password or Google. The frontend routes users to chart and account experiences; the backend exposes authenticated chart and account APIs, with chart generation and persistence handled by services and repositories. Dataset parsing and chart-option construction form a distinct internal stage. Source excerpts establish backend routing and service calls; frontend-to-API wiring and several integrations are not shown, so those relationships are left unasserted.
Main entry points: main.tsx Page routing · oauth.service.ts Google OAuth · new-chart.tsx Chart workflow · app.ts API application
Components 26
Web application
- Page routing
frontend/src/main.tsx - Chart dashboard
frontend/src/pages/dashboard.tsx - Chart workflow
frontend/src/pages/chart/new-chart.tsx - AI chart UI
frontend/src/pages/chart/ai-chart.tsx - Dataset chart UI
frontend/src/pages/chart/dataset-chart.tsx - Manual chart UI
frontend/src/pages/chart/manual-chart.tsx - Chart view
frontend/src/pages/chart/chart.tsx - Account screens
frontend/src/pages/auth/signup.tsx - Google sign-in UI
frontend/src/pages/auth/google-login.tsx
Backend API
- API application
backend/src/app.ts - Chart routes
backend/src/routes/chart.routes.ts - Chart controller
backend/src/controllers/chart.controller.ts - Account routes
backend/src/routes/auth.routes.ts - Account controller
backend/src/controllers/auth.controller.ts - OAuth controller
backend/src/controllers/oauth.controller.ts
Chart generation
- Chart service
backend/src/services/chart.service.ts - Dataset processing
backend/src/services/dataset - AI generation
backend/src/services/gemini.service.ts
Identity and accounts
- Account service
backend/src/services/auth.service.ts - Google OAuth
backend/src/services/oauth.service.ts - Token service
backend/src/services/refreshToken.service.ts
Persistence
- Chart repository
backend/src/repositories/chart.repository.ts - User repository
backend/src/repositories/user.repository.ts
Other components
- Chart user
- PostgreSQL
- Google identity
Connections 28
- Chart user → Page routing: uses
- Page routing → Chart dashboard: routes to
frontend/src/main.tsx - Page routing → Chart workflow: routes to
frontend/src/main.tsx - Page routing → Chart view: routes to
frontend/src/main.tsx - Page routing → Account screens: routes to
frontend/src/main.tsx - Chart workflow → AI chart UI: offers
- Chart workflow → Dataset chart UI: offers
- Chart workflow → Manual chart UI: offers
- API application → Chart routes: registers
backend/src/app.ts - API application → Account routes: registers
backend/src/app.ts - Chart routes → Chart controller: dispatches
backend/src/routes/chart.routes.ts - Account routes → Account controller: dispatches
backend/src/routes/auth.routes.ts - Chart controller → Chart service: calls
backend/src/controllers/chart.controller.ts - Chart controller → Dataset processing: calls
backend/src/controllers/chart.controller.ts - Chart service → Chart repository: uses
backend/src/services/chart.service.ts - Chart service → AI generation: delegates generation
- Account controller → Account service: calls
backend/src/controllers/auth.controller.ts - Account controller → Token service: uses
backend/src/controllers/auth.controller.ts - Account service → User repository: uses
backend/src/services/auth.service.ts - Account service → Token service: uses
backend/src/services/auth.service.ts - API application → OAuth controller: registers OAuth routes
backend/src/app.ts - OAuth controller → Google OAuth: calls
backend/src/controllers/oauth.controller.ts - Google OAuth → Google identity: exchanges code
backend/src/services/oauth.service.ts - Google OAuth → User repository: looks up users
backend/src/services/oauth.service.ts - Google OAuth → Chart repository: reassigns charts
backend/src/services/oauth.service.ts - Google OAuth → Token service: issues tokens
backend/src/services/oauth.service.ts - Chart repository → PostgreSQL: reads and writes
- User repository → PostgreSQL: reads and writes