DoubleupDonny's picture
Update the data on these dashboards for the past 30 days
bbc658a verified
const express = require('express');
const path = require('path');
const app = express();
const PORT = process.env.PORT || 3000;
// Serve static files
app.use(express.static(path.join(__dirname, 'public')));
// API endpoints for dashboard data
app.get('/api/dashboard', (req, res) => {
const timeframe = req.query.timeframe || '30d';
const data = {
topCategories: [
{ name: 'AI Development', value: 38 },
{ name: 'Scientific Research', value: 28 },
{ name: 'Business Strategy', value: 15 },
{ name: 'Creative Arts', value: 10 },
{ name: 'Technical Solutions', value: 7 },
{ name: 'Other', value: 2 }
],
revenueOpportunities: [
{ name: 'AI Consulting Services', value: 1850000 },
{ name: 'Premium API Access', value: 1200000 },
{ name: 'Custom Model Training', value: 2200000 },
{ name: 'Enterprise Solutions', value: 3100000 }
]
};
res.json(data);
});
// Handle SPA routing
app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'index.html'));
});
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});