DataViz is a modern, multi-source real-time dashboard that allows you to monitor stocks, weather, and custom data all in one unified interface. Built with React, Node.js, and TypeScript, it provides a professional-grade data visualization platform with real-time updates and interactive charts.
- ๐ Stock Market Data: Real-time stock prices with technical indicators (RSI, SMA)
- ๐ค๏ธ Weather Data: Live weather conditions from major global cities
- ๐ CSV Upload: Import and visualize spreadsheet data
- ๐ JSON Upload: Parse and display structured JSON data
- ๐ Real-Time Updates: WebSocket connections for live data streaming
- ๐ Dark Theme: Optimized for professional trading environments
- ๐ฑ Responsive Design: Works seamlessly on desktop and mobile
- ๐จ Interactive Charts: Powered by Recharts with technical indicators
- โก Live Updates: Real-time price movements and data changes
- ๐ง Configurable: Select only the data sources you need
- TypeScript: Full type safety across frontend and backend
- WebSocket: Real-time bidirectional communication
- API Integration: Alpha Vantage (stocks) and OpenWeatherMap (weather)
- File Processing: Smart CSV/JSON parsing with validation
- Caching: Intelligent data caching to respect API rate limits
- Error Handling: Robust error handling with fallback mechanisms
- Node.js (v16 or higher)
- npm or yarn
- Alpha Vantage API Key (free at alphavantage.co)
- OpenWeather API Key (free at openweathermap.org)
-
Clone the repository
git clone https://github.com/yourusername/dataviz-pro.git cd dataviz-pro -
Install Backend Dependencies
cd backend npm install -
Configure API Keys
# Copy environment template cp .env.example .env # Edit .env and add your API keys ALPHA_VANTAGE_API_KEY=your_stock_api_key_here OPENWEATHER_API_KEY=your_weather_api_key_here
-
Install Frontend Dependencies
cd ../frontend npm install
Start both servers simultaneously:
Terminal 1 - Backend Server:
cd backend
npm run devTerminal 2 - Frontend Server:
cd frontend
npm startAccess the application at http://localhost:3000
- Symbols: AAPL, GOOGL, MSFT, AMZN, TSLA, NVDA, META
- Metrics: Real-time prices, volume, market cap, price changes
- Technical Indicators: RSI (14-period), SMA 20, SMA 50
- Updates: Every 1 minute during market hours, simulated outside hours
- API: Alpha Vantage (5 calls/minute free tier)
- Locations: New York, London, Tokyo, San Francisco, Sydney
- Metrics: Temperature, humidity, pressure, wind speed, conditions
- Updates: Every 10 minutes with real weather conditions
- API: OpenWeatherMap (1000 calls/day free tier)
- CSV Support: Automatic column mapping for name/value pairs
- JSON Support: Flexible parsing of various data structures
- File Size: Maximum 10MB per file
- Validation: Built-in error checking and data sanitization
DataViz Pro/
โโโ backend/ # Node.js + Express + TypeScript
โ โโโ src/
โ โ โโโ server.ts # Main server with WebSocket support
โ โ โโโ realStockService.ts # Alpha Vantage integration
โ โ โโโ weatherService.ts # OpenWeather integration
โ โ โโโ fileUploadService.ts # CSV/JSON processing
โ โ โโโ stockGenerator.ts # Mock data generator
โ โ โโโ config.ts # Configuration management
โ โ โโโ types.ts # TypeScript interfaces
โ โโโ uploads/ # Temporary file storage
โ โโโ package.json
โโโ frontend/ # React + TypeScript
โ โโโ src/
โ โ โโโ pages/
โ โ โ โโโ DataSourceSelection.tsx # Initial setup page
โ โ โ โโโ Dashboard.tsx # Main dashboard
โ โ โ โโโ StockDetail.tsx # Detailed stock view
โ โ โโโ components/
โ โ โ โโโ StockCard.tsx # Stock display component
โ โ โ โโโ WeatherCard.tsx # Weather display component
โ โ โ โโโ CustomDataCard.tsx # Custom data display
โ โ โ โโโ PriceChart.tsx # Interactive charts
โ โ โ โโโ StockInsights.tsx # Market analysis
โ โ โ โโโ FileUpload.tsx # File upload interface
โ โ โโโ hooks/
โ โ โ โโโ useWebSocket.ts # WebSocket connection logic
โ โ โโโ types/
โ โ โ โโโ dataTypes.ts # TypeScript interfaces
โ โ โโโ index.css # Dark theme styling
โ โโโ package.json
โโโ README.md
- Port: 3001 (configurable via PORT env var)
- API Rate Limits: Respect free tier limitations
- Cache Duration: 1 minute for stocks, 10 minutes for weather
- File Upload: 10MB maximum, CSV/JSON only
- WebSocket URL:
ws://localhost:3001 - Reconnection: Automatic with exponential backoff
- Theme: Dark mode optimized for data visualization
- Charts: Recharts with custom styling
- Visit
http://localhost:3000 - Select your desired data sources (stocks, weather, CSV, JSON)
- Click "Launch Dashboard" to start monitoring
- Use the โ๏ธ Reconfigure button to change data sources
- Click any stock card to view detailed analysis
- Interactive charts with technical indicators
- Real-time price updates during market hours
- Market insights and trading signals
- Live weather from 5 major cities
- Temperature changes and weather conditions
- Detailed metrics including humidity, pressure, wind
- Drag and drop CSV/JSON files
- Automatic data parsing and validation
- Instant visualization of uploaded data
- Support for timestamps, categories, and units
GET /api/stocks- Get all stock dataGET /api/stocks/:symbol- Get specific stockGET /api/stocks/:symbol/history- Get historical dataGET /api/weather- Get all weather dataGET /api/weather/:location- Get specific location weatherPOST /api/upload/csv- Upload CSV filePOST /api/upload/json- Upload JSON fileGET /api/datasources- Get data source statusGET /health- Health check
- Connection:
ws://localhost:3001 - Events: Real-time stock and weather updates
- Frequency: 1 minute (stocks), 10 minutes (weather)
- Reconnection: Automatic with exponential backoff
cd backend
npm run dev # Start with hot reload
npm run build # Build TypeScript
npm run type-check # Type checking onlycd frontend
npm start # Start development server
npm run build # Build for production
npm test # Run tests- Create service in
backend/src/(e.g.,newDataService.ts) - Add API endpoints in
server.ts - Create frontend component in
frontend/src/components/ - Update data source selection in
DataSourceSelection.tsx - Add to dashboard in
Dashboard.tsx
- Dark theme variables in
frontend/src/index.css - Component-specific styles with CSS classes
- Responsive breakpoints for mobile optimization
- Add new stock symbols in
backend/src/config.ts - Add weather locations in
config.weatherLocations - Customize API endpoints and cache durations
- Modify chart configurations in
PriceChart.tsx - Add new technical indicators
- Customize color schemes and themes
Backend won't start:
- Ensure Node.js v16+ is installed
- Check if port 3001 is available
- Verify API keys in
.envfile
API calls failing:
- Check API key validity
- Verify internet connection
- Review rate limit status
File uploads not working:
- Check file format (CSV/JSON only)
- Ensure file size under 10MB
- Verify backend uploads directory exists
WebSocket disconnections:
- Check network stability
- Frontend automatically reconnects
- Refresh page if connection fails
If port 3001 is in use:
// In backend/src/config.ts
export const config = {
port: process.env.PORT || 3002, // Change port
// ...
}- Alpha Vantage: 5 calls/minute (free tier)
- OpenWeatherMap: 1000 calls/day (free tier)
- App automatically caches data to respect limits
This project is open source and available under the MIT License.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Additional data sources (crypto, forex, news)
- User authentication and saved configurations
- Data export functionality
- Mobile app companion
- Advanced chart types and indicators
- Real-time collaboration features
- Custom alerts and notifications
- Historical data analysis tools
Built with โค๏ธ using React, Node.js, and TypeScript