β¨ ChartGPT is an AI-powered chart generation tool that allows users to generate stunning charts based on their input. The application uses Firebase for authentication and hosting, and Google Charts for data visualization.
- Website: https://chartgpt-tv.web.app/
- YouTube Video: https://youtu.be/6qq1pvhh9VI
- Features
- What's New
- Architecture
- Setup and Installation
- Usage
- Error Handling
- Troubleshooting
- Contributing
- License
- β User authentication with email/password and Google Sign-In
- β AI-powered chart generation (Gemini 2.0 Flash)
- β Download generated charts as PNG files
- β Fully responsive design (Desktop, Tablet, Mobile)
- β Modern gradient UI with smooth animations
- β Comprehensive error handling with funny messages
- β Chart type selection (Column, Bar, Line, Pie)
- β Real-time chat interface with AI
- β Input validation and error messages
- β Loading states and animations
- Modern Design: Beautiful purple gradient theme with smooth animations
- Fully Responsive: Works perfectly on desktop, tablet, and mobile devices
- Better Typography: Enhanced fonts and spacing for better readability
- Interactive Elements: Smooth hover effects and transitions
- Typing Animation: Animated dots when AI is processing
- β Comprehensive error messages with emojis and humor
- β Input validation for authentication fields
- β Network error handling
- β API quota exceeded handling with helpful tips
- β Chart parsing error handling
- β File download error handling
- β Toast notifications for all actions
- β Try-catch blocks for all async operations
- β Better state management
- β Input sanitization
- β Loading state indicators
- β Button disable states during processing
- β Keyboard support (Enter to send message)
- HTML/CSS: Modern, responsive frontend with mobile-first approach
- JavaScript (ES6+): Handles user interactions, authentication, and chart generation
- Google Charts: Data visualization library
- Google Generative AI (Gemini 2.0 Flash): AI-powered chart data generation
- Firebase Authentication: Secure email/password and Google Sign-In
- Firebase Hosting: Fast, secure static file hosting
- GitHub Actions: Automated deployment on push to main branch
- Node.js (v14+)
- Firebase CLI
- Google account for Firebase
- Google AI API key
git clone https://github.com/vighneshnilajakar/chartgpt.git
cd chartgptcp public/config.example.js public/config.jsFirebase:
- Go to Firebase Console
- Create a new project
- Enable Firebase Authentication (Email/Password + Google Sign-In)
- Copy the configuration from Project Settings
Google Generative AI:
- Visit Google AI Studio
- Create an API key
β οΈ Keep this secret! Don't commit it to GitHub!
export const firebaseConfig = {
apiKey: "YOUR_FIREBASE_API_KEY",
authDomain: "YOUR_PROJECT.firebaseapp.com",
databaseURL: "https://YOUR_PROJECT.firebasedatabase.app",
projectId: "YOUR_PROJECT_ID",
storageBucket: "YOUR_PROJECT.firebasestorage.app",
messagingSenderId: "YOUR_MESSAGING_SENDER_ID",
appId: "YOUR_APP_ID"
};
export const GENERATIVE_AI_API_KEY = "YOUR_GOOGLE_AI_API_KEY";firebase emulators:start --only hostingVisit: http://localhost:5000
firebase login
firebase deploy- Use email/password or Google Sign-In to authenticate
- Enter valid email and password
- Enjoy funny error messages if something goes wrong! π
- Enter a keyword (e.g., "world population", "cryptocurrency prices")
- Select your preferred chart type:
- π Column Chart (default)
- π Bar Chart
- π Line Chart
- π₯§ Pie Chart
- AI will generate relevant data and visualize it
- Watch the animated typing indicator while processing
- Click the "β¬οΈ Download Chart" button
- Chart will be saved as PNG to your downloads folder
- Click the Sign Out button to logout
- Your session will be cleared
ChartGPT handles errors gracefully with helpful and funny messages:
β User not found! Did you forget your email address? π
π Wrong password! Your memory is as good as your password π€¦
π§ That email looks fishy... is it even valid? π
π° Quota exceeded! Dev made too many requests without paying. F for respect! πͺ¦
β° Oops! Dev forgot to upgrade the plan πΈ The API quota is exhausted!
π Invalid API key! The dev exposed secrets on GitHub and now everything is broken! π
π§ Please enter your email address! π
π Password field is empty! Enter something! π
π
Empty message! Type something, anything! π
This means the API rate limit has been reached. Here's how to fix it:
-
Request Quota Increase:
- Go to Google Cloud Console
- Navigate to APIs & Services β Quotas
- Search for
generativelanguage.googleapis.com/generate_content_requests - Click on it and edit the quota
- Request increase (e.g., to 100 requests/minute)
- Wait for approval (usually instant)
-
Enable Billing:
- Go to Billing in Google Cloud Console
- Link a billing account (Google often gives $300 credits)
- This usually provides immediate quota
-
Wait and Retry:
- The API resets every minute
- Try again after a minute
- Check your
config.jsfile - Verify the API keys are copied correctly
- Make sure keys are not expired
β οΈ Never commitconfig.jsto GitHub!
- Ensure JavaScript is enabled
- Check browser console for errors (F12)
- Verify Google Charts library is loading
- Try a different chart type
- Clear browser cookies/cache
- Try incognito/private mode
- Verify Firebase project has authentication enabled
- Check if user account exists in Firebase
# Login to Firebase
firebase login
# Check deployment status
firebase deploy --debug
# View logs
firebase functions:log| Browser | Desktop | Tablet | Mobile |
|---|---|---|---|
| Chrome | β | β | β |
| Firefox | β | β | β |
| Safari | β | β | β |
| Edge | β | β | β |
ChartGPT/
βββ public/
β βββ index.html # Login page
β βββ prompt.html # Main app page
β βββ app.js # Authentication logic
β βββ prompt.js # Chart generation logic
β βββ styles.css # Login page styles
β βββ prompt.css # Main app styles
β βββ config.example.js # API keys template
β βββ config.js # API keys (not in git)
βββ firebase.json # Firebase config
βββ package.json # Dependencies
βββ README.md # This file
- Response Time: < 3 seconds for chart generation
- File Size: Optimized CSS/JS with no unnecessary dependencies
- Load Time: ~2-3 seconds on 4G connection
- Mobile Friendly: Optimized for all screen sizes
- β
Never commit
config.jsto GitHub - β Use environment variables for sensitive data in production
- β Enable Firebase rules for authentication
- β Regularly rotate API keys
- β
Use
.gitignoreto excludeconfig.js
# API Keys
public/config.js
.env
.env.local
# Dependencies
node_modules/
# Firebase
.firebase/
.firebaserc
| Category | Technology |
|---|---|
| Frontend | HTML5, CSS3, JavaScript (ES6+) |
| UI Library | Google Charts |
| AI | Google Generative AI (Gemini 2.0 Flash) |
| Authentication | Firebase Auth |
| Hosting | Firebase Hosting |
| Fonts | Google Fonts (Poppins) |
| Icons | Emojis π |
This project is licensed under the ISC License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Vighnesh Nilajakar
- GitHub: @VighneshNilajakar
Having issues? Here's what to try:
- Check the Troubleshooting section
- Review your Firebase configuration
- Check browser console for errors (F12)
- Open an issue on GitHub
- Google Firebase team for excellent authentication and hosting
- Google AI team for the amazing Generative AI API
- Google Charts for powerful visualization tools
Enjoy creating amazing charts with AI! πβ¨