Public website and analytics dashboard for the Weather MCP project, hosted at weather-mcp.dev.
This Next.js application serves as:
- Project Homepage - Introduction, features, and documentation
- Analytics Dashboard - Public, real-time analytics from MCP server usage
- Documentation Hub - Comprehensive guides and API references
- Community Portal - Links to GitHub, discussions, and contributions
- Project overview and value proposition
- Quick start guide
- Feature highlights
- Installation instructions
- Community stats (active installations, API calls, uptime)
- Real-time usage statistics
- Tool popularity charts
- Performance metrics (response times, cache hit rates)
- Error tracking and trends
- Geographic distribution (country-level)
- API service usage (NOAA vs Open-Meteo)
- Getting started guide
- API reference
- Configuration options
- MCP integration guide
- Privacy policy
- Analytics transparency
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- Charts: Recharts
- Data Fetching: SWR (for real-time updates)
- Deployment: Vercel or self-hosted
- Node.js 20+
- npm or pnpm
- Install dependencies:
npm install- Set up environment variables:
cp .env.example .env.localEdit .env.local:
# Analytics API endpoint
NEXT_PUBLIC_ANALYTICS_API=https://analytics.weather-mcp.dev/v1
# Optional: Analytics refresh interval (ms)
NEXT_PUBLIC_REFRESH_INTERVAL=30000- Start development server:
npm run devnpm run build
npm startwebsite/
├── src/
│ ├── pages/
│ │ ├── index.tsx # Homepage
│ │ ├── dashboard.tsx # Analytics dashboard
│ │ └── docs/ # Documentation pages
│ │ ├── getting-started.tsx
│ │ ├── api-reference.tsx
│ │ └── privacy.tsx
│ ├── components/
│ │ ├── layout/ # Layout components
│ │ ├── dashboard/ # Dashboard-specific components
│ │ │ ├── ToolUsageChart.tsx
│ │ │ ├── PerformanceMetrics.tsx
│ │ │ ├── ErrorSummary.tsx
│ │ │ └── GeoMap.tsx
│ │ └── common/ # Reusable components
│ ├── api/
│ │ └── analytics.ts # API client for analytics-server
│ ├── styles/
│ │ └── globals.css # Global styles + Tailwind
│ └── utils/
│ ├── formatters.ts # Data formatting utilities
│ └── constants.ts # App constants
├── public/
│ ├── favicon.ico
│ ├── logo.svg
│ └── images/
└── next.config.js
- Hero section with project introduction
- Feature showcase
- Quick start guide
- Installation instructions
- Links to GitHub and documentation
- Overview statistics (total calls, success rate, avg response time)
- Interactive charts:
- Tool usage over time
- Response time percentiles
- Error rates
- Cache performance
- Real-time updates via SWR
- Filterable by time range (24h, 7d, 30d)
- Getting started guide
- Installation and configuration
- Usage examples
- API reference
- Privacy and analytics information
- Troubleshooting
The website fetches data from the analytics-server API:
// src/api/analytics.ts
export async function getOverviewStats(period: string) {
const response = await fetch(
`${process.env.NEXT_PUBLIC_ANALYTICS_API}/stats/overview?period=${period}`
);
return response.json();
}Uses SWR for automatic caching and revalidation:
// In dashboard component
const { data, error } = useSWR(
'/stats/overview',
() => getOverviewStats('7d'),
{ refreshInterval: 30000 } // Refresh every 30 seconds
);Tailwind CSS with custom theme:
// tailwind.config.js
module.exports = {
theme: {
extend: {
colors: {
primary: '#3B82F6', // Blue
secondary: '#10B981', // Green
accent: '#F59E0B', // Amber
}
}
}
}- Connect GitHub repository to Vercel
- Set environment variables in Vercel dashboard
- Deploy automatically on push to main
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --production
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]Deploy with docker-compose:
website:
build: ../website
ports:
- "3000:3000"
environment:
- NEXT_PUBLIC_ANALYTICS_API=https://analytics.weather-mcp.dev/v1- Static generation for homepage and docs
- Incremental Static Regeneration (ISR) for dashboard (revalidate every 60s)
- Client-side data fetching for real-time updates
- Image optimization via Next.js Image component
- Code splitting and lazy loading
See ../docs/contributing.md for contribution guidelines.
MIT