first
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
This directory contains the server-side code for the Tweet Metrics Tracker application.
index.ts- Main entry point for the HTTP APIcron.ts- Cron job for periodically fetching and updating tweetsdatabase/- Database schema and queriesroutes/- API routes and static file servingservices/- External API integrations (Twitter API)
GET /api/tweets- Get tweets with paginationGET /api/tweets/:id- Get a single tweet by IDGET /api/tweets/:id/metrics- Get metrics history for a tweetGET /api/top-tweets- Get top tweets by engagementGET /api/fetch/:username- Fetch tweets for a specific userGET /api/search?q=query- Search tweets by keyword
TWITTER_API_KEY- Twitter API keyTWITTER_API_SECRET- Twitter API secretTWITTER_BEARER_TOKEN- Twitter bearer token