A real-time monitoring dashboard for the Orwell Bridge (A14) providing live traffic status, weather conditions, and historical events. This project helps commuters and logistics companies stay informed about bridge conditions and potential delays.
The Orwell Bridge is a major cable-stayed bridge on the A14 in Suffolk, England, carrying traffic over the River Orwell. Due to its height and exposure, the bridge is frequently subject to closures during high winds, making real-time status monitoring essential for local traffic management.
- Real-Time Traffic Status: Live bridge status using TomTom Traffic API
- Weather Monitoring: Current weather conditions from Open-Meteo API
- Historical Events: Track past closures and delays with MongoDB storage
- Responsive Dashboard: Clean, mobile-friendly interface
- High-Traffic Optimization: Advanced caching with stale-while-revalidate pattern
- Status Indicators: Visual traffic light system (Open/Delayed/Closed)
- Direction-Specific Data: Separate monitoring for eastbound and westbound lanes
Visit the live application: Orwell Bridge Status
- Frontend: Next.js 15, React 19, TypeScript
- Styling: Tailwind CSS, shadcn/ui components
- APIs: TomTom Traffic API, Open-Meteo Weather API
- Database: MongoDB Atlas
- Caching: Custom in-memory cache with request deduplication
- Deployment: Vercel (recommended)
- Node.js 18+ and npm
- MongoDB Atlas account
- TomTom API key
- Open-Meteo API access (free)
Create a .env.local file in the root directory:
# Required API Keys
TOMTOM_API_KEY=your_tomtom_api_key_here
WEATHER_API_KEY=your_openmeteo_key_here
# MongoDB Connection
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/database?retryWrites=true&w=majority
# Optional: For development
NODE_ENV=development-
Clone the repository
git clone https://github.com/developedbyalex/OrwellBridgeStatusV2.git cd OrwellBridgeStatusV2 -
Install dependencies
npm install
-
Set up environment variables
- Copy
.env.exampleto.env.local - Fill in your API keys and MongoDB connection string
- Copy
-
Run the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
src/
├── app/
│ ├── api/
│ │ ├── bridge-status/ # Main bridge status endpoint
│ │ ├── events/ # Historical events API
│ │ └── weather/ # Weather data API
│ ├── globals.css # Global styles
│ ├── layout.tsx # App layout
│ └── page.tsx # Main dashboard
├── components/
│ └── ui/ # Reusable UI components
├── lib/
│ ├── cache.ts # Caching system
│ ├── mongodb.ts # Database connection
│ ├── traffic.ts # Traffic data processing
│ ├── weather.ts # Weather API integration
│ └── utils.ts # Utility functions
└── types/
└── bridge.ts # TypeScript definitions
GET /api/bridge-status- Current bridge status and traffic data- Returns real-time status for both directions with historical context
GET /api/events- Recent bridge closure and delay events- Filtered for significant events (closures/delays only)
GET /api/weather- Current weather conditions- Includes temperature, wind speed, and conditions
The application implements intelligent caching to handle high traffic:
- Bridge Status: 10-minute TTL, 5-minute stale time
- Weather Data: 15-minute TTL
- Events: 10-minute TTL
- Stale-While-Revalidate: Serves stale data while refreshing in background
- Request Deduplication: Prevents API spam during traffic spikes
-
Connect to Vercel
npm install -g vercel vercel
-
Add environment variables in Vercel dashboard
-
Deploy - Automatic deployments on git push
The application can be deployed on any Node.js hosting platform:
- Netlify
- Railway
- DigitalOcean App Platform
- AWS Amplify
- Built-in error handling and fallback mechanisms
- Console logging for debugging and monitoring
- Graceful degradation when APIs are unavailable
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- TomTom for traffic data API
- Open-Meteo for weather data
- Highways England for bridge specifications
- The open-source community for excellent tools and libraries
For issues and questions:
- Open an issue on GitHub
- Check the documentation
- Review existing issues for solutions
Note: This is an unofficial monitoring tool. For official bridge status and travel information, please refer to Highways England and local traffic authorities.