CoolingStations.org Water Station Tracker
A mobile-first web application for tracking water refill stations with social login, real-time status updates, and interactive mapping.
Features
- Multi-platform Authentication: Login via Google, Instagram, or traditional username/password
- Interactive Map: View all water stations with color-coded status indicators
- Mobile-First Design: Optimized for smartphones and tablets
- Real-time Updates: Track refill times and estimated empty times
- Status Color Coding:
- 🟢 Green: Recently refilled
- 🟡 Yellow: Needs refill soon
- 🔴 Red: Empty
- ⚫ Black: Not updated in 7+ days
Installation
-
Clone the repository
-
Install dependencies:
npm install
-
Set up environment variables in
.env
:SESSION_SECRET=your-secret-key GOOGLE_CLIENT_ID=your-google-client-id GOOGLE_CLIENT_SECRET=your-google-client-secret INSTAGRAM_CLIENT_ID=your-instagram-client-id INSTAGRAM_CLIENT_SECRET=your-instagram-client-secret
-
Run the application:
npm start
OAuth Setup
Google OAuth
- Go to Google Cloud Console
- Create a new project or select existing
- Enable Google+ API
- Create OAuth 2.0 credentials
- Add authorized redirect URI:
http://localhost:3000/auth/google/callback
Instagram OAuth
- Go to Instagram Developers
- Create a new app
- Add Instagram Basic Display product
- Create Instagram App
- Add redirect URI:
http://localhost:3000/auth/instagram/callback
Database Schema
The app uses SQLite with three main tables:
users
: User authentication and profile datawater_stations
: Station locations and basic infostation_updates
: Status updates with timestamps
API Endpoints
GET /
: Public map viewGET /login
: Login pageGET /dashboard
: User dashboard (requires auth)GET /api/stations
: Get all stationsPOST /api/stations
: Add new station (requires auth)POST /api/stations/:id/update
: Update station status (requires auth)
Usage
- Public Users: Can view the map and station statuses
- Registered Users: Can add new stations and update existing ones
- Station Updates: Include description, refill time, and estimated empty time
- Mobile Interface: Responsive design works on all screen sizes
Development
For development with auto-reload:
npm run dev
Production Deployment
- Set
NODE_ENV=production
- Configure HTTPS and update session cookie settings
- Set up proper database backup
- Configure reverse proxy (nginx recommended)
License
MIT License
Description
Languages
HTML
74.5%
JavaScript
25.5%