This application scrapes tweets and other metrics from Twitter/X API, stores them in a SQLite database, and displays them in a web interface.
├── backend/
│ ├── database/
│ │ ├── migrations.ts # Schema definitions
│ │ └── queries.ts # DB query functions
│ ├── services/
│ │ └── twitter.ts # Twitter API integration
│ ├── routes/
│ │ ├── api.ts # API routes
│ │ └── static.ts # Static file serving
│ ├── cron.ts # Cron job for data fetching
│ └── index.ts # Main entry point
├── frontend/
│ ├── components/
│ │ ├── TweetList.js # Tweet list component
│ │ └── MetricsChart.js # Metrics visualization
│ ├── index.html # Main HTML template
│ ├── app.js # Frontend JS entry point
│ └── style.css # Custom styles
└── shared/
└── types.ts # Shared types and interfaces
Set up the following environment variables in Val Town:
TWITTER_API_KEY - Your Twitter/X API keyTWITTER_API_SECRET - Your Twitter/X API secretTWITTER_BEARER_TOKEN - Your Twitter/X bearer tokenDeploy the application on Val Town