A modern, professional Flask-based web application for displaying and managing Tableau dashboards with advanced user preferences, favorites management, and comprehensive API endpoints.
Version: 2.0.0
Status: Production Ready β
- β User Authentication - Secure login system with session management
- β Dashboard Management - Browse, select, and view Tableau dashboards
- β Favorites System - Save and organize favorite dashboards
- β Recent Dashboards - Track and access recently viewed dashboards
- β User Preferences - Customizable theme and settings per user
- β Dark Mode - Professional dark theme support
- β Responsive Design - Mobile-friendly interface
- β API Endpoints - RESTful JSON API for programmatic access
- β Export Functionality - Export dashboards and data to Excel
- β Audit Logging - Complete user action tracking
- β Caching System - Intelligent data caching for performance
- β Error Handling - Comprehensive error pages and logging
- β Security - CSRF protection, secure cookies, input validation
- β Health Check API - Application status monitoring
- β Logging System - Rotating file logs with multiple levels
- β Configuration Management - Environment-based configuration
- β User Data Persistence - Local user preference storage
- β Tableau Integration - Full Tableau Server Client support
- Python 3.8+
- Flask 3.0.0
- Tableau Server or Tableau Public
- Modern web browser (Chrome, Firefox, Safari, Edge)
git clone <repository-url>
cd Tableau-with-Flask-BackEndpython -m venv venv
# On Linux/Mac
source venv/bin/activate
# On Windows
venv\Scripts\activatepip install -r requirements.txt# Copy the example env file
cp .env.example .env
# Edit .env with your configuration
nano .env# Flask
FLASK_ENV=production
FLASK_DEBUG=False
SECRET_KEY=your-secure-secret-key-here-minimum-32-chars
# Tableau Server
TABLEAU_SERVER_URL=http://your-tableau-server:8000
TABLEAU_USERNAME=your-tableau-username
TABLEAU_PASSWORD=your-tableau-password
TABLEAU_PROJECT_NAME=your-project-name
# Application
APP_PASSWORD=your-app-password
ALLOWED_USERS=user1,user2,user3
# Session
SESSION_TIMEOUT=1800
# Features
ENABLE_DARK_MODE=True
ENABLE_FAVORITES=True
ENABLE_RECENT_DASHBOARDS=Truemkdir -p logs user_data static/imagespython main.pyThe application will be available at http://localhost:5000
Tableau-with-Flask-BackEnd/
βββ main.py # Application entry point
βββ config.py # Configuration management
βββ models.py # Data models (User, Dashboard)
βββ utils.py # Utility functions
βββ requirements.txt # Python dependencies
βββ .env.example # Environment variables template
β
βββ templates/ # HTML templates
β βββ login.html # Login page
β βββ select-dashboard.html # Dashboard selection
β βββ dashboard.html # Dashboard viewer
β βββ profile.html # User profile
β βββ error.html # Error pages
β
βββ static/ # Static assets
β βββ css/ # Stylesheets
β β βββ bootstrap.min.css
β β βββ login.css
β β βββ dashboard.css
β β βββ styles.css
β β βββ util.css
β βββ js/ # JavaScript files
β β βββ bootstrap.min.js
β β βββ jquery-3.4.1.min.js
β β βββ mainScript.js
β βββ images/ # Image assets
β
βββ logs/ # Application logs
βββ user_data/ # User preferences storage
β
βββ README.md # This file
βββ API.md # API Documentation
βββ CHANGELOG.md # Version history
βββ INSTALLATION.md # Detailed installation guide
- Secure password validation
- Session timeout (default: 30 minutes)
- CSRF protection on all forms
- Secure cookies (HttpOnly, SameSite)
- Username and password validation
- File name sanitization
- Safe URL redirect validation
- SQL injection prevention
- User action tracking
- Failed login attempt logging
- Error logging with rotation
- Access logs for all API calls
- User preferences encryption support
- Secure file handling
- Safe path operations
- XSS prevention in templates
GET /api/dashboards
Response:
{
"success": true,
"dashboards": [...],
"favorites": ["dashboard_id1", "dashboard_id2"]
}POST /api/dashboard/<dashboard_id>/favorite
Body: {"favorite": true}
Response:
{
"success": true,
"favorites": [...]
}POST /api/dashboard/<dashboard_id>/view
Response:
{
"success": true
}GET /api/user/preferences
Response:
{
"success": true,
"user": {
"id": "...",
"username": "...",
"theme": "light",
"favorites": [...],
"recent_dashboards": [...]
}
}POST /api/user/preferences
Body: {"theme": "dark"}
Response:
{
"success": true,
"user": {...}
}GET /api/export/favorites
Response:
{
"success": true,
"file": "path/to/export.xlsx"
}GET /api/health
Response:
{
"status": "healthy",
"uptime": "2h 45m",
"timestamp": "2024-04-29T12:34:56",
"version": "2.0.0"
}- Light Mode (Default) - Clean white interface
- Dark Mode - Eye-friendly dark theme
- Persistent theme preference per user
- CSS variables for easy customization
- Mobile-first approach
- Tablet optimization
- Desktop enhancement
- Touch-friendly controls
- Modern gradient accents
- Smooth animations
- Professional color scheme
- Clear typography hierarchy
- Semantic HTML
- ARIA labels where needed
- Keyboard navigation support
- Color contrast compliance
FLASK_ENV # 'production' or 'development'
FLASK_DEBUG # True/False
SECRET_KEY # Secret key for sessionsTABLEAU_SERVER_URL # Tableau server address
TABLEAU_USERNAME # Tableau login username
TABLEAU_PASSWORD # Tableau login password
TABLEAU_PROJECT_NAME # Project to displaySESSION_TIMEOUT # Session timeout in seconds (default: 1800)
CACHE_TIMEOUT # Cache duration in seconds (default: 300)
LOG_LEVEL # Logging level (INFO, DEBUG, WARNING)ENABLE_DARK_MODE # Enable dark mode
ENABLE_FAVORITES # Enable favorites feature
ENABLE_RECENT_DASHBOARDS # Enable recent dashboards
API_ENABLE_IMPORT_EXPORT # Enable export functionality- app.log - Main application log
- audit.log - User action audit trail
- DEBUG - Detailed information for debugging
- INFO - General information
- WARNING - Warning messages
- ERROR - Error messages
- Max file size: 10MB
- Backup count: 5 files
- Automatic cleanup of old logs
Solution:
- Verify Tableau server URL is correct
- Check username and password
- Ensure network connectivity
- Check firewall rules
Solution:
- Verify ALLOWED_USERS in .env matches actual usernames
- Check APP_PASSWORD matches login attempt
- Check logs in
logs/app.log
Solution:
- Verify Tableau project name is correct
- Check user has access to dashboards
- Clear cache: Delete cached files
- Check network connectivity
Solution:
- Clear browser cache
- Check ENABLE_DARK_MODE=True in .env
- Verify CSS file is loaded (check browser console)
- Dashboard data cached for 5 minutes
- Screenshot thumbnails cached
- User preferences cached
- Minimal database queries
- Efficient file operations
- Smart pagination
- Minified CSS and JavaScript
- Image optimization
- Lazy loading support
python main.py
# Application runs at http://localhost:5000# Using Gunicorn
gunicorn -w 4 -b 0.0.0.0:5000 main:app
# Using uWSGI
uwsgi --http :5000 --wsgi-file main.py --callable appFROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "main.py"]- β Complete redesign with modern UI
- β API endpoints for programmatic access
- β Dark mode theme
- β Export functionality
- β Comprehensive logging
- β Professional code structure
- β English-only interface
- β CSS in separate files
- Initial release with basic functionality
This project is provided as-is for professional use.
For issues, questions, or feature requests:
- Check the troubleshooting section
- Review logs in
logs/directory - Check
.envconfiguration - Verify Tableau connectivity
- Database support for user data
- Role-based access control (RBAC)
- Two-factor authentication (2FA)
- Dashboard search and filtering
- Advanced export formats (PDF, CSV)
- Email notifications
- Custom dashboard layouts
- Real-time dashboard updates
Created with β€οΈ for professional dashboard management