Discover the heartbeat of your city.
LocalPulse is a modern, lightweight single-page application (SPA) that aggregates real-time weather data and trending local news into a unified, beautiful interface. Built with Vanilla JavaScript, it demonstrates efficient API integration, modular code architecture, and responsive UI design.
- Smart Search: Instantly find data for any city globally.
- Current Weather: Real-time temperature, humidity, wind speed, and condition icons.
- 5-Day Forecast: Scrollable outlook for the upcoming week.
- newspaper Local News: Curated top headlines relevant to the searched location.
- Modern UI: Glassmorphism effects, smooth CSS transitions, and a "landing page" to "dashboard" layout shift.
- Fully Responsive: Optimized for desktops, tablets, and mobile devices.
- Interactive Modals: Built-in modal system for navigation links (About, Services, etc.).
- Frontend: HTML5, CSS3 (CSS Variables, Flexbox, Grid)
- Logic: Vanilla JavaScript (ES6 Modules)
- Data Sources:
- OpenWeatherMap API (Weather & Forecast)
- NewsAPI (Local News Aggregation)
- Tools: Vite
Based on the current file organization:
LOCALPULSE/
├── css/
│ ├── main.css # Core styling, variables, layout, and animations
│ └── responsive.css # Media queries for mobile/tablet adaptation
├── js/
│ ├── app.js # Main entry point, event listeners, and navigation logic
│ ├── news.js # NewsAPI fetch logic
│ ├── ui.js # DOM manipulation and rendering functions
│ ├── weather.js # OpenWeatherMap fetch logic and data processing
├── .gitignore # Files to exclude from Git (e.g., .env, node_modules)
├── index.html # Main HTML structure
├── LICENSE # Project License details
└── README.md # Project documentation
- API Keys: You need to obtain free API keys from:
- Runtime: This project uses Vite so the frontend can read
.envvalues viaimport.meta.env.
-
Clone the repository
git clone https://github.com/yourusername/localpulse.git cd localpulse -
Configure API Keys (.env)
Create a
.envfile in the project root and add the following:
# OpenWeatherMap API
VITE_WEATHER_API_KEY=YOUR_OPENWEATHER_API_KEY
VITE_WEATHER_BASE_URL=https://api.openweathermap.org/data/2.5/forecast
# News API
VITE_NEWS_API_KEY=YOUR_NEWSAPI_KEY
VITE_NEWS_BASE_URL=https://newsapi.org/v2/everything-
Install & Run
npm install npm run dev
Do not commit your real API keys to GitHub.
The project is set up to ignore .env via .gitignore. Ensure this remains in place if you fork or contribute.
- Landing Page: You are greeted with a clean search interface and a cityscape illustration.
- Search: Enter a city name (e.g., "Kolkata", "New Delhi") and hit Enter or click Search.
- Results: The UI transitions. The cityscape fades out, and cards for Weather and News slide in.
- Navigation: Click "Home" (or the logo) to reset the view. Click "Services" or "About" to view the modal overlays.
Contributions are welcome! Here's how you can help:
- Fork the project.
- Create your feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
Distributed under the MIT License. See LICENSE for more information.
Built with Love by Rishita

